< prev index next >

src/share/vm/opto/connode.cpp

Print this page




 527 Node *CastIINode::Ideal_DU_postCCP(PhaseCCP *ccp) {
 528   if (_carry_dependency || _range_check_dependency) {
 529     return NULL;
 530   }
 531   return ConstraintCastNode::Ideal_DU_postCCP(ccp);
 532 }
 533 
 534 #ifndef PRODUCT
 535 void CastIINode::dump_spec(outputStream *st) const {
 536   TypeNode::dump_spec(st);
 537   if (_carry_dependency) {
 538     st->print(" carry dependency");
 539   }
 540   if (_range_check_dependency) {
 541     st->print(" range check dependency");
 542   }
 543 }
 544 #endif
 545 
 546 //=============================================================================
 547 
 548 //------------------------------Ideal_DU_postCCP-------------------------------
 549 // If not converting int->oop, throw away cast after constant propagation
 550 Node *CastPPNode::Ideal_DU_postCCP( PhaseCCP *ccp ) {
 551   const Type *t = ccp->type(in(1));
 552   if (!t->isa_oop_ptr() || ((in(1)->is_DecodeN()) && Matcher::gen_narrow_oop_implicit_null_checks())) {
 553     return NULL; // do not transform raw pointers or narrow oops
 554   }
 555   return ConstraintCastNode::Ideal_DU_postCCP(ccp);
 556 }
 557 
 558 
 559 
 560 //=============================================================================
 561 //------------------------------Identity---------------------------------------
 562 // If input is already higher or equal to cast type, then this is an identity.
 563 Node *CheckCastPPNode::Identity( PhaseTransform *phase ) {
 564   // Toned down to rescue meeting at a Phi 3 different oops all implementing
 565   // the same interface.  CompileTheWorld starting at 502, kd12rc1.zip.
 566   return (phase->type(in(1)) == phase->type(this)) ? in(1) : this;
 567 }
 568 
 569 //------------------------------Value------------------------------------------
 570 // Take 'join' of input and cast-up type, unless working with an Interface
 571 const Type *CheckCastPPNode::Value( PhaseTransform *phase ) const {
 572   if( in(0) && phase->type(in(0)) == Type::TOP ) return Type::TOP;
 573 
 574   const Type *inn = phase->type(in(1));
 575   if( inn == Type::TOP ) return Type::TOP;  // No information yet
 576 
 577   const TypePtr *in_type   = inn->isa_ptr();
 578   const TypePtr *my_type   = _type->isa_ptr();
 579   const Type *result = _type;
 580   if( in_type != NULL && my_type != NULL ) {


 673 Node* EncodePNode::Identity(PhaseTransform* phase) {
 674   const Type *t = phase->type( in(1) );
 675   if( t == Type::TOP ) return in(1);
 676 
 677   if (in(1)->is_DecodeN()) {
 678     // (EncodeP (DecodeN p)) -> p
 679     return in(1)->in(1);
 680   }
 681   return this;
 682 }
 683 
 684 const Type *EncodePNode::Value( PhaseTransform *phase ) const {
 685   const Type *t = phase->type( in(1) );
 686   if (t == Type::TOP) return Type::TOP;
 687   if (t == TypePtr::NULL_PTR) return TypeNarrowOop::NULL_PTR;
 688 
 689   assert(t->isa_oop_ptr(), "only oopptr here");
 690   return t->make_narrowoop();
 691 }
 692 
 693 
 694 Node *EncodeNarrowPtrNode::Ideal_DU_postCCP( PhaseCCP *ccp ) {
 695   return MemNode::Ideal_common_DU_postCCP(ccp, this, in(1));
 696 }
 697 
 698 Node* DecodeNKlassNode::Identity(PhaseTransform* phase) {
 699   const Type *t = phase->type( in(1) );
 700   if( t == Type::TOP ) return in(1);
 701 
 702   if (in(1)->is_EncodePKlass()) {
 703     // (DecodeNKlass (EncodePKlass p)) -> p
 704     return in(1)->in(1);
 705   }
 706   return this;
 707 }
 708 
 709 const Type *DecodeNKlassNode::Value( PhaseTransform *phase ) const {
 710   const Type *t = phase->type( in(1) );
 711   if (t == Type::TOP) return Type::TOP;
 712   assert(t != TypeNarrowKlass::NULL_PTR, "null klass?");
 713 
 714   assert(t->isa_narrowklass(), "only narrow klass ptr here");
 715   return t->make_ptr();
 716 }




 527 Node *CastIINode::Ideal_DU_postCCP(PhaseCCP *ccp) {
 528   if (_carry_dependency || _range_check_dependency) {
 529     return NULL;
 530   }
 531   return ConstraintCastNode::Ideal_DU_postCCP(ccp);
 532 }
 533 
 534 #ifndef PRODUCT
 535 void CastIINode::dump_spec(outputStream *st) const {
 536   TypeNode::dump_spec(st);
 537   if (_carry_dependency) {
 538     st->print(" carry dependency");
 539   }
 540   if (_range_check_dependency) {
 541     st->print(" range check dependency");
 542   }
 543 }
 544 #endif
 545 
 546 //=============================================================================














 547 //------------------------------Identity---------------------------------------
 548 // If input is already higher or equal to cast type, then this is an identity.
 549 Node *CheckCastPPNode::Identity( PhaseTransform *phase ) {
 550   // Toned down to rescue meeting at a Phi 3 different oops all implementing
 551   // the same interface.  CompileTheWorld starting at 502, kd12rc1.zip.
 552   return (phase->type(in(1)) == phase->type(this)) ? in(1) : this;
 553 }
 554 
 555 //------------------------------Value------------------------------------------
 556 // Take 'join' of input and cast-up type, unless working with an Interface
 557 const Type *CheckCastPPNode::Value( PhaseTransform *phase ) const {
 558   if( in(0) && phase->type(in(0)) == Type::TOP ) return Type::TOP;
 559 
 560   const Type *inn = phase->type(in(1));
 561   if( inn == Type::TOP ) return Type::TOP;  // No information yet
 562 
 563   const TypePtr *in_type   = inn->isa_ptr();
 564   const TypePtr *my_type   = _type->isa_ptr();
 565   const Type *result = _type;
 566   if( in_type != NULL && my_type != NULL ) {


 659 Node* EncodePNode::Identity(PhaseTransform* phase) {
 660   const Type *t = phase->type( in(1) );
 661   if( t == Type::TOP ) return in(1);
 662 
 663   if (in(1)->is_DecodeN()) {
 664     // (EncodeP (DecodeN p)) -> p
 665     return in(1)->in(1);
 666   }
 667   return this;
 668 }
 669 
 670 const Type *EncodePNode::Value( PhaseTransform *phase ) const {
 671   const Type *t = phase->type( in(1) );
 672   if (t == Type::TOP) return Type::TOP;
 673   if (t == TypePtr::NULL_PTR) return TypeNarrowOop::NULL_PTR;
 674 
 675   assert(t->isa_oop_ptr(), "only oopptr here");
 676   return t->make_narrowoop();
 677 }
 678 




 679 
 680 Node* DecodeNKlassNode::Identity(PhaseTransform* phase) {
 681   const Type *t = phase->type( in(1) );
 682   if( t == Type::TOP ) return in(1);
 683 
 684   if (in(1)->is_EncodePKlass()) {
 685     // (DecodeNKlass (EncodePKlass p)) -> p
 686     return in(1)->in(1);
 687   }
 688   return this;
 689 }
 690 
 691 const Type *DecodeNKlassNode::Value( PhaseTransform *phase ) const {
 692   const Type *t = phase->type( in(1) );
 693   if (t == Type::TOP) return Type::TOP;
 694   assert(t != TypeNarrowKlass::NULL_PTR, "null klass?");
 695 
 696   assert(t->isa_narrowklass(), "only narrow klass ptr here");
 697   return t->make_ptr();
 698 }


< prev index next >