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