1183 const TypeKlassPtr* t2 = phase->type(in(2))->isa_klassptr();
1184 if (t2 == nullptr || !t2->klass_is_exact())
1185 return nullptr;
1186 // Get the constant klass we are comparing to.
1187 ciKlass* superklass = t2->exact_klass();
1188
1189 // Now check for LoadKlass on left.
1190 Node* ldk1 = in(1);
1191 if (ldk1->is_DecodeNKlass()) {
1192 ldk1 = ldk1->in(1);
1193 if (ldk1->Opcode() != Op_LoadNKlass )
1194 return nullptr;
1195 } else if (ldk1->Opcode() != Op_LoadKlass )
1196 return nullptr;
1197 // Take apart the address of the LoadKlass:
1198 Node* adr1 = ldk1->in(MemNode::Address);
1199 intptr_t con2 = 0;
1200 Node* ldk2 = AddPNode::Ideal_base_and_offset(adr1, phase, con2);
1201 if (ldk2 == nullptr)
1202 return nullptr;
1203 if (con2 == oopDesc::klass_offset_in_bytes()) {
1204 // We are inspecting an object's concrete class.
1205 // Short-circuit the check if the query is abstract.
1206 if (superklass->is_interface() ||
1207 superklass->is_abstract()) {
1208 // Make it come out always false:
1209 this->set_req(2, phase->makecon(TypePtr::NULL_PTR));
1210 return this;
1211 }
1212 }
1213
1214 // Check for a LoadKlass from primary supertype array.
1215 // Any nested loadklass from loadklass+con must be from the p.s. array.
1216 if (ldk2->is_DecodeNKlass()) {
1217 // Keep ldk2 as DecodeN since it could be used in CmpP below.
1218 if (ldk2->in(1)->Opcode() != Op_LoadNKlass )
1219 return nullptr;
1220 } else if (ldk2->Opcode() != Op_LoadKlass)
1221 return nullptr;
1222
1223 // Verify that we understand the situation
|
1183 const TypeKlassPtr* t2 = phase->type(in(2))->isa_klassptr();
1184 if (t2 == nullptr || !t2->klass_is_exact())
1185 return nullptr;
1186 // Get the constant klass we are comparing to.
1187 ciKlass* superklass = t2->exact_klass();
1188
1189 // Now check for LoadKlass on left.
1190 Node* ldk1 = in(1);
1191 if (ldk1->is_DecodeNKlass()) {
1192 ldk1 = ldk1->in(1);
1193 if (ldk1->Opcode() != Op_LoadNKlass )
1194 return nullptr;
1195 } else if (ldk1->Opcode() != Op_LoadKlass )
1196 return nullptr;
1197 // Take apart the address of the LoadKlass:
1198 Node* adr1 = ldk1->in(MemNode::Address);
1199 intptr_t con2 = 0;
1200 Node* ldk2 = AddPNode::Ideal_base_and_offset(adr1, phase, con2);
1201 if (ldk2 == nullptr)
1202 return nullptr;
1203 if (con2 == Type::klass_offset()) {
1204 // We are inspecting an object's concrete class.
1205 // Short-circuit the check if the query is abstract.
1206 if (superklass->is_interface() ||
1207 superklass->is_abstract()) {
1208 // Make it come out always false:
1209 this->set_req(2, phase->makecon(TypePtr::NULL_PTR));
1210 return this;
1211 }
1212 }
1213
1214 // Check for a LoadKlass from primary supertype array.
1215 // Any nested loadklass from loadklass+con must be from the p.s. array.
1216 if (ldk2->is_DecodeNKlass()) {
1217 // Keep ldk2 as DecodeN since it could be used in CmpP below.
1218 if (ldk2->in(1)->Opcode() != Op_LoadNKlass )
1219 return nullptr;
1220 } else if (ldk2->Opcode() != Op_LoadKlass)
1221 return nullptr;
1222
1223 // Verify that we understand the situation
|