src/share/vm/opto/subnode.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File 8014189 Sdiff src/share/vm/opto

src/share/vm/opto/subnode.cpp

Print this page




 846     if (!ik->is_final()) {
 847       phase->C->dependencies()->assert_leaf_type(ik);
 848     }
 849   }
 850 
 851   // Bypass the dependent load, and compare directly
 852   this->set_req(1,ldk2);
 853 
 854   return this;
 855 }
 856 
 857 //=============================================================================
 858 //------------------------------sub--------------------------------------------
 859 // Simplify an CmpN (compare 2 pointers) node, based on local information.
 860 // If both inputs are constants, compare them.
 861 const Type *CmpNNode::sub( const Type *t1, const Type *t2 ) const {
 862   const TypePtr *r0 = t1->make_ptr(); // Handy access
 863   const TypePtr *r1 = t2->make_ptr();
 864 
 865   // Undefined inputs makes for an undefined result
 866   if( TypePtr::above_centerline(r0->_ptr) ||
 867       TypePtr::above_centerline(r1->_ptr) )

 868     return Type::TOP;
 869 
 870   if (r0 == r1 && r0->singleton()) {
 871     // Equal pointer constants (klasses, nulls, etc.)
 872     return TypeInt::CC_EQ;
 873   }
 874 
 875   // See if it is 2 unrelated classes.
 876   const TypeOopPtr* p0 = r0->isa_oopptr();
 877   const TypeOopPtr* p1 = r1->isa_oopptr();
 878   if (p0 && p1) {
 879     ciKlass* klass0 = p0->klass();
 880     bool    xklass0 = p0->klass_is_exact();
 881     ciKlass* klass1 = p1->klass();
 882     bool    xklass1 = p1->klass_is_exact();
 883     int kps = (p0->isa_klassptr()?1:0) + (p1->isa_klassptr()?1:0);
 884     if (klass0 && klass1 &&
 885         kps != 1 &&             // both or neither are klass pointers
 886         !klass0->is_interface() && // do not trust interfaces
 887         !klass1->is_interface()) {
 888       bool unrelated_classes = false;
 889       // See if neither subclasses the other, or if the class on top




 846     if (!ik->is_final()) {
 847       phase->C->dependencies()->assert_leaf_type(ik);
 848     }
 849   }
 850 
 851   // Bypass the dependent load, and compare directly
 852   this->set_req(1,ldk2);
 853 
 854   return this;
 855 }
 856 
 857 //=============================================================================
 858 //------------------------------sub--------------------------------------------
 859 // Simplify an CmpN (compare 2 pointers) node, based on local information.
 860 // If both inputs are constants, compare them.
 861 const Type *CmpNNode::sub( const Type *t1, const Type *t2 ) const {
 862   const TypePtr *r0 = t1->make_ptr(); // Handy access
 863   const TypePtr *r1 = t2->make_ptr();
 864 
 865   // Undefined inputs makes for an undefined result
 866   if ((r0 == NULL) || (r1 == NULL) ||
 867       TypePtr::above_centerline(r0->_ptr) ||
 868       TypePtr::above_centerline(r1->_ptr)) {
 869     return Type::TOP;
 870   }
 871   if (r0 == r1 && r0->singleton()) {
 872     // Equal pointer constants (klasses, nulls, etc.)
 873     return TypeInt::CC_EQ;
 874   }
 875 
 876   // See if it is 2 unrelated classes.
 877   const TypeOopPtr* p0 = r0->isa_oopptr();
 878   const TypeOopPtr* p1 = r1->isa_oopptr();
 879   if (p0 && p1) {
 880     ciKlass* klass0 = p0->klass();
 881     bool    xklass0 = p0->klass_is_exact();
 882     ciKlass* klass1 = p1->klass();
 883     bool    xklass1 = p1->klass_is_exact();
 884     int kps = (p0->isa_klassptr()?1:0) + (p1->isa_klassptr()?1:0);
 885     if (klass0 && klass1 &&
 886         kps != 1 &&             // both or neither are klass pointers
 887         !klass0->is_interface() && // do not trust interfaces
 888         !klass1->is_interface()) {
 889       bool unrelated_classes = false;
 890       // See if neither subclasses the other, or if the class on top


src/share/vm/opto/subnode.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File