Skip to content

Commit 6f34cc0

Browse files
committed
moved Graal options to jdk.graal prefix
1 parent abe7097 commit 6f34cc0

File tree

60 files changed

+334
-309
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+334
-309
lines changed

compiler/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
This changelog summarizes newly introduced optimizations and other compiler related changes.
44

55
## GraalVM for JDK 22 (Internal Version 24.0.0)
6+
* (GR-49960): The Graal options now use the `jdk.graal.` prefix (e.g. `-Djdk.graal.PrintCompilation=true`).
7+
The legacy `graal.` prefix is deprecated but still supported (e.g. `-Dgraal.PrintCompilation=true`).
68
* (GR-49610): The Graal module has been renamed from `jdk.internal.vm.compiler` to `jdk.graal.compiler`.
79
Likewise, the compiler packages moved into the `jdk.graal.compiler` namespace.
810
These renamings were done in preparation for [Project Galahad](https://openjdk.org/projects/galahad/).

compiler/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ You should wait for the GUI to appear before running the second command.
101101

102102
```bash
103103
$ $GRAALVM_EE_HOME/bin/idealgraphvisualizer &
104-
mx unittest -Dgraal.Dump BC_athrow0
104+
mx unittest -Djdk.graal.Dump BC_athrow0
105105
```
106106

107107
If you added `-XX:+UseJVMCICompiler` as described above, you will see IR for compilations requested by the VM itself in addition to compilations requested by the unit test.
@@ -122,7 +122,7 @@ complicate fine tuning options such as `-Xmx` and `-Xms` which now need to take
122122
heap usage of the compiler into account. Secondly, the compiler will initially be executed
123123
in the interpreter and only get faster over time as its hot methods are JIT
124124
compiled. This is mitigated to some degree by forcing the GraalVM compiler
125-
to only be compiled by C1 (i.e., `-Dgraal.CompileGraalWithC1Only=true`) but this comes at the cost
125+
to only be compiled by C1 (i.e., `-Djdk.graal.CompileGraalWithC1Only=true`) but this comes at the cost
126126
of slower compilation speed.
127127

128128
To address these issues, the GraalVM compiler can be deployed as a native shared library. The shared

compiler/ci/ci_common/compiler-common.libsonnet

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
"--jvm=${JVM}",
7575
"--jvm-config=${JVM_CONFIG}",
7676
"-XX:+PrintConcurrentLocks",
77-
"-Dgraal.CompilationFailureAction=Diagnose",
77+
"-Djdk.graal.CompilationFailureAction=Diagnose",
7878
"-XX:+CITime"] +
7979
self.min_heap_size +
8080
self.max_heap_size,

compiler/ci/ci_common/gate.jsonnet

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"--kill-with-sigquit",
4343
"gate",
4444
"--strict-mode",
45-
"--extra-vm-argument=-Dgraal.DumpOnError=true -Dgraal.PrintGraphFile=true -Dgraal.PrintBackendCFG=true" +
45+
"--extra-vm-argument=-Djdk.graal.DumpOnError=true -Djdk.graal.PrintGraphFile=true -Djdk.graal.PrintBackendCFG=true" +
4646
(if extra_vm_args == "" then "" else " " + extra_vm_args)
4747
] + (if extra_unittest_args != "" then [
4848
"--extra-unittest-argument=" + extra_unittest_args,
@@ -102,9 +102,9 @@
102102

103103
test_javabase:: s.base("build,javabasetest"),
104104
test_jtt_phaseplan_fuzzing:: s.base("build,phaseplan-fuzz-jtt-tests"),
105-
test_vec16:: s.base(extra_vm_args="-Dgraal.DetailedAsserts=true -XX:MaxVectorSize=16"),
106-
test_avx0:: s.base(extra_vm_args="-Dgraal.ForceAdversarialLayout=true", jvm_config_suffix="-avx0"),
107-
test_avx1:: s.base(extra_vm_args="-Dgraal.ForceAdversarialLayout=true", jvm_config_suffix="-avx1"),
105+
test_vec16:: s.base(extra_vm_args="-Djdk.graal.DetailedAsserts=true -XX:MaxVectorSize=16"),
106+
test_avx0:: s.base(extra_vm_args="-Djdk.graal.ForceAdversarialLayout=true", jvm_config_suffix="-avx0"),
107+
test_avx1:: s.base(extra_vm_args="-Djdk.graal.ForceAdversarialLayout=true", jvm_config_suffix="-avx1"),
108108

109109
# Runs truffle tests in a mode similar to HotSpot's -Xcomp option
110110
# (i.e. compile immediately without background compilation).
@@ -143,7 +143,7 @@
143143
ctw:: s.base("build,ctw", no_warning_as_error=true),
144144
ctw_zgc:: s.base("build,ctw", no_warning_as_error=true, extra_vm_args="-XX:+UseZGC"),
145145

146-
ctw_economy:: s.base("build,ctweconomy", extra_vm_args="-Dgraal.CompilerConfiguration=economy"),
146+
ctw_economy:: s.base("build,ctweconomy", extra_vm_args="-Djdk.graal.CompilerConfiguration=economy"),
147147
ctw_phaseplan_fuzzing:: s.base("build,ctwphaseplanfuzzing"),
148148

149149
# Runs some benchmarks as tests
@@ -154,7 +154,7 @@
154154
bootstrap_lite:: s.base("build,bootstraplite", no_warning_as_error=true),
155155
bootstrap_full:: s.base("build,bootstrapfullverify", no_warning_as_error=true),
156156
bootstrap_full_zgc:: s.base("build,bootstrapfullverify", no_warning_as_error=true, extra_vm_args="-XX:+UseZGC"),
157-
bootstrap_economy:: s.base("build,bootstrapeconomy", no_warning_as_error=true, extra_vm_args="-Dgraal.CompilerConfiguration=economy"),
157+
bootstrap_economy:: s.base("build,bootstrapeconomy", no_warning_as_error=true, extra_vm_args="-Djdk.graal.CompilerConfiguration=economy"),
158158

159159
style:: c.deps.eclipse + c.deps.jdt + s.base("style,fullbuild,javadoc"),
160160

compiler/docs/CompilationPlanFuzzing.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ It is possible to fix some parameters of the creation of fuzzed compilation plan
145145
* `mx phaseplan-fuzz-jtt-tests HP_life`
146146
* `mx gate --extra-unittest-argument='HP_life' --tags phaseplan-fuzz-jtt-tests`
147147
- If you want to use the phases of a specific compiler configuration and respect its requirements, you should use:
148-
* `-Dgraal.CompilerConfiguration=<config>`
148+
* `-Djdk.graal.CompilerConfiguration=<config>`
149149

150150
#### Load a phase plan
151151
You can load a phase plan (one created by a fuzzed compilation plan or any other phase plan serialized using the `PhasePlanSerializer`) using the command:
@@ -169,5 +169,5 @@ These commands will make each thread create a new fuzzed compilation plan for ea
169169
#### Load a phase plan
170170
It is possible to load a phase plan (one created by a fuzzed compilation plan or any other phase plan serialized using the `PhasePlanSerializer`) and use it for the compilation of a method by using the command:
171171
```
172-
mx gate --extra-vm-argument='-DCompileTheWorld.LoadPhasePlan=/path/to/phaseplan' --extra-vm-argument='-DCompileTheWorld.MethodFilter=<methodName>' --extra-vm-argument='-Dgraal.CompilerConfiguration=<config>' --tags ctw
172+
mx gate --extra-vm-argument='-DCompileTheWorld.LoadPhasePlan=/path/to/phaseplan' --extra-vm-argument='-DCompileTheWorld.MethodFilter=<methodName>' --extra-vm-argument='-Djdk.graal.CompilerConfiguration=<config>' --tags ctw
173173
```

compiler/docs/Debugging.md

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,12 @@ try (Scope s = debug.scope("CodeInstall", method)) {
5353
```
5454

5555
The `debug.log` statement will send output to the console if `CodeInstall` is matched by the
56-
`-Dgraal.Log` option. The matching logic for this option is implemented in
56+
`-Djdk.graal.Log` option. The matching logic for this option is implemented in
5757
[DebugFilter](../src/jdk.graal.compiler/src/jdk/graal/compiler/debug/DebugFilter.java)
5858
and documented in the
5959
[Dump help message](../src/jdk.graal.compiler/src/jdk/graal/compiler/debug/doc-files/DumpHelp.txt). As
60-
mentioned in the javadoc, the same matching logic also applies to the `-Dgraal.Dump`,
61-
`-Dgraal.Time`, `-Dgraal.Count` and `-Dgraal.TrackMemUse` options.
60+
mentioned in the javadoc, the same matching logic also applies to the `-Djdk.graal.Dump`,
61+
`-Djdk.graal.Time`, `-Djdk.graal.Count` and `-Djdk.graal.TrackMemUse` options.
6262

6363
Since `DebugContext` objects are thread local, they need to be passed around as parameters. For
6464
convenience, they may be available from objects such as a `Graph` or a `Node` but care needs to be
@@ -78,9 +78,9 @@ obtained with `-XX:+JVMCIPrintProperties`.
7878
The compiler supports metrics in the form of counters, timers and memory trackers.
7979
Each metric has a unique name. Metrics are collected per-compilation.
8080
At shutdown, they are aggregated across all compilations and reported to the console.
81-
This ouput can be redirected to a file via the `-Dgraal.AggregatedMetricsFile` option.
81+
This ouput can be redirected to a file via the `-Djdk.graal.AggregatedMetricsFile` option.
8282

83-
To list the per-compilation metrics, use the `-Dgraal.MetricsFile` option. If not specified,
83+
To list the per-compilation metrics, use the `-Djdk.graal.MetricsFile` option. If not specified,
8484
per-compilation metrics are not reported.
8585

8686
Metrics are represented in the code via fields or variables of type `CounterKey`, `TimerKey` or `MemUseTrackerKey`.
@@ -136,11 +136,11 @@ CompilationMemory_Accm=100000 bytes
136136
CompilationMemory_Flat=1000 bytes
137137
```
138138

139-
For both the `-Dgraal.AggregatedMetricsFile` and the `-Dgraal.MetricsFile` option, the output format
139+
For both the `-Djdk.graal.AggregatedMetricsFile` and the `-Djdk.graal.MetricsFile` option, the output format
140140
is determined by the file name suffix. A `.csv` suffix produces a semi-colon separated format that
141141
is amenable to automatic data processing.
142142

143-
The columns in the `-Dgraal.MetricsFile` CSV output are:
143+
The columns in the `-Djdk.graal.MetricsFile` CSV output are:
144144
* **compilable**: A textual label such as the fully qualified name of the method being compiled.
145145
For Truffle compilations, this will be a name describing the guest language function/method being compiled.
146146
* **compilable_identity**: The identity hash code of the **compilable**. This is useful when the
@@ -156,7 +156,7 @@ but its identity will.
156156
* **metric_value**: The metric value being reported.
157157
* **metric_unit**: The unit of measurement for the value being reported. This will be the empty string for a counter.
158158

159-
Example `-Dgraal.MetricsFile` output:
159+
Example `-Djdk.graal.MetricsFile` output:
160160
```
161161
java.lang.String.hashCode()int;1272077530;0;HotSpotCompilation-95;PhaseNodes_PhaseSuite;1
162162
java.lang.String.hashCode()int;1272077530;0;HotSpotCompilation-95;PhaseNodes_GraphBuilderPhase;1
@@ -167,12 +167,12 @@ java.lang.String.hashCode()int;1272077530;0;HotSpotCompilation-95;PhaseTime_Grap
167167
java.lang.String.hashCode()int;1272077530;0;HotSpotCompilation-95;PhaseTime_GraphBuilderPhase_Flat;27724000
168168
```
169169

170-
The columns in the `-Dgraal.AggregatedMetricsFile` CSV output are:
170+
The columns in the `-Djdk.graal.AggregatedMetricsFile` CSV output are:
171171
* **metric_name**: The name of the metric being reported.
172172
* **metric_value**: The metric value being reported.
173173
* **metric_unit**: The unit of measurement for the value being reported. This will be the empty string for a counter.
174174

175-
Example `-Dgraal.AggregatedMetricsFile` output:
175+
Example `-Djdk.graal.AggregatedMetricsFile` output:
176176
```
177177
AllocationsRemoved;6446;
178178
BackEnd_Accm;7931303;us
@@ -183,30 +183,30 @@ LIRPhaseMemUse_AllocationStage_Accm;499763160;bytes
183183
LIRPhaseMemUse_AllocationStage_Flat;17354112;bytes
184184
```
185185

186-
Note that `-Dgraal.MetricsFile` produces per-compilation output, not per-method output.
186+
Note that `-Djdk.graal.MetricsFile` produces per-compilation output, not per-method output.
187187
If a method is compiled multiple times, post-processing of the CSV output will be required
188188
to obtain per-method metric values.
189189

190190
## Method filtering
191191

192-
Specifying one of the debug scope options (i.e., `-Dgraal.Log`, `-Dgraal.Dump`, `-Dgraal.Count`,
193-
`-Dgraal.Time`, or `-Dgraal.TrackMemUse`) can generate a lot of output. Typically, you are only
192+
Specifying one of the debug scope options (i.e., `-Djdk.graal.Log`, `-Djdk.graal.Dump`, `-Djdk.graal.Count`,
193+
`-Djdk.graal.Time`, or `-Djdk.graal.TrackMemUse`) can generate a lot of output. Typically, you are only
194194
interesting in compiler output related to a single or few methods. In this case, use the
195-
`-Dgraal.MethodFilter` option to specify a method filter. The matching logic for this option is
195+
`-Djdk.graal.MethodFilter` option to specify a method filter. The matching logic for this option is
196196
described in
197197
[MethodFilter](../src/jdk.graal.compiler/src/jdk/graal/compiler/debug/MethodFilter.java#L33-L92)
198198
and documented in the
199199
[MethodFilter help message](../src/jdk.graal.compiler/src/jdk/graal/compiler/debug/doc-files/MethodFilterHelp.txt).
200200

201201
## Metric filtering
202202

203-
Alternatively, you may only want to see certain metrics. The `-Dgraal.Timers`, `-Dgraal.Counters`
204-
and `-Dgraal.MemUseTrackers` exist for this purpose. These options take a comma separated list of
203+
Alternatively, you may only want to see certain metrics. The `-Djdk.graal.Timers`, `-Djdk.graal.Counters`
204+
and `-Djdk.graal.MemUseTrackers` exist for this purpose. These options take a comma separated list of
205205
metrics names. Only the named metrics will be activated and reported. To see the available metric
206-
names, specify `-Dgraal.ListMetrics=true`. At VM shutdown this option lists all the metrics that
206+
names, specify `-Djdk.graal.ListMetrics=true`. At VM shutdown this option lists all the metrics that
207207
were encountered during the VM execution. It does not list metrics registered on non-executed paths
208208
since metric registration is lazy. For example, to see all the metrics available in a boot strap:
209-
``` mx vm -XX:+UseJVMCICompiler -XX:+BootstrapJVMCI -Dgraal.ListMetrics=true -version ```
209+
``` mx vm -XX:+UseJVMCICompiler -XX:+BootstrapJVMCI -Djdk.graal.ListMetrics=true -version ```
210210

211211
## Dumping
212212

@@ -218,19 +218,19 @@ visualizations of certain compiler data structures. Currently, there is support
218218
[Ideal Graph Visualizer (IGV)](../../docs/tools/ideal-graph-visualizer.md), and
219219
* LIR register allocation and generated code to the [C1Visualizer](https://github.com/zakkak/c1visualizer)
220220

221-
Dumping is enabled via the `-Dgraal.Dump` option. The dump handler for generating C1Visualizer
222-
output will also generate output for LIR graphs if the `-Dgraal.PrintBackendCFG=true` option is specified
223-
(in addition to the `-Dgraal.Dump` option).
221+
Dumping is enabled via the `-Djdk.graal.Dump` option. The dump handler for generating C1Visualizer
222+
output will also generate output for LIR graphs if the `-Djdk.graal.PrintBackendCFG=true` option is specified
223+
(in addition to the `-Djdk.graal.Dump` option).
224224

225-
By default, `-Dgraal.Dump` output is written to the local file system in a directory determined
226-
by the `-Dgraal.DumpPath` option (default is `$CWD/graal_dumps`). You can send dumps directly to
227-
the IGV over a network socket with the `-Dgraal.PrintGraph=Network` option. The `-Dgraal.PrintGraphHost`
228-
and `-Dgraal.PrintGraphPort` options determine where the dumps are sent. By default, they are
225+
By default, `-Djdk.graal.Dump` output is written to the local file system in a directory determined
226+
by the `-Djdk.graal.DumpPath` option (default is `$CWD/graal_dumps`). You can send dumps directly to
227+
the IGV over a network socket with the `-Djdk.graal.PrintGraph=Network` option. The `-Djdk.graal.PrintGraphHost`
228+
and `-Djdk.graal.PrintGraphPort` options determine where the dumps are sent. By default, they are
229229
sent to _127.0.0.1:4445_ and IGV listens on port 4445 by default.
230230

231231
By default, the graph dumping code dumps every graph at a particular level even if the graph hasn't
232232
changed since the previous dump. Internally the compiler tracks when changes are made to the edges
233-
of the graph and setting the flag `-Dgraal.PrintUnmodifiedGraphs=false` will cause it to elide graph
233+
of the graph and setting the flag `-Djdk.graal.PrintUnmodifiedGraphs=false` will cause it to elide graph
234234
dumps when no edges have changed since the previous dump. This can greatly reduce the number of
235235
graphs dumped at high dump levels, though the resulting output can be a little harder to understand
236236
without the context of the other graph names.
@@ -243,15 +243,15 @@ The IGV can be launched with `mx igv` and the C1Visualizer can be launched via `
243243

244244
Various other VM options are of interest to see activity related to compilation:
245245

246-
- `-XX:+PrintCompilation` or `-Dgraal.PrintCompilation=true` for notification and brief info about each compilation
246+
- `-XX:+PrintCompilation` or `-Djdk.graal.PrintCompilation=true` for notification and brief info about each compilation
247247
- `-XX:+TraceDeoptimization` can be useful to see if excessive compilation is occurring
248248

249249
## Examples
250250
#### Inspecting the compilation of a single method
251251

252252
To see the compiler data structures used while compiling `Node.updateUsages`, use the following command:
253253
```
254-
> mx vm -XX:+UseJVMCICompiler -XX:+BootstrapJVMCI -XX:-TieredCompilation -Dgraal.Dump= -Dgraal.MethodFilter=Node.updateUsages -version
254+
> mx vm -XX:+UseJVMCICompiler -XX:+BootstrapJVMCI -XX:-TieredCompilation -Djdk.graal.Dump= -Djdk.graal.MethodFilter=Node.updateUsages -version
255255
Bootstrapping JVMCI....Dumping debug output in /Users/dsimon/graal/graal/compiler/dumps/1497910458736
256256
................................................ in 38177 ms (compiled 5206 methods)
257257
java version "1.8.0_212"
@@ -262,12 +262,12 @@ dumps/1497910458736/HotSpotCompilation-539[jdk.graal.compiler.graph.Node.updateU
262262
dumps/1497910458736/HotSpotCompilation-539[jdk.graal.compiler.graph.Node.updateUsages(Node, Node)].cfg
263263
```
264264

265-
As you become familiar with the scope names used in the compiler, you can refine the `-Dgraal.Dump` option
265+
As you become familiar with the scope names used in the compiler, you can refine the `-Djdk.graal.Dump` option
266266
to limit the amount of dump output generated. For example, the `"CodeGen"` and `"CodeInstall"`
267267
scopes are active during code generation and installation respectively. To see the machine code (in
268268
the C1Visualizer) produced during these scopes:
269269
```
270-
mx vm -Dgraal.Dump=CodeGen,CodeInstall -Dgraal.MethodFilter=NodeClass.get -version
270+
mx vm -Djdk.graal.Dump=CodeGen,CodeInstall -Djdk.graal.MethodFilter=NodeClass.get -version
271271
```
272272
You will notice that no IGV output is generated by this command.
273273

compiler/docs/JMH.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ If you want to run a Truffle JMH benchmark, try:
2323

2424
```
2525
cd compiler
26-
mx benchmark truffle:JMH_1_21 -- -Dgraal.CompileGraalWithC1Only=false -- BenchmarkName
26+
mx benchmark truffle:JMH_1_21 -- -Djdk.graal.CompileGraalWithC1Only=false -- BenchmarkName
2727
```
2828

2929
If you do not know or want to learn more, continue reading.

0 commit comments

Comments
 (0)