< prev index next >

src/hotspot/share/opto/castnode.hpp

Print this page

199 class CastPPNode: public ConstraintCastNode {
200   public:
201   CastPPNode (Node* ctrl, Node* n, const Type* t, DependencyType dependency = RegularDependency, const TypeTuple* types = nullptr)
202     : ConstraintCastNode(ctrl, n, t, dependency, types) {
203     init_class_id(Class_CastPP);
204   }
205   virtual int Opcode() const;
206   virtual uint ideal_reg() const { return Op_RegP; }
207 };
208 
209 //------------------------------CheckCastPPNode--------------------------------
210 // for _checkcast, cast pointer to pointer (different type), without JOIN,
211 class CheckCastPPNode: public ConstraintCastNode {
212   public:
213   CheckCastPPNode(Node* ctrl, Node* n, const Type* t, DependencyType dependency = RegularDependency, const TypeTuple* types = nullptr)
214     : ConstraintCastNode(ctrl, n, t, dependency, types) {
215     assert(ctrl != nullptr, "control must be set");
216     init_class_id(Class_CheckCastPP);
217   }
218 

219   virtual const Type* Value(PhaseGVN* phase) const;
220   virtual int   Opcode() const;
221   virtual uint  ideal_reg() const { return Op_RegP; }
222   bool depends_only_on_test() const { return !type()->isa_rawptr() && ConstraintCastNode::depends_only_on_test(); }
223  };
224 
225 
226 //------------------------------CastX2PNode-------------------------------------
227 // convert a machine-pointer-sized integer to a raw pointer
228 class CastX2PNode : public Node {
229   public:
230   CastX2PNode( Node *n ) : Node(nullptr, n) {}
231   virtual int Opcode() const;
232   virtual const Type* Value(PhaseGVN* phase) const;
233   virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
234   virtual Node* Identity(PhaseGVN* phase);
235   virtual uint ideal_reg() const { return Op_RegP; }
236   virtual const Type *bottom_type() const { return TypeRawPtr::BOTTOM; }
237 };
238 











239 //------------------------------CastP2XNode-------------------------------------
240 // Used in both 32-bit and 64-bit land.
241 // Used for card-marks and unsafe pointer math.
242 class CastP2XNode : public Node {
243   public:
244   CastP2XNode( Node *ctrl, Node *n ) : Node(ctrl, n) {}
245   virtual int Opcode() const;
246   virtual const Type* Value(PhaseGVN* phase) const;
247   virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
248   virtual Node* Identity(PhaseGVN* phase);
249   virtual uint ideal_reg() const { return Op_RegX; }
250   virtual const Type *bottom_type() const { return TypeX_X; }
251   // Return false to keep node from moving away from an associated card mark.
252   virtual bool depends_only_on_test() const { return false; }
253 };
254 
255 
256 
257 #endif // SHARE_OPTO_CASTNODE_HPP

199 class CastPPNode: public ConstraintCastNode {
200   public:
201   CastPPNode (Node* ctrl, Node* n, const Type* t, DependencyType dependency = RegularDependency, const TypeTuple* types = nullptr)
202     : ConstraintCastNode(ctrl, n, t, dependency, types) {
203     init_class_id(Class_CastPP);
204   }
205   virtual int Opcode() const;
206   virtual uint ideal_reg() const { return Op_RegP; }
207 };
208 
209 //------------------------------CheckCastPPNode--------------------------------
210 // for _checkcast, cast pointer to pointer (different type), without JOIN,
211 class CheckCastPPNode: public ConstraintCastNode {
212   public:
213   CheckCastPPNode(Node* ctrl, Node* n, const Type* t, DependencyType dependency = RegularDependency, const TypeTuple* types = nullptr)
214     : ConstraintCastNode(ctrl, n, t, dependency, types) {
215     assert(ctrl != nullptr, "control must be set");
216     init_class_id(Class_CheckCastPP);
217   }
218 
219   virtual Node* Identity(PhaseGVN* phase);
220   virtual const Type* Value(PhaseGVN* phase) const;
221   virtual int   Opcode() const;
222   virtual uint  ideal_reg() const { return Op_RegP; }
223   bool depends_only_on_test() const { return !type()->isa_rawptr() && ConstraintCastNode::depends_only_on_test(); }
224  };
225 
226 
227 //------------------------------CastX2PNode-------------------------------------
228 // convert a machine-pointer-sized integer to a raw pointer
229 class CastX2PNode : public Node {
230   public:
231   CastX2PNode( Node *n ) : Node(nullptr, n) {}
232   virtual int Opcode() const;
233   virtual const Type* Value(PhaseGVN* phase) const;
234   virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
235   virtual Node* Identity(PhaseGVN* phase);
236   virtual uint ideal_reg() const { return Op_RegP; }
237   virtual const Type *bottom_type() const { return TypeRawPtr::BOTTOM; }
238 };
239 
240 // Cast an integer to a narrow oop
241 class CastI2NNode : public TypeNode {
242   public:
243   CastI2NNode(Node* ctrl, Node* n, const Type* t) : TypeNode(t, 2) {
244     init_req(0, ctrl);
245     init_req(1, n);
246   }
247   virtual int Opcode() const;
248   virtual uint ideal_reg() const { return Op_RegN; }
249 };
250 
251 //------------------------------CastP2XNode-------------------------------------
252 // Used in both 32-bit and 64-bit land.
253 // Used for card-marks and unsafe pointer math.
254 class CastP2XNode : public Node {
255   public:
256   CastP2XNode( Node *ctrl, Node *n ) : Node(ctrl, n) {}
257   virtual int Opcode() const;
258   virtual const Type* Value(PhaseGVN* phase) const;
259   virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
260   virtual Node* Identity(PhaseGVN* phase);
261   virtual uint ideal_reg() const { return Op_RegX; }
262   virtual const Type *bottom_type() const { return TypeX_X; }
263   // Return false to keep node from moving away from an associated card mark.
264   virtual bool depends_only_on_test() const { return false; }
265 };
266 


267 #endif // SHARE_OPTO_CASTNODE_HPP
< prev index next >