Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8345635

JVMCI compiler should not be disabled by java -Xshare:dump

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P3 P3
    • 25
    • 24
    • hotspot

      [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


            iklam Ioi Lam
            iklam Ioi Lam
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: