886 } else if (klass0->is_subtype_of(klass1)) { 887 // If klass1's type is PRECISE, then classes are unrelated. 888 unrelated_classes = xklass1; 889 } else if (klass1->is_subtype_of(klass0)) { 890 // If klass0's type is PRECISE, then classes are unrelated. 891 unrelated_classes = xklass0; 892 } else { // Neither subtypes the other 893 unrelated_classes = true; 894 } 895 if (unrelated_classes) { 896 // The oops classes are known to be unrelated. If the joined PTRs of 897 // two oops is not Null and not Bottom, then we are sure that one 898 // of the two oops is non-null, and the comparison will always fail. 899 TypePtr::PTR jp = r0->join_ptr(r1->_ptr); 900 if (jp != TypePtr::Null && jp != TypePtr::BotPTR) { 901 return TypeInt::CC_GT; 902 } 903 } 904 } 905 } 906 907 // Known constants can be compared exactly 908 // Null can be distinguished from any NotNull pointers 909 // Unknown inputs makes an unknown result 910 if( r0->singleton() ) { 911 intptr_t bits0 = r0->get_con(); 912 if( r1->singleton() ) 913 return bits0 == r1->get_con() ? TypeInt::CC_EQ : TypeInt::CC_GT; 914 return ( r1->_ptr == TypePtr::NotNull && bits0==0 ) ? TypeInt::CC_GT : TypeInt::CC; 915 } else if( r1->singleton() ) { 916 intptr_t bits1 = r1->get_con(); 917 return ( r0->_ptr == TypePtr::NotNull && bits1==0 ) ? TypeInt::CC_GT : TypeInt::CC; 918 } else 919 return TypeInt::CC; 920 } 921 922 static inline Node* isa_java_mirror_load(PhaseGVN* phase, Node* n) { 923 // Return the klass node for (indirect load from OopHandle) 924 // LoadBarrier?(LoadP(LoadP(AddP(foo:Klass, #java_mirror)))) 925 // or NULL if not matching. | 886 } else if (klass0->is_subtype_of(klass1)) { 887 // If klass1's type is PRECISE, then classes are unrelated. 888 unrelated_classes = xklass1; 889 } else if (klass1->is_subtype_of(klass0)) { 890 // If klass0's type is PRECISE, then classes are unrelated. 891 unrelated_classes = xklass0; 892 } else { // Neither subtypes the other 893 unrelated_classes = true; 894 } 895 if (unrelated_classes) { 896 // The oops classes are known to be unrelated. If the joined PTRs of 897 // two oops is not Null and not Bottom, then we are sure that one 898 // of the two oops is non-null, and the comparison will always fail. 899 TypePtr::PTR jp = r0->join_ptr(r1->_ptr); 900 if (jp != TypePtr::Null && jp != TypePtr::BotPTR) { 901 return TypeInt::CC_GT; 902 } 903 } 904 } 905 } 906 const TypeKlassPtr* k0 = r0->isa_klassptr(); 907 const TypeKlassPtr* k1 = r1->isa_klassptr(); 908 if (k0 && k1) { 909 if ((k0->flatten_array() && (!k1->can_be_value_type() || !k1->klass()->flatten_array())) || 910 (k1->flatten_array() && (!k0->can_be_value_type() || !k0->klass()->flatten_array()))) { 911 return TypeInt::CC_GT; 912 } 913 } 914 915 // Known constants can be compared exactly 916 // Null can be distinguished from any NotNull pointers 917 // Unknown inputs makes an unknown result 918 if( r0->singleton() ) { 919 intptr_t bits0 = r0->get_con(); 920 if( r1->singleton() ) 921 return bits0 == r1->get_con() ? TypeInt::CC_EQ : TypeInt::CC_GT; 922 return ( r1->_ptr == TypePtr::NotNull && bits0==0 ) ? TypeInt::CC_GT : TypeInt::CC; 923 } else if( r1->singleton() ) { 924 intptr_t bits1 = r1->get_con(); 925 return ( r0->_ptr == TypePtr::NotNull && bits1==0 ) ? TypeInt::CC_GT : TypeInt::CC; 926 } else 927 return TypeInt::CC; 928 } 929 930 static inline Node* isa_java_mirror_load(PhaseGVN* phase, Node* n) { 931 // Return the klass node for (indirect load from OopHandle) 932 // LoadBarrier?(LoadP(LoadP(AddP(foo:Klass, #java_mirror)))) 933 // or NULL if not matching. |