[Bad] the CDS archive cannot use full module graph with -XX:+UseJVMCICompiler
$ java -XX:+UnlockExperimentalVMOptions -XX:+UseJVMCICompiler -Xshare:dump
Java HotSpot(TM) 64-Bit Server VM warning: JVMCI Compiler disabled due to -Xint.
$ java -XX:+UnlockExperimentalVMOptions -XX:+UseJVMCICompiler -Xlog:cds --version | grep full.module
[0.013s][info][cds] full module graph: enabled
[0.013s][info][cds] full module graph: disabled
[0.013s][info][cds] full module graph: disabled
[0.017s][info][cds] full module graph: disabled
[0.017s][info][cds] full module graph: disabled
[0.017s][info][cds] full module graph: disabled
[0.017s][info][cds] initial full module graph: disabled
[Good] You can work around this problem with adding -Xmixed
$ java -Xmixed -XX:+UnlockExperimentalVMOptions -XX:+UseJVMCICompiler -Xshare:dump
$ java -XX:+UnlockExperimentalVMOptions -XX:+UseJVMCICompiler -Xlog:cds --version | grep full.module
[0.013s][info][cds] full module graph: enabled
[0.013s][info][cds] full module graph: enabled
[0.013s][info][cds] full module graph: enabled
[0.017s][info][cds] full module graph: enabled
[0.017s][info][cds] full module graph: enabled
[0.017s][info][cds] full module graph: enabled
[0.017s][info][cds] initial full module graph: enabled
[0.017s][info][cds] use_full_module_graph = true; java.base = 0x00007246a6554908
========== Proposed fix
$ git diff
diff --git a/src/hotspot/share/cds/cdsConfig.cpp b/src/hotspot/share/cds/cdsConfig.cpp
index 6ab77bf0007..4f08a667e00 100644
--- a/src/hotspot/share/cds/cdsConfig.cpp
+++ b/src/hotspot/share/cds/cdsConfig.cpp
@@ -429,7 +429,7 @@ bool CDSConfig::check_vm_args_consistency(bool patch_mod_javabase, bool mode_fla
}
if (is_dumping_static_archive()) {
- if (!mode_flag_cmd_line) {
+ if (!mode_flag_cmd_line JVMCI_ONLY(&& !EnableJVMCI)) {
// By default, -Xshare:dump runs in interpreter-only mode, which is required for deterministic archive.
//
// If your classlist is large and you don't care about deterministic dumping, you can use
$ java -XX:+UnlockExperimentalVMOptions -XX:+UseJVMCICompiler -Xshare:dump
Java HotSpot(TM) 64-Bit Server VM warning: JVMCI Compiler disabled due to -Xint.
$ java -XX:+UnlockExperimentalVMOptions -XX:+UseJVMCICompiler -Xlog:cds --version | grep full.module
[0.013s][info][cds] full module graph: enabled
[0.013s][info][cds] full module graph: disabled
[0.013s][info][cds] full module graph: disabled
[0.017s][info][cds] full module graph: disabled
[0.017s][info][cds] full module graph: disabled
[0.017s][info][cds] full module graph: disabled
[0.017s][info][cds] initial full module graph: disabled
[Good] You can work around this problem with adding -Xmixed
$ java -Xmixed -XX:+UnlockExperimentalVMOptions -XX:+UseJVMCICompiler -Xshare:dump
$ java -XX:+UnlockExperimentalVMOptions -XX:+UseJVMCICompiler -Xlog:cds --version | grep full.module
[0.013s][info][cds] full module graph: enabled
[0.013s][info][cds] full module graph: enabled
[0.013s][info][cds] full module graph: enabled
[0.017s][info][cds] full module graph: enabled
[0.017s][info][cds] full module graph: enabled
[0.017s][info][cds] full module graph: enabled
[0.017s][info][cds] initial full module graph: enabled
[0.017s][info][cds] use_full_module_graph = true; java.base = 0x00007246a6554908
========== Proposed fix
$ git diff
diff --git a/src/hotspot/share/cds/cdsConfig.cpp b/src/hotspot/share/cds/cdsConfig.cpp
index 6ab77bf0007..4f08a667e00 100644
--- a/src/hotspot/share/cds/cdsConfig.cpp
+++ b/src/hotspot/share/cds/cdsConfig.cpp
@@ -429,7 +429,7 @@ bool CDSConfig::check_vm_args_consistency(bool patch_mod_javabase, bool mode_fla
}
if (is_dumping_static_archive()) {
- if (!mode_flag_cmd_line) {
+ if (!mode_flag_cmd_line JVMCI_ONLY(&& !EnableJVMCI)) {
// By default, -Xshare:dump runs in interpreter-only mode, which is required for deterministic archive.
//
// If your classlist is large and you don't care about deterministic dumping, you can use
- relates to
-
JDK-8344556 [Graal] compiler/intrinsics/bmi/* fail when AOTCache cannot be loaded
-
- Open
-
- links to
-
Review(master) openjdk/jdk/22687