--- old/src/hotspot/share/opto/macro.cpp 2018-05-17 16:24:12.047027984 +0200 +++ new/src/hotspot/share/opto/macro.cpp 2018-05-17 16:24:11.799027988 +0200 @@ -691,13 +691,17 @@ bt = T_NARROWOOP; } value = value_from_mem(mem, ctl, bt, ft, adr_type, alloc); - assert(value != NULL, "field value should not be null"); - if (ft->isa_narrowoop()) { + if (value != NULL && ft->isa_narrowoop()) { assert(UseCompressedOops, "unexpected narrow oop"); value = transform_later(new DecodeNNode(value, value->get_ptr_type())); } } - vt->set_field_value(i, value); + if (value != NULL) { + vt->set_field_value(i, value); + } else { + // We might have reached the TrackedInitializationLimit + return NULL; + } } return vt; } --- old/src/hotspot/share/opto/parse1.cpp 2018-05-17 16:24:12.519027978 +0200 +++ new/src/hotspot/share/opto/parse1.cpp 2018-05-17 16:24:12.267027981 +0200 @@ -2377,21 +2377,11 @@ ValueTypeNode* vt = value->as_ValueType()->allocate(this)->as_ValueType(); value = ValueTypePtrNode::make_from_value_type(_gvn, vt); } else if (phi->bottom_type()->isa_valuetype() && !value->is_ValueType()) { - Node* null_ctl = top(); - Node* not_null_obj = null_check_common(value, T_VALUETYPE, false, &null_ctl, false); - if (null_ctl != top()) { - // TODO For now, we just deoptimize if value type is NULL - PreserveJVMState pjvms(this); - set_control(null_ctl); - replace_in_map(value, null()); - inc_sp(1); - uncommon_trap(Deoptimization::Reason_null_check, Deoptimization::Action_none); - } - if (stopped()) { - value = null(); - } else { - value = ValueTypeNode::make_from_oop(this, not_null_obj, phi->bottom_type()->isa_valuetype()->value_klass()); - } + assert(value->bottom_type()->remove_speculative() == TypePtr::NULL_PTR, "Anything other than null?"); + inc_sp(1); + uncommon_trap(Deoptimization::Reason_null_check, Deoptimization::Action_none); + dec_sp(1); + return; } else { // Handle returns of oop-arrays to an arrays-of-interface return const TypeInstPtr* phi_tip;