--- old/src/hotspot/share/c1/c1_GraphBuilder.cpp 2019-03-06 21:28:04.702453915 -0800 +++ new/src/hotspot/share/c1/c1_GraphBuilder.cpp 2019-03-06 21:28:04.442444781 -0800 @@ -1664,37 +1664,9 @@ BasicType field_type = field->type()->basic_type(); ValueType* type = as_ValueType(field_type); - // Null check and deopt for getting static value field - ciValueKlass* value_klass = NULL; - Value default_value = NULL; - bool needs_deopt = false; - if (code == Bytecodes::_getstatic && !field->is_static_constant() && - field->layout_type() == T_VALUETYPE && field->is_flattenable()) { - value_klass = field->type()->as_value_klass(); - if (holder->is_loaded()) { - ciInstance* mirror = field->holder()->java_mirror(); - ciObject* val = mirror->field_value(field).as_object(); - if (val->is_null_object()) { - // This is a non-nullable static field, but it's not initialized. - // We need to do a null check, and replace it with the default value. - } else { - // No need to perform null check on this static field - value_klass = NULL; - } - } - if (value_klass != NULL) { - if (value_klass->is_loaded()) { - default_value = new Constant(new InstanceConstant(value_klass->default_value_instance())); - } else { - needs_deopt = true; - } - } - } - // call will_link again to determine if the field is valid. const bool needs_patching = !holder->is_loaded() || !field->will_link(method(), code) || - needs_deopt || PatchALot; ValueStack* state_before = NULL; @@ -1743,9 +1715,8 @@ state_before = copy_state_for_exception(); } LoadField* load_field = new LoadField(append(obj), offset, field, true, - state_before, needs_patching, - value_klass, default_value); - if (field->layout_type() == T_VALUETYPE && field->is_flattenable()) { + state_before, needs_patching); + if (field->is_never_null()) { load_field->set_never_null(true); } push(type, append(load_field));