< prev index next >

src/hotspot/share/opto/castnode.cpp

Print this page




 273 #ifndef PRODUCT
 274 void CastIINode::dump_spec(outputStream* st) const {
 275   ConstraintCastNode::dump_spec(st);
 276   if (_range_check_dependency) {
 277     st->print(" range check dependency");
 278   }
 279 }
 280 #endif
 281 
 282 //=============================================================================
 283 //------------------------------Identity---------------------------------------
 284 // If input is already higher or equal to cast type, then this is an identity.
 285 Node* CheckCastPPNode::Identity(PhaseGVN* phase) {
 286   Node* dom = dominating_cast(phase, phase);
 287   if (dom != NULL) {
 288     return dom;
 289   }
 290   if (_carry_dependency) {
 291     return this;
 292   }






 293   // Toned down to rescue meeting at a Phi 3 different oops all implementing
 294   // the same interface.
 295   return (phase->type(in(1)) == phase->type(this)) ? in(1) : this;


 296 }
 297 
 298 //------------------------------Value------------------------------------------
 299 // Take 'join' of input and cast-up type, unless working with an Interface
 300 const Type* CheckCastPPNode::Value(PhaseGVN* phase) const {
 301   if( in(0) && phase->type(in(0)) == Type::TOP ) return Type::TOP;
 302 
 303   const Type *inn = phase->type(in(1));
 304   if( inn == Type::TOP ) return Type::TOP;  // No information yet
 305 
 306   const TypePtr *in_type   = inn->isa_ptr();
 307   const TypePtr *my_type   = _type->isa_ptr();
 308   const Type *result = _type;
 309   if( in_type != NULL && my_type != NULL ) {
 310     TypePtr::PTR   in_ptr    = in_type->ptr();
 311     if (in_ptr == TypePtr::Null) {
 312       result = in_type;
 313     } else if (in_ptr == TypePtr::Constant) {
 314       if (my_type->isa_rawptr()) {
 315         result = my_type;




 273 #ifndef PRODUCT
 274 void CastIINode::dump_spec(outputStream* st) const {
 275   ConstraintCastNode::dump_spec(st);
 276   if (_range_check_dependency) {
 277     st->print(" range check dependency");
 278   }
 279 }
 280 #endif
 281 
 282 //=============================================================================
 283 //------------------------------Identity---------------------------------------
 284 // If input is already higher or equal to cast type, then this is an identity.
 285 Node* CheckCastPPNode::Identity(PhaseGVN* phase) {
 286   Node* dom = dominating_cast(phase, phase);
 287   if (dom != NULL) {
 288     return dom;
 289   }
 290   if (_carry_dependency) {
 291     return this;
 292   }
 293   const Type* t = phase->type(in(1));
 294   if (EnableVectorReboxing && in(1)->Opcode() == Op_VectorBox) {
 295     if (t->higher_equal_speculative(phase->type(this))) {
 296       return in(1);
 297     }
 298   } else if (t == phase->type(this)) {
 299     // Toned down to rescue meeting at a Phi 3 different oops all implementing
 300     // the same interface.
 301     return in(1);
 302   }
 303   return this;
 304 }
 305 
 306 //------------------------------Value------------------------------------------
 307 // Take 'join' of input and cast-up type, unless working with an Interface
 308 const Type* CheckCastPPNode::Value(PhaseGVN* phase) const {
 309   if( in(0) && phase->type(in(0)) == Type::TOP ) return Type::TOP;
 310 
 311   const Type *inn = phase->type(in(1));
 312   if( inn == Type::TOP ) return Type::TOP;  // No information yet
 313 
 314   const TypePtr *in_type   = inn->isa_ptr();
 315   const TypePtr *my_type   = _type->isa_ptr();
 316   const Type *result = _type;
 317   if( in_type != NULL && my_type != NULL ) {
 318     TypePtr::PTR   in_ptr    = in_type->ptr();
 319     if (in_ptr == TypePtr::Null) {
 320       result = in_type;
 321     } else if (in_ptr == TypePtr::Constant) {
 322       if (my_type->isa_rawptr()) {
 323         result = my_type;


< prev index next >