Skip to content

Commit 2b8324d

Browse files
committed
[GR-68301] GraalWasm gates still use legacy GraalVM components.
PullRequest: graal/21725
2 parents 7ee70e4 + f6bf07e commit 2b8324d

File tree

2 files changed

+35
-12
lines changed

2 files changed

+35
-12
lines changed

wasm/mx.wasm/mx_wasm.py

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484

8585
def get_jdk(forBuild=False):
8686
if not forBuild and mx.suite('compiler', fatalIfMissing=False):
87-
return mx.get_jdk(tag='jvmci')
87+
return mx.get_jdk(tag='graalvm')
8888
else:
8989
return mx.get_jdk()
9090

@@ -125,24 +125,28 @@ def wabt_test_args():
125125

126126

127127
def graal_wasm_gate_runner(args, tasks):
128+
unittest_args = []
129+
if mx.suite('compiler', fatalIfMissing=False) is not None:
130+
unittest_args = ["--use-graalvm"]
131+
128132
with Task("BuildAll", tasks, tags=[GraalWasmDefaultTags.buildall]) as t:
129133
if t:
130134
mx.build(["--all"])
131135

132136
with Task("UnitTests", tasks, tags=[GraalWasmDefaultTags.wasmtest], report=True) as t:
133137
if t:
134-
unittest([*wabt_test_args(), "WasmTestSuite"], test_report_tags={'task': t.title})
135-
unittest([*wabt_test_args(), "-Dwasmtest.sharedEngine=true", "WasmTestSuite"], test_report_tags={'task': t.title})
138+
unittest(unittest_args + [*wabt_test_args(), "WasmTestSuite"], test_report_tags={'task': t.title})
139+
unittest(unittest_args + [*wabt_test_args(), "-Dwasmtest.sharedEngine=true", "WasmTestSuite"], test_report_tags={'task': t.title})
136140

137141
with Task("ExtraUnitTests", tasks, tags=[GraalWasmDefaultTags.wasmextratest], report=True) as t:
138142
if t:
139-
unittest(["--suite", "wasm", "CSuite", "WatSuite"], test_report_tags={'task': t.title})
143+
unittest(unittest_args + ["--suite", "wasm", "CSuite", "WatSuite"], test_report_tags={'task': t.title})
140144

141145
with Task("CoverageTests", tasks, tags=[GraalWasmDefaultTags.coverage], report=True) as t:
142146
if t:
143-
unittest([*wabt_test_args(), "-Dwasmtest.coverageMode=true", "WasmTestSuite"], test_report_tags={'task': t.title})
144-
unittest([*wabt_test_args(), "-Dwasmtest.coverageMode=true", "-Dwasmtest.sharedEngine=true", "WasmTestSuite"], test_report_tags={'task': t.title})
145-
unittest(["-Dwasmtest.coverageMode=true", "--suite", "wasm", "CSuite", "WatSuite"], test_report_tags={'task': t.title})
147+
unittest(unittest_args + [*wabt_test_args(), "-Dwasmtest.coverageMode=true", "WasmTestSuite"], test_report_tags={'task': t.title})
148+
unittest(unittest_args + [*wabt_test_args(), "-Dwasmtest.coverageMode=true", "-Dwasmtest.sharedEngine=true", "WasmTestSuite"], test_report_tags={'task': t.title})
149+
unittest(unittest_args + ["-Dwasmtest.coverageMode=true", "--suite", "wasm", "CSuite", "WatSuite"], test_report_tags={'task': t.title})
146150

147151
# This is a gate used to test that all the benchmarks return the correct results. It does not upload anything,
148152
# and does not run on a dedicated machine.
@@ -187,6 +191,12 @@ def apply(self, config):
187191
mainClassArgs += ['-JUnitOpenPackages', 'org.graalvm.wasm/*=com.oracle.truffle.wasm.debugtests']
188192
return (vmArgs, mainClass, mainClassArgs)
189193

194+
def processDeps(self, deps):
195+
super().processDeps(deps)
196+
truffle_runtime_dist_names = mx_truffle.resolve_truffle_dist_names(use_optimized_runtime=True, use_enterprise=True)
197+
mx.logv(f"Adding Truffle runtime distributions {', '.join(truffle_runtime_dist_names)} to unittest dependencies.")
198+
deps.update((mx.distribution(d) for d in truffle_runtime_dist_names))
199+
190200

191201
mx_unittest.register_unittest_config(WasmUnittestConfig())
192202

@@ -658,7 +668,7 @@ def wasm(args, **kwargs):
658668
mx_truffle.enable_sun_misc_unsafe(vmArgs)
659669

660670
path_args = mx.get_runtime_jvm_args([
661-
"TRUFFLE_API",
671+
*mx_truffle.resolve_truffle_dist_names(use_optimized_runtime=True, use_enterprise=True),
662672
"WASM",
663673
"WASM_LAUNCHER",
664674
] + (['tools:CHROMEINSPECTOR', 'tools:TRUFFLE_PROFILER', 'tools:INSIGHT'] if mx.suite('tools', fatalIfMissing=False) is not None else []))

wasm/src/org.graalvm.wasm.test/src/org/graalvm/wasm/test/WasmFileSuite.java

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,16 @@ public abstract class WasmFileSuite extends AbstractWasmSuite {
116116
private static final int INITIAL_STATE_CHECK_ITERATIONS = 10;
117117
private static final int STATE_CHECK_PERIODICITY = 2000;
118118

119-
private static Map<String, String> getInterpretedNoInline() {
119+
private static boolean isFallbackRuntime() {
120+
return Truffle.getRuntime().getName().equals("Interpreted");
121+
}
122+
123+
private static Map<String, String> getInterpreted() {
124+
if (isFallbackRuntime()) {
125+
return Map.of();
126+
}
120127
return Map.ofEntries(
121-
Map.entry("engine.Compilation", "false"),
122-
Map.entry("compiler.Inlining", "false"));
128+
Map.entry("engine.Compilation", "false"));
123129
}
124130

125131
private static Map<String, String> getSyncCompiledNoInline() {
@@ -148,6 +154,9 @@ private static Map<String, String> getAsyncCompiled() {
148154
}
149155

150156
private static Map<String, String> getAsyncCompiledShared() {
157+
if (isFallbackRuntime()) {
158+
return Map.of();
159+
}
151160
return getAsyncCompiled();
152161
}
153162

@@ -406,9 +415,13 @@ private void runInContexts(WasmCase testCase, Context.Builder contextBuilder, Ar
406415
interpreterIterations = Math.min(interpreterIterations, 1);
407416
}
408417

409-
context = contextBuilder.options(getInterpretedNoInline()).option("wasm.EvalReturnsInstance", "true").build();
418+
context = contextBuilder.options(getInterpreted()).option("wasm.EvalReturnsInstance", "true").build();
410419
runInContext(testCase, context, sources, interpreterIterations, PHASE_INTERPRETER_ICON, "interpreter", testOut);
411420

421+
if (isFallbackRuntime()) {
422+
return;
423+
}
424+
412425
// Run in synchronous compiled mode, with inlining turned off.
413426
// We need to run the test at least twice like this, since the first run will lead to
414427
// de-opts due to empty profiles.

0 commit comments

Comments
 (0)