Currently, Modules::serialize() and Modules::serialize_addmods_names() store/retrieve the main module name, as well as the set of modules specified by --add-modules. These functions are called from MetaspaceShared::serialize(), *after* the JVM has decided to use the CDS archive.
However, with JEP 483 (JDK-8315737), we need the module information *before* deciding whether to use the CDS archive. For example, if -XX:+AOTClassLinking is specified during the CDS archive creation, the archive cannot be used if we specified an incompatible main module at runtime.
This RFE added a new function, MetaspaceShared::early_serialize(), which is called from MetaspaceShared::map_archives(). Modules::serialize() and Modules::serialize_addmods_names() are called within this context so that we can use the module information to decide whether to use the CDS archive or not.
However, with JEP 483 (JDK-8315737), we need the module information *before* deciding whether to use the CDS archive. For example, if -XX:+AOTClassLinking is specified during the CDS archive creation, the archive cannot be used if we specified an incompatible main module at runtime.
This RFE added a new function, MetaspaceShared::early_serialize(), which is called from MetaspaceShared::map_archives(). Modules::serialize() and Modules::serialize_addmods_names() are called within this context so that we can use the module information to decide whether to use the CDS archive or not.
- links to
-
Commit(master) openjdk/jdk/fac89f47
-
Review(master) openjdk/jdk/21890