300 class CastPPNode: public ConstraintCastNode {
301 public:
302 CastPPNode (Node* ctrl, Node* n, const Type* t, const DependencyType& dependency = DependencyType::FloatingNarrowing, const TypeTuple* types = nullptr)
303 : ConstraintCastNode(ctrl, n, t, dependency, types) {
304 init_class_id(Class_CastPP);
305 }
306 virtual int Opcode() const;
307 virtual uint ideal_reg() const { return Op_RegP; }
308 };
309
310 //------------------------------CheckCastPPNode--------------------------------
311 // for _checkcast, cast pointer to pointer (different type), without JOIN,
312 class CheckCastPPNode: public ConstraintCastNode {
313 public:
314 CheckCastPPNode(Node* ctrl, Node* n, const Type* t, const DependencyType& dependency = DependencyType::FloatingNarrowing, const TypeTuple* types = nullptr)
315 : ConstraintCastNode(ctrl, n, t, dependency, types) {
316 assert(ctrl != nullptr, "control must be set");
317 init_class_id(Class_CheckCastPP);
318 }
319
320 virtual const Type* Value(PhaseGVN* phase) const;
321 virtual int Opcode() const;
322 virtual uint ideal_reg() const { return Op_RegP; }
323 bool depends_only_on_test() const { return !type()->isa_rawptr() && ConstraintCastNode::depends_only_on_test(); }
324 };
325
326
327 //------------------------------CastX2PNode-------------------------------------
328 // convert a machine-pointer-sized integer to a raw pointer
329 class CastX2PNode : public Node {
330 public:
331 CastX2PNode( Node *n ) : Node(nullptr, n) {}
332 virtual int Opcode() const;
333 virtual const Type* Value(PhaseGVN* phase) const;
334 virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
335 virtual Node* Identity(PhaseGVN* phase);
336 virtual uint ideal_reg() const { return Op_RegP; }
337 virtual const Type *bottom_type() const { return TypeRawPtr::BOTTOM; }
338 };
339
340 //------------------------------CastP2XNode-------------------------------------
341 // Used in both 32-bit and 64-bit land.
342 // Used for card-marks and unsafe pointer math.
343 class CastP2XNode : public Node {
344 public:
345 CastP2XNode( Node *ctrl, Node *n ) : Node(ctrl, n) {}
346 virtual int Opcode() const;
347 virtual const Type* Value(PhaseGVN* phase) const;
348 virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
349 virtual Node* Identity(PhaseGVN* phase);
350 virtual uint ideal_reg() const { return Op_RegX; }
351 virtual const Type *bottom_type() const { return TypeX_X; }
352 // Return false to keep node from moving away from an associated card mark.
353 virtual bool depends_only_on_test() const { return false; }
354 };
355
356
357
358 #endif // SHARE_OPTO_CASTNODE_HPP
|
300 class CastPPNode: public ConstraintCastNode {
301 public:
302 CastPPNode (Node* ctrl, Node* n, const Type* t, const DependencyType& dependency = DependencyType::FloatingNarrowing, const TypeTuple* types = nullptr)
303 : ConstraintCastNode(ctrl, n, t, dependency, types) {
304 init_class_id(Class_CastPP);
305 }
306 virtual int Opcode() const;
307 virtual uint ideal_reg() const { return Op_RegP; }
308 };
309
310 //------------------------------CheckCastPPNode--------------------------------
311 // for _checkcast, cast pointer to pointer (different type), without JOIN,
312 class CheckCastPPNode: public ConstraintCastNode {
313 public:
314 CheckCastPPNode(Node* ctrl, Node* n, const Type* t, const DependencyType& dependency = DependencyType::FloatingNarrowing, const TypeTuple* types = nullptr)
315 : ConstraintCastNode(ctrl, n, t, dependency, types) {
316 assert(ctrl != nullptr, "control must be set");
317 init_class_id(Class_CheckCastPP);
318 }
319
320 virtual Node* Identity(PhaseGVN* phase);
321 virtual const Type* Value(PhaseGVN* phase) const;
322 virtual int Opcode() const;
323 virtual uint ideal_reg() const { return Op_RegP; }
324 bool depends_only_on_test() const { return !type()->isa_rawptr() && ConstraintCastNode::depends_only_on_test(); }
325 };
326
327
328 //------------------------------CastX2PNode-------------------------------------
329 // convert a machine-pointer-sized integer to a raw pointer
330 class CastX2PNode : public Node {
331 public:
332 CastX2PNode( Node *n ) : Node(nullptr, n) {}
333 virtual int Opcode() const;
334 virtual const Type* Value(PhaseGVN* phase) const;
335 virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
336 virtual Node* Identity(PhaseGVN* phase);
337 virtual uint ideal_reg() const { return Op_RegP; }
338 virtual const Type *bottom_type() const { return TypeRawPtr::BOTTOM; }
339 };
340
341 // Cast an integer to a narrow oop
342 class CastI2NNode : public TypeNode {
343 public:
344 CastI2NNode(Node* ctrl, Node* n, const Type* t) : TypeNode(t, 2) {
345 init_req(0, ctrl);
346 init_req(1, n);
347 }
348 virtual int Opcode() const;
349 virtual uint ideal_reg() const { return Op_RegN; }
350 };
351
352 //------------------------------CastP2XNode-------------------------------------
353 // Used in both 32-bit and 64-bit land.
354 // Used for card-marks and unsafe pointer math.
355 class CastP2XNode : public Node {
356 public:
357 CastP2XNode( Node *ctrl, Node *n ) : Node(ctrl, n) {}
358 virtual int Opcode() const;
359 virtual const Type* Value(PhaseGVN* phase) const;
360 virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
361 virtual Node* Identity(PhaseGVN* phase);
362 virtual uint ideal_reg() const { return Op_RegX; }
363 virtual const Type *bottom_type() const { return TypeX_X; }
364 // Return false to keep node from moving away from an associated card mark.
365 virtual bool depends_only_on_test() const { return false; }
366 };
367
368 #endif // SHARE_OPTO_CASTNODE_HPP
|