< prev index next >

src/hotspot/share/classfile/classLoaderDataShared.cpp

Print this page
@@ -57,10 +57,11 @@
      f->do_ptr((void**)&_packages);
      f->do_ptr((void**)&_modules);
    }
  
    void restore(ClassLoaderData* loader_data, bool do_entries, bool do_oops);
+   void clear_archived_oops();
  };
  
  static ArchivedClassLoaderData _archived_boot_loader_data;
  static ArchivedClassLoaderData _archived_platform_loader_data;
  static ArchivedClassLoaderData _archived_system_loader_data;

@@ -121,10 +122,19 @@
        modules->restore_archived_oops(loader_data, _modules);
      }
    }
  }
  
+ void ArchivedClassLoaderData::clear_archived_oops() {
+   assert(UseSharedSpaces, "must be");
+   if (_modules != NULL) {
+     for (int i = 0; i < _modules->length(); i++) {
+       _modules->at(i)->clear_archived_oops();
+     }
+   }
+ }
+ 
  // ------------------------------
  
  static ClassLoaderData* null_class_loader_data() {
    ClassLoaderData* loader_data = ClassLoaderData::the_null_class_loader_data();
    assert(loader_data != NULL, "must be");

@@ -181,10 +191,17 @@
      log_info(cds)("use_full_module_graph = true; java.base = " INTPTR_FORMAT,
                    p2i(_archived_javabase_moduleEntry));
    }
  }
  
+ void ClassLoaderDataShared::clear_archived_oops() {
+   assert(UseSharedSpaces && !MetaspaceShared::use_full_module_graph(), "must be");
+   _archived_boot_loader_data.clear_archived_oops();
+   _archived_platform_loader_data.clear_archived_oops();
+   _archived_system_loader_data.clear_archived_oops();
+ }
+ 
  oop ClassLoaderDataShared::restore_archived_oops_for_null_class_loader_data() {
    assert(UseSharedSpaces && MetaspaceShared::use_full_module_graph(), "must be");
    _archived_boot_loader_data.restore(null_class_loader_data(), false, true);
    return _archived_javabase_moduleEntry->module();
  }
< prev index next >