45 init_req(1, n); 46 } 47 virtual Node* Identity(PhaseGVN* phase); 48 virtual const Type* Value(PhaseGVN* phase) const; 49 virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); 50 virtual int Opcode() const; 51 virtual uint ideal_reg() const = 0; 52 virtual bool depends_only_on_test() const { return !_carry_dependency; } 53 bool carry_dependency() const { return _carry_dependency; } 54 TypeNode* dominating_cast(PhaseTransform *phase) const; 55 static Node* make_cast(int opcode, Node* c, Node *n, const Type *t, bool carry_dependency); 56 57 #ifndef PRODUCT 58 virtual void dump_spec(outputStream *st) const; 59 #endif 60 }; 61 62 //------------------------------CastIINode------------------------------------- 63 // cast integer to integer (different range) 64 class CastIINode: public ConstraintCastNode { 65 public: 66 CastIINode(Node *n, const Type *t, bool carry_dependency = false) 67 : ConstraintCastNode(n, t, carry_dependency) {} 68 virtual int Opcode() const; 69 virtual uint ideal_reg() const { return Op_RegI; } 70 virtual const Type* Value(PhaseGVN* phase) const; 71 virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); 72 }; 73 74 //------------------------------CastPPNode------------------------------------- 75 // cast pointer to pointer (different type) 76 class CastPPNode: public ConstraintCastNode { 77 public: 78 CastPPNode (Node *n, const Type *t, bool carry_dependency = false) 79 : ConstraintCastNode(n, t, carry_dependency) { 80 } 81 virtual int Opcode() const; 82 virtual uint ideal_reg() const { return Op_RegP; } 83 }; 84 85 //------------------------------CheckCastPPNode-------------------------------- 86 // for _checkcast, cast pointer to pointer (different type), without JOIN, 87 class CheckCastPPNode: public ConstraintCastNode { 88 public: 89 CheckCastPPNode(Node *c, Node *n, const Type *t, bool carry_dependency = false) 90 : ConstraintCastNode(n, t, carry_dependency) { 91 init_class_id(Class_CheckCastPP); | 45 init_req(1, n); 46 } 47 virtual Node* Identity(PhaseGVN* phase); 48 virtual const Type* Value(PhaseGVN* phase) const; 49 virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); 50 virtual int Opcode() const; 51 virtual uint ideal_reg() const = 0; 52 virtual bool depends_only_on_test() const { return !_carry_dependency; } 53 bool carry_dependency() const { return _carry_dependency; } 54 TypeNode* dominating_cast(PhaseTransform *phase) const; 55 static Node* make_cast(int opcode, Node* c, Node *n, const Type *t, bool carry_dependency); 56 57 #ifndef PRODUCT 58 virtual void dump_spec(outputStream *st) const; 59 #endif 60 }; 61 62 //------------------------------CastIINode------------------------------------- 63 // cast integer to integer (different range) 64 class CastIINode: public ConstraintCastNode { 65 protected: 66 // Is this node dependent on a range check? 67 const bool _range_check_dependency; 68 virtual uint cmp(const Node &n) const; 69 virtual uint size_of() const; 70 71 public: 72 CastIINode(Node* n, const Type* t, bool carry_dependency = false, bool range_check_dependency = false) 73 : ConstraintCastNode(n, t, carry_dependency), _range_check_dependency(range_check_dependency) { 74 init_class_id(Class_CastII); 75 } 76 virtual int Opcode() const; 77 virtual uint ideal_reg() const { return Op_RegI; } 78 virtual const Type* Value(PhaseGVN* phase) const; 79 virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); 80 const bool has_range_check() { return _range_check_dependency; } 81 #ifndef PRODUCT 82 virtual void dump_spec(outputStream* st) const; 83 #endif 84 }; 85 86 //------------------------------CastPPNode------------------------------------- 87 // cast pointer to pointer (different type) 88 class CastPPNode: public ConstraintCastNode { 89 public: 90 CastPPNode (Node *n, const Type *t, bool carry_dependency = false) 91 : ConstraintCastNode(n, t, carry_dependency) { 92 } 93 virtual int Opcode() const; 94 virtual uint ideal_reg() const { return Op_RegP; } 95 }; 96 97 //------------------------------CheckCastPPNode-------------------------------- 98 // for _checkcast, cast pointer to pointer (different type), without JOIN, 99 class CheckCastPPNode: public ConstraintCastNode { 100 public: 101 CheckCastPPNode(Node *c, Node *n, const Type *t, bool carry_dependency = false) 102 : ConstraintCastNode(n, t, carry_dependency) { 103 init_class_id(Class_CheckCastPP); |