annotate hotspot/src/share/vm/opto/narrowptrnode.hpp @ 23528:8f1a7f5e8066

8001532: C2 node files refactoring Summary: Split C2 node files into cast, convert, countbits, intrinsic, move, narrowptr and opaquenode classes Reviewed-by: kvn, morris
author morris
date Tue, 01 Apr 2014 09:05:20 -0700
parents
children 4b12a5b40064
rev   line source
morris@23528 1 /*
morris@23528 2 * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
morris@23528 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
morris@23528 4 *
morris@23528 5 * This code is free software; you can redistribute it and/or modify it
morris@23528 6 * under the terms of the GNU General Public License version 2 only, as
morris@23528 7 * published by the Free Software Foundation.
morris@23528 8 *
morris@23528 9 * This code is distributed in the hope that it will be useful, but WITHOUT
morris@23528 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
morris@23528 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
morris@23528 12 * version 2 for more details (a copy is included in the LICENSE file that
morris@23528 13 * accompanied this code).
morris@23528 14 *
morris@23528 15 * You should have received a copy of the GNU General Public License version
morris@23528 16 * 2 along with this work; if not, write to the Free Software Foundation,
morris@23528 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
morris@23528 18 *
morris@23528 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
morris@23528 20 * or visit www.oracle.com if you need additional information or have any
morris@23528 21 * questions.
morris@23528 22 *
morris@23528 23 */
morris@23528 24
morris@23528 25 #ifndef SHARE_VM_OPTO_NARROWPTRNODE_HPP
morris@23528 26 #define SHARE_VM_OPTO_NARROWPTRNODE_HPP
morris@23528 27
morris@23528 28 #include "opto/node.hpp"
morris@23528 29 #include "opto/opcodes.hpp"
morris@23528 30
morris@23528 31 //------------------------------EncodeNarrowPtr--------------------------------
morris@23528 32 class EncodeNarrowPtrNode : public TypeNode {
morris@23528 33 protected:
morris@23528 34 EncodeNarrowPtrNode(Node* value, const Type* type):
morris@23528 35 TypeNode(type, 2) {
morris@23528 36 init_class_id(Class_EncodeNarrowPtr);
morris@23528 37 init_req(0, NULL);
morris@23528 38 init_req(1, value);
morris@23528 39 }
morris@23528 40 public:
morris@23528 41 virtual uint ideal_reg() const { return Op_RegN; }
morris@23528 42 virtual Node *Ideal_DU_postCCP( PhaseCCP *ccp );
morris@23528 43 };
morris@23528 44
morris@23528 45 //------------------------------EncodeP--------------------------------
morris@23528 46 // Encodes an oop pointers into its compressed form
morris@23528 47 // Takes an extra argument which is the real heap base as a long which
morris@23528 48 // may be useful for code generation in the backend.
morris@23528 49 class EncodePNode : public EncodeNarrowPtrNode {
morris@23528 50 public:
morris@23528 51 EncodePNode(Node* value, const Type* type):
morris@23528 52 EncodeNarrowPtrNode(value, type) {
morris@23528 53 init_class_id(Class_EncodeP);
morris@23528 54 }
morris@23528 55 virtual int Opcode() const;
morris@23528 56 virtual Node *Identity( PhaseTransform *phase );
morris@23528 57 virtual const Type *Value( PhaseTransform *phase ) const;
morris@23528 58 };
morris@23528 59
morris@23528 60 //------------------------------EncodePKlass--------------------------------
morris@23528 61 // Encodes a klass pointer into its compressed form
morris@23528 62 // Takes an extra argument which is the real heap base as a long which
morris@23528 63 // may be useful for code generation in the backend.
morris@23528 64 class EncodePKlassNode : public EncodeNarrowPtrNode {
morris@23528 65 public:
morris@23528 66 EncodePKlassNode(Node* value, const Type* type):
morris@23528 67 EncodeNarrowPtrNode(value, type) {
morris@23528 68 init_class_id(Class_EncodePKlass);
morris@23528 69 }
morris@23528 70 virtual int Opcode() const;
morris@23528 71 virtual Node *Identity( PhaseTransform *phase );
morris@23528 72 virtual const Type *Value( PhaseTransform *phase ) const;
morris@23528 73 };
morris@23528 74
morris@23528 75 //------------------------------DecodeNarrowPtr--------------------------------
morris@23528 76 class DecodeNarrowPtrNode : public TypeNode {
morris@23528 77 protected:
morris@23528 78 DecodeNarrowPtrNode(Node* value, const Type* type):
morris@23528 79 TypeNode(type, 2) {
morris@23528 80 init_class_id(Class_DecodeNarrowPtr);
morris@23528 81 init_req(0, NULL);
morris@23528 82 init_req(1, value);
morris@23528 83 }
morris@23528 84 public:
morris@23528 85 virtual uint ideal_reg() const { return Op_RegP; }
morris@23528 86 };
morris@23528 87
morris@23528 88 //------------------------------DecodeN--------------------------------
morris@23528 89 // Converts a narrow oop into a real oop ptr.
morris@23528 90 // Takes an extra argument which is the real heap base as a long which
morris@23528 91 // may be useful for code generation in the backend.
morris@23528 92 class DecodeNNode : public DecodeNarrowPtrNode {
morris@23528 93 public:
morris@23528 94 DecodeNNode(Node* value, const Type* type):
morris@23528 95 DecodeNarrowPtrNode(value, type) {
morris@23528 96 init_class_id(Class_DecodeN);
morris@23528 97 }
morris@23528 98 virtual int Opcode() const;
morris@23528 99 virtual const Type *Value( PhaseTransform *phase ) const;
morris@23528 100 virtual Node *Identity( PhaseTransform *phase );
morris@23528 101 };
morris@23528 102
morris@23528 103 //------------------------------DecodeNKlass--------------------------------
morris@23528 104 // Converts a narrow klass pointer into a real klass ptr.
morris@23528 105 // Takes an extra argument which is the real heap base as a long which
morris@23528 106 // may be useful for code generation in the backend.
morris@23528 107 class DecodeNKlassNode : public DecodeNarrowPtrNode {
morris@23528 108 public:
morris@23528 109 DecodeNKlassNode(Node* value, const Type* type):
morris@23528 110 DecodeNarrowPtrNode(value, type) {
morris@23528 111 init_class_id(Class_DecodeNKlass);
morris@23528 112 }
morris@23528 113 virtual int Opcode() const;
morris@23528 114 virtual const Type *Value( PhaseTransform *phase ) const;
morris@23528 115 virtual Node *Identity( PhaseTransform *phase );
morris@23528 116 };
morris@23528 117
morris@23528 118 #endif // SHARE_VM_OPTO_NARROWPTRNODE_HPP
morris@23528 119