src/hotspot/share/classfile/classLoaderData.hpp
changeset 51444 3e5d28e6de32
parent 51375 b812a85b3aa4
child 51470 84d3126858d5
--- a/src/hotspot/share/classfile/classLoaderData.hpp	Mon Aug 20 10:04:00 2018 +0200
+++ b/src/hotspot/share/classfile/classLoaderData.hpp	Mon Aug 20 08:25:57 2018 -0400
@@ -92,8 +92,8 @@
   static volatile size_t  _num_instance_classes;
   static volatile size_t  _num_array_classes;
 
-  static ClassLoaderData* add_to_graph(Handle class_loader, bool anonymous);
-  static ClassLoaderData* add(Handle class_loader, bool anonymous);
+  static ClassLoaderData* add_to_graph(Handle class_loader, bool is_unsafe_anonymous);
+  static ClassLoaderData* add(Handle class_loader, bool is_unsafe_anonymous);
 
  public:
   static ClassLoaderData* find_or_create(Handle class_loader);
@@ -114,7 +114,7 @@
   // Walking classes through the ClassLoaderDataGraph include array classes.  It also includes
   // classes that are allocated but not loaded, classes that have errors, and scratch classes
   // for redefinition.  These classes are removed during the next class unloading.
-  // Walking the ClassLoaderDataGraph also includes anonymous classes.
+  // Walking the ClassLoaderDataGraph also includes unsafe anonymous classes.
   static void classes_do(KlassClosure* klass_closure);
   static void classes_do(void f(Klass* const));
   static void methods_do(void f(Method*));
@@ -238,16 +238,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_anonymous;      // if this CLD is for an anonymous class
+  bool _is_unsafe_anonymous; // CLD is dedicated to one class and that class determines the CLDs lifecycle.
+                             // For example, 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)
 
   s2 _keep_alive;          // if this CLD is kept alive.
-                           // Used for anonymous classes and the boot class
+                           // 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 anonymous class.
+                           // atomic since there is one unique CLD per unsafe anonymous class.
 
   volatile int _claimed;   // true if claimed, for example during GC traces.
                            // To avoid applying oop closure more than once.
@@ -283,7 +284,7 @@
   void set_next(ClassLoaderData* next) { _next = next; }
   ClassLoaderData* next() const        { return _next; }
 
-  ClassLoaderData(Handle h_class_loader, bool is_anonymous);
+  ClassLoaderData(Handle h_class_loader, bool is_unsafe_anonymous);
   ~ClassLoaderData();
 
   // The CLD are not placed in the Heap, so the Card Table or
@@ -337,7 +338,7 @@
 
   Mutex* metaspace_lock() const { return _metaspace_lock; }
 
-  bool is_anonymous() const { return _is_anonymous; }
+  bool is_unsafe_anonymous() const { return _is_unsafe_anonymous; }
 
   static void init_null_class_loader_data();
 
@@ -346,15 +347,15 @@
   }
 
   // Returns true if this class loader data is for the system class loader.
-  // (Note that the class loader data may be anonymous.)
+  // (Note that the class loader data may be unsafe anonymous.)
   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 anonymous.)
+  // (Note that the class loader data may be unsafe anonymous.)
   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 anonymous.)
+  // (Note that the class loader data may be unsafe anonymous.)
   inline bool is_boot_class_loader_data() const;
 
   bool is_builtin_class_loader_data() const;
@@ -372,7 +373,7 @@
     return _unloading;
   }
 
-  // Used to refcount an anonymous class's CLD in order to
+  // Used to refcount an unsafe anonymous class's CLD in order to
   // indicate their aliveness.
   void inc_keep_alive();
   void dec_keep_alive();
@@ -412,7 +413,7 @@
 
   static ClassLoaderData* class_loader_data(oop loader);
   static ClassLoaderData* class_loader_data_or_null(oop loader);
-  static ClassLoaderData* anonymous_class_loader_data(Handle loader);
+  static ClassLoaderData* unsafe_anonymous_class_loader_data(Handle loader);
 
   // Returns Klass* of associated class loader, or NULL if associated loader is 'bootstrap'.
   // Also works if unloading.