8232081: Try to link all classes during dynamic CDS dump

During CDS dynamic dump, link all classes loaded by the builtin class loaders in JVM_BeforeHalt() and JavaThread::invoke_shutdown_hooks().

Reviewed-by: iklam, dholmes
This commit is contained in:
Calvin Cheung 2020-03-06 15:33:13 -08:00
parent 8c1204de6b
commit 9e2ab1e363
6 changed files with 202 additions and 13 deletions

View file

@ -469,6 +469,10 @@ extern volatile jint vm_created;
JVM_ENTRY_NO_ENV(void, JVM_BeforeHalt())
JVMWrapper("JVM_BeforeHalt");
// Link all classes for dynamic CDS dumping before vm exit.
if (DynamicDumpSharedSpaces) {
MetaspaceShared::link_and_cleanup_shared_classes(THREAD);
}
EventShutdown event;
if (event.should_commit()) {
event.set_reason("Shutdown requested from Java");