Skip to content

Commit 9cd6174

Browse files
committed
[GR-69187] Dump replay statistics and refactor replay launcher.
PullRequest: graal/22369
2 parents 7dd9538 + b9a1f77 commit 9cd6174

File tree

5 files changed

+241
-78
lines changed

5 files changed

+241
-78
lines changed

compiler/mx.compiler/mx_compiler.py

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1582,23 +1582,26 @@ def profdiff(args):
15821582
vm_args = ['-cp', cp, 'org.graalvm.profdiff.Profdiff'] + args
15831583
return jdk.run_java(args=vm_args)
15841584

1585-
def replaycomp_vm_args():
1586-
"""Returns the VM arguments required to run the replay compilation launcher."""
1587-
vm_args = [
1585+
def replaycomp_vm_args(distributions):
1586+
"""Returns the VM arguments required to run the replay compilation launcher.
1587+
1588+
:param distributions the distributions to add to the classpath
1589+
:return the list of VM arguments
1590+
"""
1591+
return [
15881592
'-XX:-UseJVMCICompiler',
15891593
'--enable-native-access=org.graalvm.truffle',
15901594
'--add-exports=java.base/jdk.internal.module=ALL-UNNAMED',
1591-
'-Djdk.graal.CompilationFailureAction=Print'
1595+
'-Djdk.graal.CompilationFailureAction=Print',
1596+
'-cp',
1597+
mx.classpath(distributions, jdk=jdk),
15921598
]
1593-
_, dists = mx.defaultDependencies(opt_limit_to_suite=True)
1594-
dists = [d for d in dists if d.isJARDistribution() and os.path.exists(d.classpath_repr(resolve=False))]
1595-
return mx.get_runtime_jvm_args(dists) + vm_args
15961599

15971600
def replaycomp_main_class():
15981601
"""Returns the main class name for the replay compilation launcher."""
15991602
return 'jdk.graal.compiler.hotspot.replaycomp.test.ReplayCompilationLauncher'
16001603

1601-
def replaycomp(args):
1604+
def replaycomp(args, distributions = 'GRAAL_TEST'):
16021605
"""Runs the replay compilation launcher with the provided launcher and VM arguments."""
16031606
extra_vm_args = []
16041607
launcher_args = []
@@ -1615,7 +1618,7 @@ def replaycomp(args):
16151618
])
16161619
else:
16171620
launcher_args.append(arg)
1618-
return run_vm([*replaycomp_vm_args(), *extra_vm_args, replaycomp_main_class(), *launcher_args], nonZeroIsFatal=False)
1621+
return run_vm([*replaycomp_vm_args(distributions), *extra_vm_args, replaycomp_main_class(), *launcher_args], nonZeroIsFatal=False)
16191622

16201623
def igvutil(args):
16211624
"""various utilities to inspect and modify IGV graphs"""

compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/hotspot/replaycomp/test/ReplayCompilationLauncher.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ public class ReplayCompilationLauncher {
4242
static {
4343
ModuleSupport.exportAndOpenAllPackagesToUnnamed("jdk.graal.compiler");
4444
ModuleSupport.exportAndOpenAllPackagesToUnnamed("jdk.internal.vm.ci");
45-
ModuleSupport.exportAndOpenAllPackagesToUnnamed("org.graalvm.truffle.runtime");
45+
ModuleSupport.exportAndOpenAllPackagesToUnnamed("org.graalvm.truffle.runtime", false);
46+
ModuleSupport.exportAndOpenAllPackagesToUnnamed("org.graalvm.truffle.compiler", false);
4647
}
4748

4849
/**

compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/hotspot/replaycomp/test/ReplayCompilationTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ public void recordAndExecuteReplayRunner() throws Throwable {
144144
Path replayFile = findReplayCompFile(temp.path);
145145
String[][] argumentLists = new String[][]{
146146
new String[]{"--compare-graphs=true", replayFile.toString()},
147-
new String[]{"--compare-graphs=false", "--benchmark=true", "--iterations=1", temp.path.toString()}
147+
new String[]{"--compare-graphs=false", temp.path.toString(), "--benchmark", "--iterations=1"}
148148
};
149149
for (String[] arguments : argumentLists) {
150150
ReplayCompilationRunner.ExitStatus status = ReplayCompilationRunner.run(arguments, TTY.out().out());

0 commit comments

Comments
 (0)