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

AOT cache created without graal jit should not be used with graal jit

XMLWordPrintable

    • b03

      $ java -cp HelloWorld.jar -XX:AOTMode=record -XX:AOTConfiguration=hw.aotconfig HelloWorld
      Hello World
      AOTConfiguration recorded: hw.aotconfig

      $ java -cp HelloWorld.jar -XX:AOTMode=create -XX:AOTCache=hw.aot -XX:AOTConfiguration=hw.aotconfig HelloWorld
      Reading AOTConfiguration hw.aotconfig and writing AOTCache hw.aot
      AOTCache creation is complete: hw.aot 10317824 bytes

      $ java -XX:+UnlockExperimentalVMOptions -XX:+UseGraalJIT -cp HelloWorld.jar -XX:AOTMode=on -XX:AOTCache=hw.aot HelloWorld
      [0.007s][error][aot] An error has occurred while processing the AOT cache. Run with -Xlog:aot for details.
      [0.007s][error][aot] The AOT cache's TypeProfileLevel setting (111) does not equal the current TypeProfileLevel setting (0).
      [0.007s][error][aot] Loading static archive failed.
      [0.007s][error][aot] Unable to map shared spaces
      Error occurred during initialization of VM
      Unable to use AOT cache.

      ====================
      The reverse is also true: AOT cache created with graal jit cannot be used without graal jit

      $ java -XX:+UnlockExperimentalVMOptions -XX:+UseGraalJIT -cp HelloWorld.jar -XX:AOTMode=record -XX:AOTConfiguration=hw.aotconfig HelloWorld
      Hello World
       AOTConfiguration recorded: hw.aotconfig

      $ java -XX:+UnlockExperimentalVMOptions -XX:+UseGraalJIT -cp HelloWorld.jar -XX:AOTMode=create -XX:AOTCache=hw.aot -XX:AOTConfiguration=hw.aotconfig HelloWorld
      Reading AOTConfiguration hw.aotconfig and writing AOTCache hw.aot
      AOTCache creation is complete: hw.aot 10358784 bytes

      $ java -XX:+UnlockExperimentalVMOptions -XX:+UseGraalJIT -cp HelloWorld.jar -XX:AOTMode=on -XX:AOTCache=hw.aot HelloWorld
      Hello World

      $ java -cp HelloWorld.jar -XX:AOTMode=on -XX:AOTCache=hw.aot HelloWorld
      [0.007s][error][aot] An error has occurred while processing the AOT cache. Run with -Xlog:aot for details.
      [0.007s][error][aot] The AOT cache's TypeProfileLevel setting (0) does not equal the current TypeProfileLevel setting (111).
      [0.007s][error][aot] Loading static archive failed.
      [0.007s][error][aot] Unable to map shared spaces
      Error occurred during initialization of VM
      Unable to use AOT cache.

      Note: "-XX:+UnlockExperimentalVMOptions -XX:+UseGraalJIT -Xint" also fails:

      $ java -XX:+UnlockExperimentalVMOptions -XX:+UseGraalJIT -Xint -cp HelloWorld.jar -XX:AOTMode=on -XX:AOTCache=hw.aot HelloWorld
      [0.007s][error][aot] An error has occurred while processing the AOT cache. Run with -Xlog:aot for details.
      [0.007s][error][aot] The AOT cache's TypeProfileLevel setting (0) does not equal the current TypeProfileLevel setting (111).
      [0.007s][error][aot] Loading static archive failed.
      [0.007s][error][aot] Unable to map shared spaces
      Error occurred during initialization of VM
      Unable to use AOT cache.


            kvn Vladimir Kozlov
            iklam Ioi Lam
            Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: