diff -r d20828de9e39 -r 73dd19b96b5d hotspot/src/share/vm/opto/parse2.cpp --- a/hotspot/src/share/vm/opto/parse2.cpp Thu Jun 15 09:52:44 2017 +0200 +++ b/hotspot/src/share/vm/opto/parse2.cpp Fri Jun 09 10:51:52 2017 +0200 @@ -2282,6 +2282,11 @@ b = null_check_oop(b, &null_ctl, true, true, true); assert(null_ctl->is_top(), "no null control here"); dec_sp(1); + } else if (_gvn.type(b)->speculative_always_null() && + !too_many_traps(Deoptimization::Reason_speculate_null_assert)) { + inc_sp(1); + b = null_assert(b); + dec_sp(1); } c = _gvn.transform( new CmpPNode(b, a) ); do_ifnull(btest, c);