RFR: 8305753: Allow JIT compilation for -Xshare:dump

Matias Saavedra Silva matsaave at openjdk.org
Wed Oct 18 20:01:23 UTC 2023


On Wed, 18 Oct 2023 05:43:11 GMT, Ioi Lam <iklam at openjdk.org> wrote:

> This RFE makes it possible for the user to enable the JIT compiler during the CDS dump by specifying `-Xshare:dump -Xmixed`
> 
> By default, `-Xshare:dump` runs with `-Xint`. This maintains the previous behavior.
> 
> Which mode to use?
> 
> - Dumping in `-Xint` mode is faster when the classlist is small. `-Xint` is also required for deterministic dumping (compiler threads can change the order of the archived object).
> 
> - However, dumping in `-Xmixed` mode is faster when the class list is larger. We also need to run the compiler in Leyden so that we can generate the CDS archive and AOT code at the same time.
> 
> 
> Tested with tiers 1-4 and builds-tier5.

Looks good but I have a few questions

src/hotspot/share/runtime/arguments.cpp line 3048:

> 3046:       // -Xcomp may use excessive CPU for the test tiers. Also, -Xshare:dump runs a small and fixed set of
> 3047:       // Java code, so there's not much benefit in running -Xcomp.
> 3048:       log_info(cds)("reduced -Xcomp to -Xmixed");

Is it preferable to reduce the user-selected option over throwing an error for incompatible options?

src/hotspot/share/runtime/arguments.cpp line 3049:

> 3047:       // Java code, so there's not much benefit in running -Xcomp.
> 3048:       log_info(cds)("reduced -Xcomp to -Xmixed");
> 3049:       set_mode_flags(_mixed);

Missing an else if case for `_mode==_mixed` ?

test/hotspot/jtreg/runtime/cds/DeterministicDump.java line 82:

> 80:         String mapName = logName + ".map";
> 81:         CDSOptions opts = (new CDSOptions())
> 82:             .addPrefix("-Xint") // Override any -Xmixed/-Xcomp flags from jtreg -vmoptions

I assume this issue could pop up in newer tests as well. Is there a place where you can specify that `-Xint` needs to be explicitly added when doing a static dump?

-------------

PR Review: https://git.openjdk.org/jdk/pull/16233#pullrequestreview-1686011916
PR Review Comment: https://git.openjdk.org/jdk/pull/16233#discussion_r1364451723
PR Review Comment: https://git.openjdk.org/jdk/pull/16233#discussion_r1364464721
PR Review Comment: https://git.openjdk.org/jdk/pull/16233#discussion_r1364459907


More information about the hotspot-runtime-dev mailing list