--- old/src/hotspot/share/ci/ciField.cpp 2020-04-02 11:54:15.000000000 -0700 +++ new/src/hotspot/share/ci/ciField.cpp 2020-04-02 11:54:15.000000000 -0700 @@ -223,9 +223,9 @@ holder->is_in_package("jdk/internal/foreign") || holder->is_in_package("jdk/incubator/foreign") || holder->is_in_package("java/lang")) return true; - // Trust VM hidden and unsafe anonymous classes. They are created via Lookup.defineClass or - // the private API (jdk.internal.misc.Unsafe) and can't be serialized, so there is no hacking - // of finals going on with them. + // Trust hidden classes and VM unsafe anonymous classes. They are created via + // Lookup.defineHiddenClass or the private jdk.internal.misc.Unsafe API and + // can't be serialized, so there is no hacking of finals going on with them. if (holder->is_hidden() || holder->is_unsafe_anonymous()) return true; // Trust final fields in all boxed classes --- old/src/hotspot/share/ci/ciInstanceKlass.cpp 2020-04-02 11:54:16.000000000 -0700 +++ new/src/hotspot/share/ci/ciInstanceKlass.cpp 2020-04-02 11:54:16.000000000 -0700 @@ -76,7 +76,7 @@ oop holder = ik->klass_holder(); if (ik->class_loader_data()->has_class_mirror_holder()) { // Though ciInstanceKlass records class loader oop, it's not enough to keep - // VM weak hidden and unsafe anonymous classes alive (loader == NULL). Klass holder should + // non-strong hidden classes and VM 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. --- old/src/hotspot/share/classfile/classLoaderData.cpp 2020-04-02 11:54:17.000000000 -0700 +++ new/src/hotspot/share/classfile/classLoaderData.cpp 2020-04-02 11:54:16.000000000 -0700 @@ -151,11 +151,11 @@ } if (!has_class_mirror_holder) { - // The holder is initialized later for weak hidden and unsafe anonymous classes, + // The holder is initialized later for non-strong hidden classes and unsafe anonymous classes, // and before calling anything that call class_loader(). initialize_holder(h_class_loader); - // A ClassLoaderData created solely for an weak hidden or unsafe anonymous class should + // A ClassLoaderData created solely for a non-strong hidden class or unsafe anonymous class should // never have a ModuleEntryTable or PackageEntryTable created for it. The defining package // and module for an unsafe anonymous class will be found in its host class. _packages = new PackageEntryTable(PackageEntryTable::_packagetable_entry_size); @@ -418,8 +418,8 @@ oop to; if (to_cld->has_class_mirror_holder()) { - // Just return if a weak hidden or unsafe anonymous class is attempting to record a dependency - // to itself. (Note that every weak hidden or unsafe anonymous class has its own unique class + // Just return if a non-strong hidden class or unsafe anonymous class is attempting to record a dependency + // to itself. (Note that every non-strong hidden class or unsafe anonymous class has its own unique class // loader data.) if (to_cld == from_cld) { return; @@ -618,7 +618,7 @@ // Unloading support bool ClassLoaderData::is_alive() const { - bool alive = keep_alive() // null class loader and incomplete weak hidden or unsafe anonymous klasses. + bool alive = keep_alive() // null class loader and incomplete non-strong hidden class or unsafe anonymous class. || (_holder.peek() != NULL); // and not cleaned by the GC weak handle processing. return alive; @@ -730,7 +730,7 @@ // Returns true if the class loader for this class loader data is one of // the 3 builtin (boot application/system or platform) class loaders, // including a user-defined system class loader. Note that if the class -// loader data is for a weak hidden or unsafe anonymous class then it may +// loader data is for a non-strong hidden class or unsafe anonymous class then it may // get freed by a GC even if its class loader is one of these loaders. bool ClassLoaderData::is_builtin_class_loader_data() const { return (is_boot_class_loader_data() || @@ -740,7 +740,7 @@ // Returns true if this class loader data is a class loader data // that is not ever freed by a GC. It must be the CLD for one of the builtin -// class loaders and not the CLD for a weak hidden or unsafe anonymous class. +// class loaders and not the CLD for a non-strong hidden class or unsafe anonymous class. bool ClassLoaderData::is_permanent_class_loader_data() const { return is_builtin_class_loader_data() && !has_class_mirror_holder(); } @@ -877,7 +877,7 @@ } } -// These CLDs are to contain weak hidden or unsafe anonymous classes used for JSR292 +// These CLDs are to contain non-strong hidden classes or unsafe anonymous classes used for JSR292 ClassLoaderData* ClassLoaderData::has_class_mirror_holder_cld(Handle loader) { // Add a new class loader data to the graph. return ClassLoaderDataGraph::add(loader, true); --- old/src/hotspot/share/classfile/classLoaderData.hpp 2020-04-02 11:54:17.000000000 -0700 +++ new/src/hotspot/share/classfile/classLoaderData.hpp 2020-04-02 11:54:17.000000000 -0700 @@ -127,9 +127,10 @@ bool _accumulated_modified_oops; // Mod Union Equivalent (CMS support) int _keep_alive; // if this CLD is kept alive. - // Used for weak hidden classes, unsafe anonymous classes and the + // Used for non-strong hidden classes, unsafe anonymous classes and the // boot class loader. _keep_alive does not need to be volatile or - // atomic since there is one unique CLD per weak hidden or unsafe anonymous class. + // atomic since there is one unique CLD per non-strong hidden class + // or unsafe anonymous class. volatile int _claim; // non-zero if claimed, for example during GC traces. // To avoid applying oop closure more than once. @@ -242,15 +243,15 @@ } // Returns true if this class loader data is for the system class loader. - // (Note that the class loader data may be for an weak hidden or unsafe anonymous class) + // (Note that the class loader data may be for a non-strong hidden class or unsafe anonymous class) bool is_system_class_loader_data() const; // Returns true if this class loader data is for the platform class loader. - // (Note that the class loader data may be for an weak hidden or unsafe anonymous class) + // (Note that the class loader data may be for a non-strong hidden class or unsafe anonymous class) bool is_platform_class_loader_data() const; // Returns true if this class loader data is for the boot class loader. - // (Note that the class loader data may be for an weak hidden unsafe anonymous class) + // (Note that the class loader data may be for a non-strong hidden class or unsafe anonymous class) inline bool is_boot_class_loader_data() const; bool is_builtin_class_loader_data() const; @@ -271,7 +272,7 @@ return _unloading; } - // Used to refcount an weak hidden or unsafe anonymous class's CLD in order to + // Used to refcount a non-strong hidden class's or unsafe anonymous class's CLD in order to // indicate their aliveness. void inc_keep_alive(); void dec_keep_alive(); --- old/src/hotspot/share/classfile/symbolTable.cpp 2020-04-02 11:54:18.000000000 -0700 +++ new/src/hotspot/share/classfile/symbolTable.cpp 2020-04-02 11:54:18.000000000 -0700 @@ -459,7 +459,7 @@ void SymbolTable::new_symbols(ClassLoaderData* loader_data, const constantPoolHandle& cp, int names_count, const char** names, int* lengths, int* cp_indices, unsigned int* hashValues) { - // Note that c_heap will be true for unsafe anonymous and weak hidden classes + // Note that c_heap will be true for non-strong hidden classes and unsafe anonymous classes // even if their loader is the boot loader because they will have a different cld. bool c_heap = !loader_data->is_the_null_class_loader_data(); for (int i = 0; i < names_count; i++) { --- old/src/hotspot/share/interpreter/linkResolver.cpp 2020-04-02 11:54:19.000000000 -0700 +++ new/src/hotspot/share/interpreter/linkResolver.cpp 2020-04-02 11:54:19.000000000 -0700 @@ -611,7 +611,7 @@ (same_module) ? "" : sel_klass->class_in_module_of_loader() ); - // For private access check if there was a problem with nest host + // For private access see if there was a problem with nest host // resolution, and if so report that as part of the message. if (sel_method->is_private()) { print_nest_host_error_on(&ss, ref_klass, sel_klass, THREAD); @@ -951,7 +951,7 @@ (same_module) ? "" : "; ", (same_module) ? "" : sel_klass->class_in_module_of_loader() ); - // For private access check if there was a problem with nest host + // For private access see if there was a problem with nest host // resolution, and if so report that as part of the message. if (fd.is_private()) { print_nest_host_error_on(&ss, ref_klass, sel_klass, THREAD); --- old/src/hotspot/share/jfr/recorder/checkpoint/types/jfrTypeSet.cpp 2020-04-02 11:54:20.000000000 -0700 +++ new/src/hotspot/share/jfr/recorder/checkpoint/types/jfrTypeSet.cpp 2020-04-02 11:54:19.000000000 -0700 @@ -162,7 +162,7 @@ if (klass->is_objArray_klass()) { klass = ObjArrayKlass::cast(klass)->bottom_klass(); } - if (klass->is_hidden_weak()) return NULL; + if (klass->is_non_strong_hidden()) return NULL; return is_unsafe_anonymous(klass) ? InstanceKlass::cast(klass)->unsafe_anonymous_host()->class_loader_data() : klass->class_loader_data(); } --- old/src/hotspot/share/memory/metaspace/spaceManager.cpp 2020-04-02 11:54:20.000000000 -0700 +++ new/src/hotspot/share/memory/metaspace/spaceManager.cpp 2020-04-02 11:54:20.000000000 -0700 @@ -117,7 +117,7 @@ // Special case for hidden metadata space. // ClassMirrorHolder metadata space is usually small since it is used for // class loader data's whose life cycle is governed by one class such as a - // weak hidden or unsafe anonymous class. The majority within 1K - 2K range and + // non-strong hidden class or unsafe anonymous class. The majority within 1K - 2K range and // rarely about 4K (64-bits JVM). // Instead of jumping to SmallChunk after initial chunk exhausted, keeping allocation // from SpecializeChunk up to _anon_or_delegating_metadata_specialize_chunk_limit (4) --- old/src/hotspot/share/memory/metaspaceTracer.cpp 2020-04-02 11:54:21.000000000 -0700 +++ new/src/hotspot/share/memory/metaspaceTracer.cpp 2020-04-02 11:54:21.000000000 -0700 @@ -66,7 +66,7 @@ event.set_hiddenClassLoader(false); if (cld->has_class_mirror_holder()) { assert(cld->klasses() != NULL, "unexpected NULL for cld->klasses()"); - if (cld->klasses()->is_hidden_weak()) { + if (cld->klasses()->is_non_strong_hidden()) { event.set_hiddenClassLoader(true); } else { event.set_unsafeAnonymousClassLoader(true); --- old/src/hotspot/share/oops/instanceKlass.cpp 2020-04-02 11:54:22.000000000 -0700 +++ new/src/hotspot/share/oops/instanceKlass.cpp 2020-04-02 11:54:22.000000000 -0700 @@ -2711,7 +2711,7 @@ if (is_hidden() && in_unnamed_package() && class_loader_data()->has_class_mirror_holder()) { - // For a weak hidden class defined to an unnamed package, + // For a non-strong hidden class defined to an unnamed package, // its (class held) CLD will not have an unnamed module created for it. // Two choices to find the correct ModuleEntry: // 1. If hidden class is within a nest, use nest host's module --- old/src/hotspot/share/oops/instanceMirrorKlass.inline.hpp 2020-04-02 11:54:23.000000000 -0700 +++ new/src/hotspot/share/oops/instanceMirrorKlass.inline.hpp 2020-04-02 11:54:22.000000000 -0700 @@ -53,7 +53,7 @@ // We'll get NULL for primitive mirrors. if (klass != NULL) { if (klass->is_instance_klass() && klass->class_loader_data()->has_class_mirror_holder()) { - // A weak hidden or an unsafe anonymous class doesn't have its own class loader, + // A non-strong hidden class or an unsafe anonymous class doesn't have its own class loader, // so when handling the java mirror for the class we need to make sure its class // loader data is claimed, this is done by calling do_cld explicitly. // For non-anonymous classes the call to do_cld is made when the class --- old/src/hotspot/share/oops/klass.hpp 2020-04-02 11:54:23.000000000 -0700 +++ new/src/hotspot/share/oops/klass.hpp 2020-04-02 11:54:23.000000000 -0700 @@ -617,7 +617,7 @@ void set_is_shared() { _access_flags.set_is_shared_class(); } bool is_hidden() const { return access_flags().is_hidden_class(); } void set_is_hidden() { _access_flags.set_is_hidden_class(); } - bool is_hidden_weak() const { return access_flags().is_hidden_class() && + bool is_non_strong_hidden() const { return access_flags().is_hidden_class() && class_loader_data()->has_class_mirror_holder(); } bool is_cloneable() const;