--- old/src/hotspot/share/opto/parseHelper.cpp 2018-09-27 10:50:18.003075988 +0200 +++ new/src/hotspot/share/opto/parseHelper.cpp 2018-09-27 10:50:10.246059680 +0200 @@ -149,25 +149,16 @@ Node *idx = peek(1); Node *ary = peek(2); - const Type* elemtype = _gvn.type(ary)->is_aryptr()->elem(); + const TypeAryPtr* ary_t = _gvn.type(ary)->is_aryptr(); + const Type* elemtype = ary_t->elem(); const TypeOopPtr* elemptr = elemtype->make_oopptr(); bool is_value_array = elemtype->isa_valuetype() != NULL || (elemptr != NULL && elemptr->is_valuetypeptr()); - bool can_be_value_array = is_value_array || (elemptr != NULL && (elemptr->can_be_value_type())); if (_gvn.type(obj) == TypePtr::NULL_PTR) { // There's never a type check on null values. // This cutout lets us avoid the uncommon_trap(Reason_array_check) // below, which turns into a performance liability if the // gen_checkcast folds up completely. - if (is_value_array) { - // Can not store null into a value type array - uncommon_trap(Deoptimization::Reason_null_check, Deoptimization::Action_none); - return obj; - } else if (can_be_value_array) { - // Throw exception if array is a value type array - gen_value_type_array_guard(ary, zerocon(T_OBJECT)); - return obj; - } return obj; } @@ -252,10 +243,6 @@ ciValueKlass* vk = elemtype->isa_valuetype() ? elemtype->is_valuetype()->value_klass() : elemptr->value_klass(); a_e_klass = makecon(TypeKlassPtr::make(vk)); - } else if (can_be_value_array && !obj->is_ValueType() && _gvn.type(obj)->is_oopptr()->can_be_value_type()) { - // We cannot statically determine if the array is a value type array - // and we also don't know if 'obj' is a value type. Emit runtime checks. - gen_value_type_array_guard(ary, obj, a_e_klass); } // Check (the hard way) and throw if not a subklass.