31
32 //------------------------------ConstraintCastNode-----------------------------
33 // cast to a different range
34 class ConstraintCastNode: public TypeNode {
35 public:
36 ConstraintCastNode (Node *n, const Type *t ): TypeNode(t,2) {
37 init_class_id(Class_ConstraintCast);
38 init_req(1, n);
39 }
40 virtual Node *Identity( PhaseTransform *phase );
41 virtual const Type *Value( PhaseTransform *phase ) const;
42 virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
43 virtual int Opcode() const;
44 virtual uint ideal_reg() const = 0;
45 virtual Node *Ideal_DU_postCCP( PhaseCCP * );
46 };
47
48 //------------------------------CastIINode-------------------------------------
49 // cast integer to integer (different range)
50 class CastIINode: public ConstraintCastNode {
51 public:
52 CastIINode (Node *n, const Type *t ): ConstraintCastNode(n,t) {}
53 virtual int Opcode() const;
54 virtual uint ideal_reg() const { return Op_RegI; }
55 };
56
57 //------------------------------CastPPNode-------------------------------------
58 // cast pointer to pointer (different type)
59 class CastPPNode: public ConstraintCastNode {
60 public:
61 CastPPNode (Node *n, const Type *t ): ConstraintCastNode(n, t) {}
62 virtual int Opcode() const;
63 virtual uint ideal_reg() const { return Op_RegP; }
64 virtual Node *Ideal_DU_postCCP( PhaseCCP * );
65 };
66
67 //------------------------------CheckCastPPNode--------------------------------
68 // for _checkcast, cast pointer to pointer (different type), without JOIN,
69 class CheckCastPPNode: public TypeNode {
70 public:
71 CheckCastPPNode( Node *c, Node *n, const Type *t ) : TypeNode(t,2) {
72 init_class_id(Class_CheckCastPP);
73 init_req(0, c);
74 init_req(1, n);
|
31
32 //------------------------------ConstraintCastNode-----------------------------
33 // cast to a different range
34 class ConstraintCastNode: public TypeNode {
35 public:
36 ConstraintCastNode (Node *n, const Type *t ): TypeNode(t,2) {
37 init_class_id(Class_ConstraintCast);
38 init_req(1, n);
39 }
40 virtual Node *Identity( PhaseTransform *phase );
41 virtual const Type *Value( PhaseTransform *phase ) const;
42 virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
43 virtual int Opcode() const;
44 virtual uint ideal_reg() const = 0;
45 virtual Node *Ideal_DU_postCCP( PhaseCCP * );
46 };
47
48 //------------------------------CastIINode-------------------------------------
49 // cast integer to integer (different range)
50 class CastIINode: public ConstraintCastNode {
51 private:
52 // Can this node be removed post CCP or does it carry a required dependency?
53 const bool _carry_dependency;
54
55 protected:
56 virtual uint cmp( const Node &n ) const;
57 virtual uint size_of() const;
58
59 public:
60 CastIINode(Node *n, const Type *t, bool carry_dependency = false)
61 : ConstraintCastNode(n,t), _carry_dependency(carry_dependency) {}
62 virtual int Opcode() const;
63 virtual uint ideal_reg() const { return Op_RegI; }
64 virtual Node *Identity( PhaseTransform *phase );
65 virtual const Type *Value( PhaseTransform *phase ) const;
66 virtual Node *Ideal_DU_postCCP( PhaseCCP * );
67 #ifndef PRODUCT
68 virtual void dump_spec(outputStream *st) const;
69 #endif
70 };
71
72 //------------------------------CastPPNode-------------------------------------
73 // cast pointer to pointer (different type)
74 class CastPPNode: public ConstraintCastNode {
75 public:
76 CastPPNode (Node *n, const Type *t ): ConstraintCastNode(n, t) {}
77 virtual int Opcode() const;
78 virtual uint ideal_reg() const { return Op_RegP; }
79 virtual Node *Ideal_DU_postCCP( PhaseCCP * );
80 };
81
82 //------------------------------CheckCastPPNode--------------------------------
83 // for _checkcast, cast pointer to pointer (different type), without JOIN,
84 class CheckCastPPNode: public TypeNode {
85 public:
86 CheckCastPPNode( Node *c, Node *n, const Type *t ) : TypeNode(t,2) {
87 init_class_id(Class_CheckCastPP);
88 init_req(0, c);
89 init_req(1, n);
|