AdoptOpenJDK / jitwatch

Log analyser / visualiser for Java HotSpot JIT compiler. Inspect inlining decisions, hot methods, bytecode, and assembly. View results in the JavaFX user interface.
Other
3.04k stars 435 forks source link

Add compilation flags #376

Closed Ledmington closed 8 months ago

Ledmington commented 10 months ago

Hi, really nice tool! I was using JITWatch to check if some of my hot methods needed manual vectorization with the Vector API and I noticed that I cannot (or it's not clear where and how) pass command-line compile arguments like --add-modules jdk.incubator.vector.

chriswhocodes commented 10 months ago

Hi @Ledmington if you're using the sandbox you can put the --add-modules in the Extra VM switches line of the "Configure Sandbox" section. image

Does that work for you? It's a bit of a hack and I should add some new sections to separate JVM tuning switches, other switches, and program args,

Ledmington commented 9 months ago

Hi there, sorry for the delay. It seems that your suggestion doesn't work. By adding --add-modules jdk.incubator.vector in "Extra VM switches" I get

/tmp/sandbox/sources/SimpleInliningTest.java:1: error: package jdk.incubator.vector is not visible
import jdk.incubator.vector.DoubleVector;
                    ^
  (package jdk.incubator.vector is declared in module jdk.incubator.vector, which is not in the module graph)
/tmp/sandbox/sources/SimpleInliningTest.java:2: error: package jdk.incubator.vector is not visible
import jdk.incubator.vector.VectorSpecies;
                    ^
  (package jdk.incubator.vector is declared in module jdk.incubator.vector, which is not in the module graph)
2 errors

It seems that it cannot compile my file since that flag is needed both for compilation and for execution, while the "Extra VM switches" section is only for runtime flags.

chriswhocodes commented 8 months ago

Thank you, I've merged your patch and added you to the project authors :)