--- old/src/hotspot/share/classfile/classLoaderData.hpp 2019-10-08 18:52:50.000000000 -0700 +++ new/src/hotspot/share/classfile/classLoaderData.hpp 2019-10-08 18:52:50.000000000 -0700 @@ -117,17 +117,17 @@ // classes in the class loader are allocated. Mutex* _metaspace_lock; // Locks the metaspace for allocations and setup. bool _unloading; // true if this class loader goes away - bool _is_unsafe_anonymous; // CLD is dedicated to one class and that class determines the CLDs lifecycle. - // For example, an unsafe anonymous class. + bool _is_shortlived; // CLD is dedicated to one class and that class determines the CLDs lifecycle. + // For example, a weak hidden or an unsafe anonymous class. // Remembered sets support for the oops in the class loader data. bool _modified_oops; // Card Table Equivalent (YC/CMS support) bool _accumulated_modified_oops; // Mod Union Equivalent (CMS support) int _keep_alive; // if this CLD is kept alive. - // Used for 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 unsafe anonymous class. + // Used for weak 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. volatile int _claim; // non-zero if claimed, for example during GC traces. // To avoid applying oop closure more than once. @@ -162,7 +162,7 @@ void set_next(ClassLoaderData* next) { _next = next; } ClassLoaderData* next() const { return Atomic::load(&_next); } - ClassLoaderData(Handle h_class_loader, bool is_unsafe_anonymous); + ClassLoaderData(Handle h_class_loader, bool is_shortlived); ~ClassLoaderData(); // The CLD are not placed in the Heap, so the Card Table or @@ -231,7 +231,7 @@ Mutex* metaspace_lock() const { return _metaspace_lock; } - bool is_unsafe_anonymous() const { return _is_unsafe_anonymous; } + bool is_shortlived() const { return _is_shortlived; } static void init_null_class_loader_data(); @@ -240,15 +240,15 @@ } // Returns true if this class loader data is for the system class loader. - // (Note that the class loader data may be unsafe anonymous.) + // (Note that the class loader data may be for an weak hidden 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 unsafe anonymous.) + // (Note that the class loader data may be for an weak hidden 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 unsafe anonymous.) + // (Note that the class loader data may be for an weak hidden unsafe anonymous class) inline bool is_boot_class_loader_data() const; bool is_builtin_class_loader_data() const; @@ -269,7 +269,7 @@ return _unloading; } - // Used to refcount an unsafe anonymous class's CLD in order to + // Used to refcount an weak hidden or unsafe anonymous class's CLD in order to // indicate their aliveness. void inc_keep_alive(); void dec_keep_alive(); @@ -313,7 +313,7 @@ static ClassLoaderData* class_loader_data(oop loader); static ClassLoaderData* class_loader_data_or_null(oop loader); - static ClassLoaderData* unsafe_anonymous_class_loader_data(Handle loader); + static ClassLoaderData* shortlived_class_loader_data(Handle loader); // Returns Klass* of associated class loader, or NULL if associated loader is 'bootstrap'. // Also works if unloading.