< prev index next >

src/share/vm/opto/castnode.hpp

Print this page




  45     init_req(1, n);
  46   }
  47   virtual Node* Identity(PhaseGVN* phase);
  48   virtual const Type* Value(PhaseGVN* phase) const;
  49   virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
  50   virtual int Opcode() const;
  51   virtual uint ideal_reg() const = 0;
  52   virtual bool depends_only_on_test() const { return !_carry_dependency; }
  53   bool carry_dependency() const { return _carry_dependency; }
  54   TypeNode* dominating_cast(PhaseTransform *phase) const;
  55   static Node* make_cast(int opcode,  Node* c, Node *n, const Type *t, bool carry_dependency);
  56 
  57 #ifndef PRODUCT
  58   virtual void dump_spec(outputStream *st) const;
  59 #endif
  60 };
  61 
  62 //------------------------------CastIINode-------------------------------------
  63 // cast integer to integer (different range)
  64 class CastIINode: public ConstraintCastNode {






  65   public:
  66   CastIINode(Node *n, const Type *t, bool carry_dependency = false)
  67     : ConstraintCastNode(n, t, carry_dependency) {}


  68   virtual int Opcode() const;
  69   virtual uint ideal_reg() const { return Op_RegI; }
  70   virtual const Type* Value(PhaseGVN* phase) const;
  71   virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);












  72 };
  73 
  74 //------------------------------CastPPNode-------------------------------------
  75 // cast pointer to pointer (different type)
  76 class CastPPNode: public ConstraintCastNode {
  77   public:
  78   CastPPNode (Node *n, const Type *t, bool carry_dependency = false)
  79     : ConstraintCastNode(n, t, carry_dependency) {
  80   }
  81   virtual int Opcode() const;
  82   virtual uint ideal_reg() const { return Op_RegP; }
  83 };
  84 
  85 //------------------------------CheckCastPPNode--------------------------------
  86 // for _checkcast, cast pointer to pointer (different type), without JOIN,
  87 class CheckCastPPNode: public ConstraintCastNode {
  88   public:
  89   CheckCastPPNode(Node *c, Node *n, const Type *t, bool carry_dependency = false)
  90     : ConstraintCastNode(n, t, carry_dependency) {
  91     init_class_id(Class_CheckCastPP);




  45     init_req(1, n);
  46   }
  47   virtual Node* Identity(PhaseGVN* phase);
  48   virtual const Type* Value(PhaseGVN* phase) const;
  49   virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
  50   virtual int Opcode() const;
  51   virtual uint ideal_reg() const = 0;
  52   virtual bool depends_only_on_test() const { return !_carry_dependency; }
  53   bool carry_dependency() const { return _carry_dependency; }
  54   TypeNode* dominating_cast(PhaseTransform *phase) const;
  55   static Node* make_cast(int opcode,  Node* c, Node *n, const Type *t, bool carry_dependency);
  56 
  57 #ifndef PRODUCT
  58   virtual void dump_spec(outputStream *st) const;
  59 #endif
  60 };
  61 
  62 //------------------------------CastIINode-------------------------------------
  63 // cast integer to integer (different range)
  64 class CastIINode: public ConstraintCastNode {
  65   protected:
  66   // Is this node dependent on a range check?
  67   const bool _range_check_dependency;
  68   virtual uint cmp(const Node &n) const;
  69   virtual uint size_of() const;
  70 
  71   public:
  72   CastIINode(Node* n, const Type* t, bool carry_dependency = false, bool range_check_dependency = false)
  73     : ConstraintCastNode(n, t, carry_dependency), _range_check_dependency(range_check_dependency) {
  74     init_class_id(Class_CastII);
  75   }
  76   virtual int Opcode() const;
  77   virtual uint ideal_reg() const { return Op_RegI; }
  78   virtual const Type* Value(PhaseGVN* phase) const;
  79   virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
  80   const bool has_range_check() {
  81 #ifdef _LP64
  82     return _range_check_dependency;
  83 #else
  84     assert(!_range_check_dependency, "Should not have range check dependency");
  85     return false;
  86 #endif
  87   }
  88 
  89 #ifndef PRODUCT
  90   virtual void dump_spec(outputStream* st) const;
  91 #endif
  92 };
  93 
  94 //------------------------------CastPPNode-------------------------------------
  95 // cast pointer to pointer (different type)
  96 class CastPPNode: public ConstraintCastNode {
  97   public:
  98   CastPPNode (Node *n, const Type *t, bool carry_dependency = false)
  99     : ConstraintCastNode(n, t, carry_dependency) {
 100   }
 101   virtual int Opcode() const;
 102   virtual uint ideal_reg() const { return Op_RegP; }
 103 };
 104 
 105 //------------------------------CheckCastPPNode--------------------------------
 106 // for _checkcast, cast pointer to pointer (different type), without JOIN,
 107 class CheckCastPPNode: public ConstraintCastNode {
 108   public:
 109   CheckCastPPNode(Node *c, Node *n, const Type *t, bool carry_dependency = false)
 110     : ConstraintCastNode(n, t, carry_dependency) {
 111     init_class_id(Class_CheckCastPP);


< prev index next >