Integrated: 8343493: Perform module checks during MetaspaceShared::map_archives()
Ioi Lam
iklam at openjdk.org
Thu Nov 7 18:56:46 UTC 2024
On Tue, 5 Nov 2024 01:00:00 GMT, Ioi Lam <iklam at openjdk.org> wrote:
> 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](https://bugs.openjdk.org/browse/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.
>
> I also added some comments about what "serialize" does, since it's rather non-obvious.
This pull request has now been integrated.
Changeset: fac89f47
Author: Ioi Lam <iklam at openjdk.org>
URL: https://git.openjdk.org/jdk/commit/fac89f471c6f362cf47b3fae801e8cb51bd89bf6
Stats: 90 lines in 7 files changed: 75 ins; 6 del; 9 mod
8343493: Perform module checks during MetaspaceShared::map_archives()
Reviewed-by: ccheung, matsaave
-------------
PR: https://git.openjdk.org/jdk/pull/21890
More information about the hotspot-runtime-dev
mailing list