1122 const TypeKlassPtr* t2 = phase->type(in(2))->isa_klassptr();
1123 if (t2 == nullptr || !t2->klass_is_exact())
1124 return nullptr;
1125 // Get the constant klass we are comparing to.
1126 ciKlass* superklass = t2->exact_klass();
1127
1128 // Now check for LoadKlass on left.
1129 Node* ldk1 = in(1);
1130 if (ldk1->is_DecodeNKlass()) {
1131 ldk1 = ldk1->in(1);
1132 if (ldk1->Opcode() != Op_LoadNKlass )
1133 return nullptr;
1134 } else if (ldk1->Opcode() != Op_LoadKlass )
1135 return nullptr;
1136 // Take apart the address of the LoadKlass:
1137 Node* adr1 = ldk1->in(MemNode::Address);
1138 intptr_t con2 = 0;
1139 Node* ldk2 = AddPNode::Ideal_base_and_offset(adr1, phase, con2);
1140 if (ldk2 == nullptr)
1141 return nullptr;
1142 if (con2 == oopDesc::klass_offset_in_bytes()) {
1143 // We are inspecting an object's concrete class.
1144 // Short-circuit the check if the query is abstract.
1145 if (superklass->is_interface() ||
1146 superklass->is_abstract()) {
1147 // Make it come out always false:
1148 this->set_req(2, phase->makecon(TypePtr::NULL_PTR));
1149 return this;
1150 }
1151 }
1152
1153 // Check for a LoadKlass from primary supertype array.
1154 // Any nested loadklass from loadklass+con must be from the p.s. array.
1155 if (ldk2->is_DecodeNKlass()) {
1156 // Keep ldk2 as DecodeN since it could be used in CmpP below.
1157 if (ldk2->in(1)->Opcode() != Op_LoadNKlass )
1158 return nullptr;
1159 } else if (ldk2->Opcode() != Op_LoadKlass)
1160 return nullptr;
1161
1162 // Verify that we understand the situation
|
1122 const TypeKlassPtr* t2 = phase->type(in(2))->isa_klassptr();
1123 if (t2 == nullptr || !t2->klass_is_exact())
1124 return nullptr;
1125 // Get the constant klass we are comparing to.
1126 ciKlass* superklass = t2->exact_klass();
1127
1128 // Now check for LoadKlass on left.
1129 Node* ldk1 = in(1);
1130 if (ldk1->is_DecodeNKlass()) {
1131 ldk1 = ldk1->in(1);
1132 if (ldk1->Opcode() != Op_LoadNKlass )
1133 return nullptr;
1134 } else if (ldk1->Opcode() != Op_LoadKlass )
1135 return nullptr;
1136 // Take apart the address of the LoadKlass:
1137 Node* adr1 = ldk1->in(MemNode::Address);
1138 intptr_t con2 = 0;
1139 Node* ldk2 = AddPNode::Ideal_base_and_offset(adr1, phase, con2);
1140 if (ldk2 == nullptr)
1141 return nullptr;
1142 if (con2 == Type::klass_offset()) {
1143 // We are inspecting an object's concrete class.
1144 // Short-circuit the check if the query is abstract.
1145 if (superklass->is_interface() ||
1146 superklass->is_abstract()) {
1147 // Make it come out always false:
1148 this->set_req(2, phase->makecon(TypePtr::NULL_PTR));
1149 return this;
1150 }
1151 }
1152
1153 // Check for a LoadKlass from primary supertype array.
1154 // Any nested loadklass from loadklass+con must be from the p.s. array.
1155 if (ldk2->is_DecodeNKlass()) {
1156 // Keep ldk2 as DecodeN since it could be used in CmpP below.
1157 if (ldk2->in(1)->Opcode() != Op_LoadNKlass )
1158 return nullptr;
1159 } else if (ldk2->Opcode() != Op_LoadKlass)
1160 return nullptr;
1161
1162 // Verify that we understand the situation
|