Controlling JVMCI-triggered compilation
Doug Simon
doug.simon at oracle.com
Thu Oct 20 13:42:04 UTC 2016
> On 20 Oct 2016, at 14:41, Andrew Haley <aph at redhat.com> wrote:
>
> Maybe there's some documentation for this, but...
>
> How do I control which methods are JVMCI-compiled?
Mostly, the CompileBroker controls this, just like it does for C2. That said, there are some differences:
http://hg.openjdk.java.net/jdk9/hs/hotspot/file/204391ad6da1/src/share/vm/runtime/advancedThresholdPolicy.cpp#l233
http://hg.openjdk.java.net/jdk9/hs/hotspot/file/204391ad6da1/src/share/vm/runtime/advancedThresholdPolicy.cpp#l403
http://hg.openjdk.java.net/jdk9/hs/hotspot/file/204391ad6da1/src/share/vm/compiler/compileBroker.cpp#l933
http://hg.openjdk.java.net/jdk9/hs/hotspot/file/204391ad6da1/src/share/vm/runtime/thread.cpp#l3778
These are mostly related to the fact that JVMCI is (mostly) executing Java code.
In addition, the graal.CompileGraalWithC1Only[1] and graal.GraalCompileOnly[2] properties can be used to restrict what is compiled by Graal. By default, Graal itself is compiled by C1.
[1] https://github.com/graalvm/graal-core/blob/master/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotGraalCompilerFactory.java#L110
[2] https://github.com/graalvm/graal-core/blob/master/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotGraalCompilerFactory.java#L116
>
> How do I control the logs?
JVMCI and Graal don’t participate much in -XX:+LogCompilation due to the fact it's a C++ based mechanism that’s hard to use from Java. Instead there are properties you can set such as -Dgraal.PrintCompilation=true and -Dgraal.Log=InliningDecisions that generate various output. We also rely heavily on the Ideal Graph Visualizer. Generating output for IGV and some other logging/tracing options are described in https://github.com/graalvm/graal-core/blob/master/docs/Debugging.md.
If there’s something in particular you are after, please let me know and I’ll give you the best options we have for it.
> Maybe there's some documentation of all this kind of stuff
> somewhere?
There some information under https://github.com/graalvm/graal-core/blob/master/docs for a start and we plan on adding more over time. Input as to what would be most useful is always welcome!
-Doug
More information about the graal-dev
mailing list