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