< prev index next >

src/hotspot/share/classfile/systemDictionaryShared.cpp

Print this page
rev 58565 : 8238358: Implementation of JEP 371: Hidden Classes
Reviewed-by: duke
Contributed-by: mandy.chung@oracle.com, lois.foltan@oracle.com, david.holmes@oracle.com, harold.seigel@oracle.com, serguei.spitsyn@oracle.com, alex.buckley@oracle.com, jamsheed.c.m@oracle.com

@@ -907,11 +907,11 @@
                                                           const ClassFileStream* cfs,
                                                           TRAPS) {
   if (!UseSharedSpaces) {
     return NULL;
   }
-  if (class_name == NULL) {  // don't do this for anonymous classes
+  if (class_name == NULL) {  // don't do this for hidden and unsafe anonymous classes
     return NULL;
   }
   if (class_loader.is_null() ||
       SystemDictionary::is_system_class_loader(class_loader()) ||
       SystemDictionary::is_platform_class_loader(class_loader())) {

@@ -1086,13 +1086,13 @@
   ResourceMark rm;
   log_warning(cds)("Skipping %s: %s", k->name()->as_C_string(), reason);
 }
 
 bool SystemDictionaryShared::should_be_excluded(InstanceKlass* k) {
-  if (k->class_loader_data()->is_unsafe_anonymous()) {
-    warn_excluded(k, "Unsafe anonymous class");
-    return true; // unsafe anonymous classes are not archived, skip
+  if (k->is_hidden() || k->is_unsafe_anonymous()) {
+    warn_excluded(k, "Hidden or Unsafe anonymous class");
+    return true; // hidden and unsafe anonymous classes are not archived, skip
   }
   if (k->is_in_error_state()) {
     warn_excluded(k, "In error state");
     return true;
   }
< prev index next >