Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a -XX:+UseGraalJIT VM flag #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Add a -XX:+UseGraalJIT VM flag #4

wants to merge 1 commit into from

Conversation

dougxc
Copy link
Owner

@dougxc dougxc commented May 22, 2023

This change adds support for -XX:+UseGraalJIT as a macro VM flag for:

-XX:+UnlockExperimentalVMOptions
-XX:+EnableJVMCIProduct
-XX:+UseJVMCICompiler
-Djvmci.Compiler=graal
-XX:-UnlockExperimentalVMOptions

It allows for a customer to use a supported and branded Graal-compiler based JIT in a JDK product.

I've tested it with a drop-in copy of the libgraal library:

> cp libjvmcicompiler.dylib ~/jdk-jdk/open/build/macosx-aarch64/images/jdk/lib
> ~/jdk-jdk/open/build/macosx-aarch64/images/jdk/bin/java -XX:+UseGraalJIT -Dgraal.ShowConfiguration=info -cp ~/Dropbox/bin CountUppercase
[Use -Dgraal.LogFile=<path> to redirect Graal log output to a file.]
Using "Graal Community compiler with Truffle extensions" loaded from a Native Image shared library
1 (97 ms)
2 (92 ms)
3 (89 ms)
4 (82 ms)
5 (71 ms)
6 (72 ms)
7 (75 ms)
8 (69 ms)
9 (69 ms)
total: 0 (785 ms)

Removing the libgraal library provides a sensible error message:

> rm ~/jdk-jdk/open/build/macosx-aarch64/images/jdk/lib/libjvmcicompiler.dylib
> ~/jdk-jdk/open/build/macosx-aarch64/images/jdk/bin/java -XX:+UseGraalJIT -Dgraal.ShowConfiguration=info -cp ~/Dropbox/bin CountUppercase
JVMCI compiler 'graal' specified by jvmci.Compiler not found

@dougxc dougxc changed the title add UseGraalJIT VM flag Add a -XX:+UseGraalJIT VM flag May 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant