comparison src/share/vm/opto/graphKit.cpp @ 17799:752ba2e5f6d0

Merge
author kvn
date Tue, 25 Feb 2014 15:11:18 -0800
parents a9becfeecd1b de95063c0e34
children bb9356ec5967 fdad2932c73f 62c54fcc0a35
comparison
equal deleted inserted replaced
17798:f040cf9fc9c0 17799:752ba2e5f6d0
418 } else { 418 } else {
419 while (dst->req() < region->req()) add_one_req(dst, src); 419 while (dst->req() < region->req()) add_one_req(dst, src);
420 } 420 }
421 const Type* srctype = _gvn.type(src); 421 const Type* srctype = _gvn.type(src);
422 if (phi->type() != srctype) { 422 if (phi->type() != srctype) {
423 const Type* dsttype = phi->type()->meet(srctype); 423 const Type* dsttype = phi->type()->meet_speculative(srctype);
424 if (phi->type() != dsttype) { 424 if (phi->type() != dsttype) {
425 phi->set_type(dsttype); 425 phi->set_type(dsttype);
426 _gvn.set_type(phi, dsttype); 426 _gvn.set_type(phi, dsttype);
427 } 427 }
428 } 428 }
1222 } 1222 }
1223 } else { 1223 } else {
1224 // See if mixing in the NULL pointer changes type. 1224 // See if mixing in the NULL pointer changes type.
1225 // If so, then the NULL pointer was not allowed in the original 1225 // If so, then the NULL pointer was not allowed in the original
1226 // type. In other words, "value" was not-null. 1226 // type. In other words, "value" was not-null.
1227 if (t->meet(TypePtr::NULL_PTR) != t) { 1227 if (t->meet(TypePtr::NULL_PTR) != t->remove_speculative()) {
1228 // same as: if (!TypePtr::NULL_PTR->higher_equal(t)) ... 1228 // same as: if (!TypePtr::NULL_PTR->higher_equal(t)) ...
1229 explicit_null_checks_elided++; 1229 explicit_null_checks_elided++;
1230 return value; // Elided null check quickly! 1230 return value; // Elided null check quickly!
1231 } 1231 }
1232 } 1232 }
1355 1355
1356 //------------------------------cast_not_null---------------------------------- 1356 //------------------------------cast_not_null----------------------------------
1357 // Cast obj to not-null on this path 1357 // Cast obj to not-null on this path
1358 Node* GraphKit::cast_not_null(Node* obj, bool do_replace_in_map) { 1358 Node* GraphKit::cast_not_null(Node* obj, bool do_replace_in_map) {
1359 const Type *t = _gvn.type(obj); 1359 const Type *t = _gvn.type(obj);
1360 const Type *t_not_null = t->join(TypePtr::NOTNULL); 1360 const Type *t_not_null = t->join_speculative(TypePtr::NOTNULL);
1361 // Object is already not-null? 1361 // Object is already not-null?
1362 if( t == t_not_null ) return obj; 1362 if( t == t_not_null ) return obj;
1363 1363
1364 Node *cast = new (C) CastPPNode(obj,t_not_null); 1364 Node *cast = new (C) CastPPNode(obj,t_not_null);
1365 cast->init_req(0, control()); 1365 cast->init_req(0, control());
3012 cast_obj = maybe_cast_profiled_receiver(not_null_obj, tk->klass(), spec_obj_type, safe_for_replace); 3012 cast_obj = maybe_cast_profiled_receiver(not_null_obj, tk->klass(), spec_obj_type, safe_for_replace);
3013 if (cast_obj != NULL) { 3013 if (cast_obj != NULL) {
3014 if (failure_control != NULL) // failure is now impossible 3014 if (failure_control != NULL) // failure is now impossible
3015 (*failure_control) = top(); 3015 (*failure_control) = top();
3016 // adjust the type of the phi to the exact klass: 3016 // adjust the type of the phi to the exact klass:
3017 phi->raise_bottom_type(_gvn.type(cast_obj)->meet(TypePtr::NULL_PTR)); 3017 phi->raise_bottom_type(_gvn.type(cast_obj)->meet_speculative(TypePtr::NULL_PTR));
3018 } 3018 }
3019 } 3019 }
3020 3020
3021 if (cast_obj == NULL) { 3021 if (cast_obj == NULL) {
3022 // Load the object's klass 3022 // Load the object's klass