Skip to content

Commit 1b64928

Browse files
committed
Allow WasmFileSuite to be run with the fallback runtime.
1 parent b887c36 commit 1b64928

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

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)