< prev index next >

src/hotspot/share/opto/castnode.cpp

Print this page




 325         set_type(wtype);
 326         return this;
 327       }
 328     }
 329   }
 330   return NULL;
 331 }
 332 
 333 
 334 //=============================================================================
 335 //------------------------------Identity---------------------------------------
 336 // If input is already higher or equal to cast type, then this is an identity.
 337 Node* CheckCastPPNode::Identity(PhaseGVN* phase) {
 338   Node* dom = dominating_cast(phase, phase);
 339   if (dom != NULL) {
 340     return dom;
 341   }
 342   if (_carry_dependency) {
 343     return this;
 344   }




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

 348 }
 349 
 350 //------------------------------Value------------------------------------------
 351 // Take 'join' of input and cast-up type, unless working with an Interface
 352 const Type* CheckCastPPNode::Value(PhaseGVN* phase) const {
 353   if( in(0) && phase->type(in(0)) == Type::TOP ) return Type::TOP;
 354 
 355   const Type *inn = phase->type(in(1));
 356   if( inn == Type::TOP ) return Type::TOP;  // No information yet
 357 
 358   const TypePtr *in_type   = inn->isa_ptr();
 359   const TypePtr *my_type   = _type->isa_ptr();
 360   const Type *result = _type;
 361   if( in_type != NULL && my_type != NULL ) {
 362     TypePtr::PTR   in_ptr    = in_type->ptr();
 363     if (in_ptr == TypePtr::Null) {
 364       result = in_type;
 365     } else if (in_ptr == TypePtr::Constant) {
 366       if (my_type->isa_rawptr()) {
 367         result = my_type;




 325         set_type(wtype);
 326         return this;
 327       }
 328     }
 329   }
 330   return NULL;
 331 }
 332 
 333 
 334 //=============================================================================
 335 //------------------------------Identity---------------------------------------
 336 // If input is already higher or equal to cast type, then this is an identity.
 337 Node* CheckCastPPNode::Identity(PhaseGVN* phase) {
 338   Node* dom = dominating_cast(phase, phase);
 339   if (dom != NULL) {
 340     return dom;
 341   }
 342   if (_carry_dependency) {
 343     return this;
 344   }
 345   const Type* t = phase->type(in(1));
 346   if (EnableVectorReboxing && in(1)->Opcode() == Op_VectorBox) {
 347     return t->higher_equal_speculative(phase->type(this)) ? in(1) : this;
 348   } else {
 349     // Toned down to rescue meeting at a Phi 3 different oops all implementing
 350     // the same interface.
 351     return (t == phase->type(this)) ? in(1) : this;
 352   }
 353 }
 354 
 355 //------------------------------Value------------------------------------------
 356 // Take 'join' of input and cast-up type, unless working with an Interface
 357 const Type* CheckCastPPNode::Value(PhaseGVN* phase) const {
 358   if( in(0) && phase->type(in(0)) == Type::TOP ) return Type::TOP;
 359 
 360   const Type *inn = phase->type(in(1));
 361   if( inn == Type::TOP ) return Type::TOP;  // No information yet
 362 
 363   const TypePtr *in_type   = inn->isa_ptr();
 364   const TypePtr *my_type   = _type->isa_ptr();
 365   const Type *result = _type;
 366   if( in_type != NULL && my_type != NULL ) {
 367     TypePtr::PTR   in_ptr    = in_type->ptr();
 368     if (in_ptr == TypePtr::Null) {
 369       result = in_type;
 370     } else if (in_ptr == TypePtr::Constant) {
 371       if (my_type->isa_rawptr()) {
 372         result = my_type;


< prev index next >