1276 // Found: |
1276 // Found: |
1277 // Bool(CmpP(LoadKlass(obj._klass), ConP(Foo.klass)), [eq]) |
1277 // Bool(CmpP(LoadKlass(obj._klass), ConP(Foo.klass)), [eq]) |
1278 // or the narrowOop equivalent. |
1278 // or the narrowOop equivalent. |
1279 const Type* obj_type = _gvn.type(obj); |
1279 const Type* obj_type = _gvn.type(obj); |
1280 const TypeOopPtr* tboth = obj_type->join(con_type)->isa_oopptr(); |
1280 const TypeOopPtr* tboth = obj_type->join(con_type)->isa_oopptr(); |
1281 if (tboth != NULL && tboth != obj_type && tboth->higher_equal(obj_type)) { |
1281 if (tboth != NULL && tboth->klass_is_exact() && tboth != obj_type && |
|
1282 tboth->higher_equal(obj_type)) { |
1282 // obj has to be of the exact type Foo if the CmpP succeeds. |
1283 // obj has to be of the exact type Foo if the CmpP succeeds. |
1283 assert(tboth->klass_is_exact(), "klass should be exact"); |
|
1284 int obj_in_map = map()->find_edge(obj); |
1284 int obj_in_map = map()->find_edge(obj); |
1285 JVMState* jvms = this->jvms(); |
1285 JVMState* jvms = this->jvms(); |
1286 if (obj_in_map >= 0 && |
1286 if (obj_in_map >= 0 && |
1287 (jvms->is_loc(obj_in_map) || jvms->is_stk(obj_in_map))) { |
1287 (jvms->is_loc(obj_in_map) || jvms->is_stk(obj_in_map))) { |
1288 TypeNode* ccast = new (C, 2) CheckCastPPNode(control(), obj, tboth); |
1288 TypeNode* ccast = new (C, 2) CheckCastPPNode(control(), obj, tboth); |