227 class ConstraintCastNode: public TypeNode { 228 public: 229 ConstraintCastNode (Node *n, const Type *t ): TypeNode(t,2) { 230 init_class_id(Class_ConstraintCast); 231 init_req(1, n); 232 } 233 virtual Node *Identity( PhaseTransform *phase ); 234 virtual const Type *Value( PhaseTransform *phase ) const; 235 virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); 236 virtual int Opcode() const; 237 virtual uint ideal_reg() const = 0; 238 virtual Node *Ideal_DU_postCCP( PhaseCCP * ); 239 }; 240 241 //------------------------------CastIINode------------------------------------- 242 // cast integer to integer (different range) 243 class CastIINode: public ConstraintCastNode { 244 private: 245 // Can this node be removed post CCP or does it carry a required dependency? 246 const bool _carry_dependency; 247 248 protected: 249 virtual uint cmp( const Node &n ) const; 250 virtual uint size_of() const; 251 252 public: 253 CastIINode(Node *n, const Type *t, bool carry_dependency = false) 254 : ConstraintCastNode(n,t), _carry_dependency(carry_dependency) {} 255 virtual int Opcode() const; 256 virtual uint ideal_reg() const { return Op_RegI; } 257 virtual Node *Identity( PhaseTransform *phase ); 258 virtual const Type *Value( PhaseTransform *phase ) const; 259 virtual Node *Ideal_DU_postCCP( PhaseCCP * ); 260 #ifndef PRODUCT 261 virtual void dump_spec(outputStream *st) const; 262 #endif 263 }; 264 265 //------------------------------CastPPNode------------------------------------- 266 // cast pointer to pointer (different type) 267 class CastPPNode: public ConstraintCastNode { 268 public: 269 CastPPNode (Node *n, const Type *t ): ConstraintCastNode(n, t) {} 270 virtual int Opcode() const; 271 virtual uint ideal_reg() const { return Op_RegP; } 272 virtual Node *Ideal_DU_postCCP( PhaseCCP * ); 273 }; 274 275 //------------------------------CheckCastPPNode-------------------------------- 276 // for _checkcast, cast pointer to pointer (different type), without JOIN, 277 class CheckCastPPNode: public TypeNode { 278 public: 279 CheckCastPPNode( Node *c, Node *n, const Type *t ) : TypeNode(t,2) { | 227 class ConstraintCastNode: public TypeNode { 228 public: 229 ConstraintCastNode (Node *n, const Type *t ): TypeNode(t,2) { 230 init_class_id(Class_ConstraintCast); 231 init_req(1, n); 232 } 233 virtual Node *Identity( PhaseTransform *phase ); 234 virtual const Type *Value( PhaseTransform *phase ) const; 235 virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); 236 virtual int Opcode() const; 237 virtual uint ideal_reg() const = 0; 238 virtual Node *Ideal_DU_postCCP( PhaseCCP * ); 239 }; 240 241 //------------------------------CastIINode------------------------------------- 242 // cast integer to integer (different range) 243 class CastIINode: public ConstraintCastNode { 244 private: 245 // Can this node be removed post CCP or does it carry a required dependency? 246 const bool _carry_dependency; 247 // Is this node dependent on a range check? 248 const bool _range_check_dependency; 249 250 protected: 251 virtual uint cmp( const Node &n ) const; 252 virtual uint size_of() const; 253 254 public: 255 CastIINode(Node *n, const Type *t, bool carry_dependency = false, bool range_check_dependency = false) 256 : ConstraintCastNode(n,t), _carry_dependency(carry_dependency), _range_check_dependency(range_check_dependency) { 257 init_class_id(Class_CastII); 258 } 259 virtual int Opcode() const; 260 virtual uint ideal_reg() const { return Op_RegI; } 261 virtual Node *Identity( PhaseTransform *phase ); 262 virtual const Type *Value( PhaseTransform *phase ) const; 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 } 272 #ifndef PRODUCT 273 virtual void dump_spec(outputStream *st) const; 274 #endif 275 }; 276 277 //------------------------------CastPPNode------------------------------------- 278 // cast pointer to pointer (different type) 279 class CastPPNode: public ConstraintCastNode { 280 public: 281 CastPPNode (Node *n, const Type *t ): ConstraintCastNode(n, t) {} 282 virtual int Opcode() const; 283 virtual uint ideal_reg() const { return Op_RegP; } 284 virtual Node *Ideal_DU_postCCP( PhaseCCP * ); 285 }; 286 287 //------------------------------CheckCastPPNode-------------------------------- 288 // for _checkcast, cast pointer to pointer (different type), without JOIN, 289 class CheckCastPPNode: public TypeNode { 290 public: 291 CheckCastPPNode( Node *c, Node *n, const Type *t ) : TypeNode(t,2) { |