< prev index next >

src/hotspot/share/opto/castnode.hpp

Print this page

178 // cast pointer to pointer (different type)
179 class CastPPNode: public ConstraintCastNode {
180   public:
181   CastPPNode (Node* ctrl, Node* n, const Type* t, DependencyType dependency = RegularDependency, const TypeTuple* types = nullptr)
182     : ConstraintCastNode(ctrl, n, t, dependency, types) {
183     init_class_id(Class_CastPP);
184   }
185   virtual int Opcode() const;
186   virtual uint ideal_reg() const { return Op_RegP; }
187 };
188 
189 //------------------------------CheckCastPPNode--------------------------------
190 // for _checkcast, cast pointer to pointer (different type), without JOIN,
191 class CheckCastPPNode: public ConstraintCastNode {
192   public:
193   CheckCastPPNode(Node* ctrl, Node* n, const Type* t, DependencyType dependency = RegularDependency, const TypeTuple* types = nullptr)
194     : ConstraintCastNode(ctrl, n, t, dependency, types) {
195     init_class_id(Class_CheckCastPP);
196   }
197 

198   virtual const Type* Value(PhaseGVN* phase) const;
199   virtual int   Opcode() const;
200   virtual uint  ideal_reg() const { return Op_RegP; }
201   bool depends_only_on_test() const { return !type()->isa_rawptr() && ConstraintCastNode::depends_only_on_test(); }
202  };
203 
204 
205 //------------------------------CastX2PNode-------------------------------------
206 // convert a machine-pointer-sized integer to a raw pointer
207 class CastX2PNode : public Node {
208   public:
209   CastX2PNode( Node *n ) : Node(nullptr, n) {}
210   virtual int Opcode() const;
211   virtual const Type* Value(PhaseGVN* phase) const;
212   virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
213   virtual Node* Identity(PhaseGVN* phase);
214   virtual uint ideal_reg() const { return Op_RegP; }
215   virtual const Type *bottom_type() const { return TypeRawPtr::BOTTOM; }
216 };
217 
218 //------------------------------CastP2XNode-------------------------------------
219 // Used in both 32-bit and 64-bit land.
220 // Used for card-marks and unsafe pointer math.
221 class CastP2XNode : public Node {
222   public:
223   CastP2XNode( Node *ctrl, Node *n ) : Node(ctrl, n) {}
224   virtual int Opcode() const;
225   virtual const Type* Value(PhaseGVN* phase) const;
226   virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
227   virtual Node* Identity(PhaseGVN* phase);
228   virtual uint ideal_reg() const { return Op_RegX; }
229   virtual const Type *bottom_type() const { return TypeX_X; }
230   // Return false to keep node from moving away from an associated card mark.
231   virtual bool depends_only_on_test() const { return false; }
232 };
233 
234 
235 
236 #endif // SHARE_OPTO_CASTNODE_HPP

178 // cast pointer to pointer (different type)
179 class CastPPNode: public ConstraintCastNode {
180   public:
181   CastPPNode (Node* ctrl, Node* n, const Type* t, DependencyType dependency = RegularDependency, const TypeTuple* types = nullptr)
182     : ConstraintCastNode(ctrl, n, t, dependency, types) {
183     init_class_id(Class_CastPP);
184   }
185   virtual int Opcode() const;
186   virtual uint ideal_reg() const { return Op_RegP; }
187 };
188 
189 //------------------------------CheckCastPPNode--------------------------------
190 // for _checkcast, cast pointer to pointer (different type), without JOIN,
191 class CheckCastPPNode: public ConstraintCastNode {
192   public:
193   CheckCastPPNode(Node* ctrl, Node* n, const Type* t, DependencyType dependency = RegularDependency, const TypeTuple* types = nullptr)
194     : ConstraintCastNode(ctrl, n, t, dependency, types) {
195     init_class_id(Class_CheckCastPP);
196   }
197 
198   virtual Node* Identity(PhaseGVN* phase);
199   virtual const Type* Value(PhaseGVN* phase) const;
200   virtual int   Opcode() const;
201   virtual uint  ideal_reg() const { return Op_RegP; }
202   bool depends_only_on_test() const { return !type()->isa_rawptr() && ConstraintCastNode::depends_only_on_test(); }
203  };
204 
205 
206 //------------------------------CastX2PNode-------------------------------------
207 // convert a machine-pointer-sized integer to a raw pointer
208 class CastX2PNode : public Node {
209   public:
210   CastX2PNode( Node *n ) : Node(nullptr, n) {}
211   virtual int Opcode() const;
212   virtual const Type* Value(PhaseGVN* phase) const;
213   virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
214   virtual Node* Identity(PhaseGVN* phase);
215   virtual uint ideal_reg() const { return Op_RegP; }
216   virtual const Type *bottom_type() const { return TypeRawPtr::BOTTOM; }
217 };
218 
219 //------------------------------CastP2XNode-------------------------------------
220 // Used in both 32-bit and 64-bit land.
221 // Used for card-marks and unsafe pointer math.
222 class CastP2XNode : public Node {
223   public:
224   CastP2XNode( Node *ctrl, Node *n ) : Node(ctrl, n) {}
225   virtual int Opcode() const;
226   virtual const Type* Value(PhaseGVN* phase) const;
227   virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
228   virtual Node* Identity(PhaseGVN* phase);
229   virtual uint ideal_reg() const { return Op_RegX; }
230   virtual const Type *bottom_type() const { return TypeX_X; }
231   // Return false to keep node from moving away from an associated card mark.
232   virtual bool depends_only_on_test() const { return false; }
233 };
234 


235 #endif // SHARE_OPTO_CASTNODE_HPP
< prev index next >