RFR: 8316969: Improve CDS module graph support for --module option
Alan Bateman
alanb at openjdk.org
Wed Oct 18 06:28:46 UTC 2023
On Mon, 2 Oct 2023 22:17:34 GMT, Calvin Cheung <ccheung at openjdk.org> wrote:
> Please review this changeset for adding support for `--module` (-m) option for CDS.
> Changes in the `ModuleBootstrap.java` are needed so that the `ArchivedModuleGraph.archive` and `ArchivedBootLayer.archive` are called if the main module is specified. The module name will be stored in the ro region of the CDS archive. During runtime, the archived module name will be compared with the runtime module name. If comparison fails, the archived full module graph won't be used.
>
> Note: this RFE is a subtask of [JDK-8266329](https://bugs.openjdk.org/browse/JDK-8266329). More subtask(s) will be created to support other options such as `--add-modules`.
>
> Passed tiers 1 - 4 testing.
src/java.base/share/classes/jdk/internal/module/ModuleBootstrap.java line 472:
> 470:
> 471: // if -Xshare:dump and mainModule are specified, check if the mainModule
> 472: // is a builtin JDK module. If so, set canArchive to true so that the
There is no notion of "built-in JDK module" so I think change the comment to say that it checks if the main module is in the run-time image and not on the upgrade module path.
URI schemes are compared without regard to case so it should be equalsIgnoreCase("jrt").
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/16016#discussion_r1363314822
More information about the core-libs-dev
mailing list