src/share/vm/memory/universe.cpp
Print this page
rev 6853 : 8046070: Class Data Sharing clean up and refactoring
Summary: Cleaned up CDS to be more configurable, maintainable and extensible
Reviewed-by: dholmes, coleenp, acorn, mchung
@@ -24,18 +24,22 @@
#include "precompiled.hpp"
#include "classfile/classLoader.hpp"
#include "classfile/classLoaderData.hpp"
#include "classfile/javaClasses.hpp"
+#if INCLUDE_CDS
+#include "classfile/sharedClassUtil.hpp"
+#endif
#include "classfile/stringTable.hpp"
#include "classfile/systemDictionary.hpp"
#include "classfile/vmSymbols.hpp"
#include "code/codeCache.hpp"
#include "code/dependencies.hpp"
#include "gc_interface/collectedHeap.inline.hpp"
#include "interpreter/interpreter.hpp"
#include "memory/cardTableModRefBS.hpp"
+#include "memory/filemap.hpp"
#include "memory/gcLocker.inline.hpp"
#include "memory/genCollectedHeap.hpp"
#include "memory/genRemSet.hpp"
#include "memory/generation.hpp"
#include "memory/metadataFactory.hpp"
@@ -237,12 +241,13 @@
}
void initialize_basic_type_klass(Klass* k, TRAPS) {
Klass* ok = SystemDictionary::Object_klass();
if (UseSharedSpaces) {
+ ClassLoaderData* loader_data = ClassLoaderData::the_null_class_loader_data();
assert(k->super() == ok, "u3");
- k->restore_unshareable_info(CHECK);
+ k->restore_unshareable_info(loader_data, Handle(), CHECK);
} else {
k->initialize_supers(ok, CHECK);
}
k->append_to_sibling_list();
}
@@ -664,10 +669,14 @@
StringTable::create_table();
} else {
SymbolTable::create_table();
StringTable::create_table();
ClassLoader::create_package_info_table();
+
+ if (DumpSharedSpaces) {
+ MetaspaceShared::prepare_for_dumping();
+ }
}
return JNI_OK;
}
@@ -1153,10 +1162,15 @@
CompressedClassSpaceCounters::initialize_performance_counters();
MemoryService::add_metaspace_memory_pools();
MemoryService::set_universe_heap(Universe::_collectedHeap);
+#if INCLUDE_CDS
+ if (UseSharedSpaces) {
+ SharedClassUtil::initialize(CHECK_false);
+ }
+#endif
return true;
}
void Universe::compute_base_vtable_size() {