< prev index next >

src/hotspot/share/opto/subtypenode.cpp

Print this page

 59       (!superk->is_obj_array_klass() ||
 60        !superk->as_obj_array_klass()->base_element_klass()->is_interface()) &&
 61       (!subk->is_obj_array_klass() ||
 62        !subk->as_obj_array_klass()->base_element_klass()->is_interface() ||
 63        xsubk)) {
 64     bool unrelated_classes = false;
 65     if (superk->equals(subk)) {
 66       // skip
 67     } else if (superk->is_subtype_of(subk)) {
 68       // If the subclass is exact then the superclass is a subtype of
 69       // the subclass. Given they're no equals, that subtype check can
 70       // only fail.
 71       unrelated_classes = xsubk;
 72     } else if (subk->is_subtype_of(superk)) {
 73       // skip
 74     } else {
 75       // Neither class subtypes the other: they are unrelated and this
 76       // type check is known to fail.
 77       unrelated_classes = true;
 78     }














 79     if (unrelated_classes) {
 80       TypePtr::PTR jp = sub_t->is_ptr()->join_ptr(super_t->is_ptr()->_ptr);
 81       if (jp != TypePtr::Null && jp != TypePtr::BotPTR) {
 82         return TypeInt::CC_GT;
 83       }
 84     }
 85   }
 86 
 87   if (super_t->singleton()) {
 88     if (subk != NULL) {
 89       switch (Compile::current()->static_subtype_check(superk, subk)) {
 90       case Compile::SSC_always_false:
 91         return TypeInt::CC_GT;
 92       case Compile::SSC_always_true:
 93         return TypeInt::CC_EQ;
 94       case Compile::SSC_easy_test:
 95       case Compile::SSC_full_test:
 96         break;
 97       default:
 98         ShouldNotReachHere();

 59       (!superk->is_obj_array_klass() ||
 60        !superk->as_obj_array_klass()->base_element_klass()->is_interface()) &&
 61       (!subk->is_obj_array_klass() ||
 62        !subk->as_obj_array_klass()->base_element_klass()->is_interface() ||
 63        xsubk)) {
 64     bool unrelated_classes = false;
 65     if (superk->equals(subk)) {
 66       // skip
 67     } else if (superk->is_subtype_of(subk)) {
 68       // If the subclass is exact then the superclass is a subtype of
 69       // the subclass. Given they're no equals, that subtype check can
 70       // only fail.
 71       unrelated_classes = xsubk;
 72     } else if (subk->is_subtype_of(superk)) {
 73       // skip
 74     } else {
 75       // Neither class subtypes the other: they are unrelated and this
 76       // type check is known to fail.
 77       unrelated_classes = true;
 78     }
 79     if (!unrelated_classes) {
 80       // Handle inline type arrays
 81       if (sub_t->isa_aryptr() && sub_t->is_aryptr()->is_not_flat() && superk->is_flat_array_klass()) {
 82         // Subtype is not a flat array but supertype is. Must be unrelated.
 83         unrelated_classes = true;
 84       } else if (sub_t->isa_aryptr() && sub_t->is_aryptr()->is_not_null_free() &&
 85                  superk->is_array_klass() && superk->as_array_klass()->is_elem_null_free()) {
 86         // Subtype is not a null-free array but supertype is. Must be unrelated.
 87         unrelated_classes = true;
 88       } else if (sub_t->is_ptr()->flatten_array() && (!superk->can_be_inline_klass() || (superk->is_inlinetype() && !superk->flatten_array()))) {
 89         // Subtype is flattened in arrays but supertype is not. Must be unrelated.
 90         unrelated_classes = true;
 91       }
 92     }
 93     if (unrelated_classes) {
 94       TypePtr::PTR jp = sub_t->is_ptr()->join_ptr(super_t->is_ptr()->_ptr);
 95       if (jp != TypePtr::Null && jp != TypePtr::BotPTR) {
 96         return TypeInt::CC_GT;
 97       }
 98     }
 99   }
100 
101   if (super_t->singleton()) {
102     if (subk != NULL) {
103       switch (Compile::current()->static_subtype_check(superk, subk)) {
104       case Compile::SSC_always_false:
105         return TypeInt::CC_GT;
106       case Compile::SSC_always_true:
107         return TypeInt::CC_EQ;
108       case Compile::SSC_easy_test:
109       case Compile::SSC_full_test:
110         break;
111       default:
112         ShouldNotReachHere();
< prev index next >