< prev index next >

src/hotspot/share/opto/subnode.cpp

Print this page

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

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