--- old/src/share/vm/opto/memnode.cpp 2017-07-14 16:33:38.493651908 +0200 +++ new/src/share/vm/opto/memnode.cpp 2017-07-14 16:33:38.389651913 +0200 @@ -1753,6 +1753,7 @@ } else if (tp->base() == Type::KlassPtr) { assert( off != Type::OffsetBot || // arrays can be cast to Objects + tp->is_klassptr()->klass() == NULL || tp->is_klassptr()->klass()->is_java_lang_Object() || // also allow array-loading from the primary supertype // array during subtype checks @@ -1764,7 +1765,7 @@ const TypeKlassPtr *tkls = tp->isa_klassptr(); if (tkls != NULL && !StressReflectiveCode) { ciKlass* klass = tkls->klass(); - if (klass->is_loaded() && tkls->klass_is_exact()) { + if (tkls->is_loaded() && tkls->klass_is_exact()) { // We are loading a field from a Klass metaobject whose identity // is known at compile time (the type is "exact" or "precise"). // Check for fields we know are maintained as constants by the VM. @@ -1797,7 +1798,7 @@ // We can still check if we are loading from the primary_supers array at a // shallow enough depth. Even though the klass is not exact, entries less // than or equal to its super depth are correct. - if (klass->is_loaded() ) { + if (tkls->is_loaded()) { ciType *inner = klass; while( inner->is_obj_array_klass() ) inner = inner->as_obj_array_klass()->base_element_type(); @@ -2128,9 +2129,10 @@ // Check for loading klass from an array klass const TypeKlassPtr *tkls = tp->isa_klassptr(); if (tkls != NULL && !StressReflectiveCode) { - ciKlass* klass = tkls->klass(); - if( !klass->is_loaded() ) + if (!tkls->is_loaded()) { return _type; // Bail out if not loaded + } + ciKlass* klass = tkls->klass(); if( klass->is_obj_array_klass() && tkls->offset() == in_bytes(ObjArrayKlass::element_klass_offset())) { ciKlass* elem = klass->as_obj_array_klass()->element_klass();