< prev index next >

src/hotspot/share/opto/subnode.cpp

Print this page

1166   const TypeKlassPtr* t2 = phase->type(in(2))->isa_klassptr();
1167   if (t2 == nullptr || !t2->klass_is_exact())
1168     return nullptr;
1169   // Get the constant klass we are comparing to.
1170   ciKlass* superklass = t2->exact_klass();
1171 
1172   // Now check for LoadKlass on left.
1173   Node* ldk1 = in(1);
1174   if (ldk1->is_DecodeNKlass()) {
1175     ldk1 = ldk1->in(1);
1176     if (ldk1->Opcode() != Op_LoadNKlass )
1177       return nullptr;
1178   } else if (ldk1->Opcode() != Op_LoadKlass )
1179     return nullptr;
1180   // Take apart the address of the LoadKlass:
1181   Node* adr1 = ldk1->in(MemNode::Address);
1182   intptr_t con2 = 0;
1183   Node* ldk2 = AddPNode::Ideal_base_and_offset(adr1, phase, con2);
1184   if (ldk2 == nullptr)
1185     return nullptr;
1186   if (con2 == oopDesc::klass_offset_in_bytes()) {
1187     // We are inspecting an object's concrete class.
1188     // Short-circuit the check if the query is abstract.
1189     if (superklass->is_interface() ||
1190         superklass->is_abstract()) {
1191       // Make it come out always false:
1192       this->set_req(2, phase->makecon(TypePtr::NULL_PTR));
1193       return this;
1194     }
1195   }
1196 
1197   // Check for a LoadKlass from primary supertype array.
1198   // Any nested loadklass from loadklass+con must be from the p.s. array.
1199   if (ldk2->is_DecodeNKlass()) {
1200     // Keep ldk2 as DecodeN since it could be used in CmpP below.
1201     if (ldk2->in(1)->Opcode() != Op_LoadNKlass )
1202       return nullptr;
1203   } else if (ldk2->Opcode() != Op_LoadKlass)
1204     return nullptr;
1205 
1206   // Verify that we understand the situation

1166   const TypeKlassPtr* t2 = phase->type(in(2))->isa_klassptr();
1167   if (t2 == nullptr || !t2->klass_is_exact())
1168     return nullptr;
1169   // Get the constant klass we are comparing to.
1170   ciKlass* superklass = t2->exact_klass();
1171 
1172   // Now check for LoadKlass on left.
1173   Node* ldk1 = in(1);
1174   if (ldk1->is_DecodeNKlass()) {
1175     ldk1 = ldk1->in(1);
1176     if (ldk1->Opcode() != Op_LoadNKlass )
1177       return nullptr;
1178   } else if (ldk1->Opcode() != Op_LoadKlass )
1179     return nullptr;
1180   // Take apart the address of the LoadKlass:
1181   Node* adr1 = ldk1->in(MemNode::Address);
1182   intptr_t con2 = 0;
1183   Node* ldk2 = AddPNode::Ideal_base_and_offset(adr1, phase, con2);
1184   if (ldk2 == nullptr)
1185     return nullptr;
1186   if (con2 == Type::klass_offset()) {
1187     // We are inspecting an object's concrete class.
1188     // Short-circuit the check if the query is abstract.
1189     if (superklass->is_interface() ||
1190         superklass->is_abstract()) {
1191       // Make it come out always false:
1192       this->set_req(2, phase->makecon(TypePtr::NULL_PTR));
1193       return this;
1194     }
1195   }
1196 
1197   // Check for a LoadKlass from primary supertype array.
1198   // Any nested loadklass from loadklass+con must be from the p.s. array.
1199   if (ldk2->is_DecodeNKlass()) {
1200     // Keep ldk2 as DecodeN since it could be used in CmpP below.
1201     if (ldk2->in(1)->Opcode() != Op_LoadNKlass )
1202       return nullptr;
1203   } else if (ldk2->Opcode() != Op_LoadKlass)
1204     return nullptr;
1205 
1206   // Verify that we understand the situation
< prev index next >