When dumping the module graph, we set some native pointers in ClassLoader and Module to null:
https://github.com/openjdk/jdk/blob/2f311d59dcbbf7605e52fac0b8ebd35d7d51a48b/src/hotspot/share/cds/heapShared.cpp#L298-L314
java_lang_Module::set_module_entry(obj, nullptr);
...
java_lang_ClassLoader::release_set_loader_data(obj, nullptr);
This is problematic for Leyden, as we want to run the AOT compiler in the same VM process after the CDS archive has been created.
The fix is simple: instead of modifying the "source" versions of these objects, which affects the current JVM, we can modify the "buffered" versions of these objects in ArchiveHeapWriter::copy_one_source_obj_to_buffer()
https://github.com/openjdk/jdk/blob/2f311d59dcbbf7605e52fac0b8ebd35d7d51a48b/src/hotspot/share/cds/archiveHeapWriter.cpp#L320
https://github.com/openjdk/jdk/blob/2f311d59dcbbf7605e52fac0b8ebd35d7d51a48b/src/hotspot/share/cds/heapShared.cpp#L298-L314
java_lang_Module::set_module_entry(obj, nullptr);
...
java_lang_ClassLoader::release_set_loader_data(obj, nullptr);
This is problematic for Leyden, as we want to run the AOT compiler in the same VM process after the CDS archive has been created.
The fix is simple: instead of modifying the "source" versions of these objects, which affects the current JVM, we can modify the "buffered" versions of these objects in ArchiveHeapWriter::copy_one_source_obj_to_buffer()
https://github.com/openjdk/jdk/blob/2f311d59dcbbf7605e52fac0b8ebd35d7d51a48b/src/hotspot/share/cds/archiveHeapWriter.cpp#L320
- relates to
-
JDK-8306582 Remove MetaspaceShared::exit_after_static_dump()
- Resolved