242 // cast integer to integer (different range) |
242 // cast integer to integer (different range) |
243 class CastIINode: public ConstraintCastNode { |
243 class CastIINode: public ConstraintCastNode { |
244 private: |
244 private: |
245 // Can this node be removed post CCP or does it carry a required dependency? |
245 // Can this node be removed post CCP or does it carry a required dependency? |
246 const bool _carry_dependency; |
246 const bool _carry_dependency; |
|
247 // Is this node dependent on a range check? |
|
248 const bool _range_check_dependency; |
247 |
249 |
248 protected: |
250 protected: |
249 virtual uint cmp( const Node &n ) const; |
251 virtual uint cmp( const Node &n ) const; |
250 virtual uint size_of() const; |
252 virtual uint size_of() const; |
251 |
253 |
252 public: |
254 public: |
253 CastIINode(Node *n, const Type *t, bool carry_dependency = false) |
255 CastIINode(Node *n, const Type *t, bool carry_dependency = false, bool range_check_dependency = false) |
254 : ConstraintCastNode(n,t), _carry_dependency(carry_dependency) {} |
256 : ConstraintCastNode(n,t), _carry_dependency(carry_dependency), _range_check_dependency(range_check_dependency) { |
|
257 init_class_id(Class_CastII); |
|
258 } |
255 virtual int Opcode() const; |
259 virtual int Opcode() const; |
256 virtual uint ideal_reg() const { return Op_RegI; } |
260 virtual uint ideal_reg() const { return Op_RegI; } |
257 virtual Node *Identity( PhaseTransform *phase ); |
261 virtual Node *Identity( PhaseTransform *phase ); |
258 virtual const Type *Value( PhaseTransform *phase ) const; |
262 virtual const Type *Value( PhaseTransform *phase ) const; |
259 virtual Node *Ideal_DU_postCCP( PhaseCCP * ); |
263 virtual Node *Ideal_DU_postCCP( PhaseCCP * ); |
|
264 const bool has_range_check() { |
|
265 #ifdef _LP64 |
|
266 return _range_check_dependency; |
|
267 #else |
|
268 assert(!_range_check_dependency, "Should not have range check dependency"); |
|
269 return false; |
|
270 #endif |
|
271 } |
260 #ifndef PRODUCT |
272 #ifndef PRODUCT |
261 virtual void dump_spec(outputStream *st) const; |
273 virtual void dump_spec(outputStream *st) const; |
262 #endif |
274 #endif |
263 }; |
275 }; |
264 |
276 |