--- old/src/hotspot/share/ci/ciInstanceKlass.cpp 2020-03-26 15:56:58.000000000 -0700 +++ new/src/hotspot/share/ci/ciInstanceKlass.cpp 2020-03-26 15:56:58.000000000 -0700 @@ -63,6 +63,7 @@ _has_nonstatic_fields = ik->has_nonstatic_fields(); _has_nonstatic_concrete_methods = ik->has_nonstatic_concrete_methods(); _is_unsafe_anonymous = ik->is_unsafe_anonymous(); + _is_hidden = ik->is_hidden(); _nonstatic_fields = NULL; // initialized lazily by compute_nonstatic_fields: _has_injected_fields = -1; _implementor = NULL; // we will fill these lazily @@ -73,13 +74,13 @@ // InstanceKlass are created for both weak and strong metadata. Ensuring this metadata // alive covers the cases where there are weak roots without performance cost. oop holder = ik->klass_holder(); - if (ik->is_unsafe_anonymous()) { + if (ik->class_loader_data()->has_class_mirror_holder()) { // Though ciInstanceKlass records class loader oop, it's not enough to keep - // VM unsafe anonymous classes alive (loader == NULL). Klass holder should + // VM weak hidden and unsafe anonymous classes alive (loader == NULL). Klass holder should // be used instead. It is enough to record a ciObject, since cached elements are never removed // during ciObjectFactory lifetime. ciObjectFactory itself is created for // every compilation and lives for the whole duration of the compilation. - assert(holder != NULL, "holder of unsafe anonymous class is the mirror which is never null"); + assert(holder != NULL, "holder of hidden or unsafe anonymous class is the mirror which is never null"); (void)CURRENT_ENV->get_object(holder); } @@ -123,6 +124,7 @@ _nonstatic_fields = NULL; _has_injected_fields = -1; _is_unsafe_anonymous = false; + _is_hidden = false; _loader = loader; _protection_domain = protection_domain; _is_shared = false;