Skip to content

Commit fce3b3a

Browse files
committed
Remove __testutil_save_binary_file built-in function.
1 parent db151e9 commit fce3b3a

File tree

5 files changed

+2
-169
lines changed

5 files changed

+2
-169
lines changed

wasm/mx.wasm/mx_wasm.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ def graal_wasm_gate_runner(args, tasks):
135135
exitcode = mx_benchmark.benchmark([
136136
"wasm:WASM_BENCHMARKCASES", "--",
137137
"--jvm", "server", "--jvm-config", "graal-core",
138-
"-Dwasmbench.benchmarkName=" + b, "-Dwasmtest.keepTempFiles=true", "--",
138+
"-Dwasmbench.benchmarkName=" + b, "--",
139139
"CMicroBenchmarkSuite", "-wi", "1", "-i", "1"])
140140
if exitcode != 0:
141141
mx.abort("Errors during benchmark tests, aborting.")

wasm/scripts/run-c-micro-benchmarks

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ do
1616
"--results-file=${RESULTS_FILE_PATH}" \
1717
wasm:WASM_BENCHMARKCASES -- \
1818
--jvm ${VM} --jvm-config ${VM_CONFIG} \
19-
-Dwasmbench.benchmarkName=$benchmark -Dwasmtest.keepTempFiles=true -- \
19+
-Dwasmbench.benchmarkName=$benchmark -- \
2020
CMicroBenchmarkSuite
2121

2222
${UPLOAD_CMD} "${RESULTS_FILE_PATH}"

wasm/src/org.graalvm.wasm/src/org/graalvm/wasm/predefined/emscripten/EmscriptenModule.java

-11
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,11 @@
4444
import static org.graalvm.wasm.WasmType.I32_TYPE;
4545

4646
import org.graalvm.wasm.WasmContext;
47-
import org.graalvm.wasm.WasmInstance;
4847
import org.graalvm.wasm.WasmLanguage;
4948
import org.graalvm.wasm.WasmModule;
5049
import org.graalvm.wasm.WasmType;
5150
import org.graalvm.wasm.constants.GlobalModifier;
5251
import org.graalvm.wasm.predefined.BuiltinModule;
53-
import org.graalvm.wasm.predefined.testutil.TestutilModule;
5452
import org.graalvm.wasm.predefined.wasi.WasiFdWriteNode;
5553

5654
public class EmscriptenModule extends BuiltinModule {
@@ -59,15 +57,6 @@ public class EmscriptenModule extends BuiltinModule {
5957
protected WasmModule createModule(WasmLanguage language, WasmContext context, String name) {
6058
final WasmModule module = WasmModule.createBuiltin(name);
6159

62-
final WasmInstance testutil = context.lookupModuleInstance("testutil");
63-
if (testutil != null) {
64-
// Emscripten only allows extern symbols through the 'env' module, so we need to
65-
// re-export some symbols from the testutil module.
66-
if (testutil.symbolTable().function(TestutilModule.Names.SAVE_BINARY_FILE) != null) {
67-
importFunction(context, module, "testutil", TestutilModule.Names.SAVE_BINARY_FILE, types(I32_TYPE, I32_TYPE, I32_TYPE), types(), TestutilModule.Names.SAVE_BINARY_FILE);
68-
}
69-
}
70-
7160
defineFunction(context, module, "abort", types(), types(), new AbortNode(language, module));
7261
defineFunction(context, module, "abortOnCannotGrowMemory", types(I32_TYPE), types(I32_TYPE), new AbortOnCannotGrowMemoryNode(language, module));
7362
defineFunction(context, module, "segfault", types(), types(), new SegfaultNode(language, module));

wasm/src/org.graalvm.wasm/src/org/graalvm/wasm/predefined/testutil/SaveBinaryFileNode.java

-125
This file was deleted.

wasm/src/org.graalvm.wasm/src/org/graalvm/wasm/predefined/testutil/TestutilModule.java

-31
Original file line numberDiff line numberDiff line change
@@ -40,56 +40,25 @@
4040
*/
4141
package org.graalvm.wasm.predefined.testutil;
4242

43-
import static org.graalvm.wasm.WasmType.I32_TYPE;
44-
45-
import java.io.IOException;
46-
import java.nio.file.Files;
47-
import java.nio.file.Path;
48-
import java.nio.file.Paths;
49-
5043
import org.graalvm.wasm.WasmContext;
5144
import org.graalvm.wasm.WasmLanguage;
5245
import org.graalvm.wasm.WasmModule;
5346
import org.graalvm.wasm.predefined.BuiltinModule;
5447

5548
public class TestutilModule extends BuiltinModule {
5649

57-
public static class Options {
58-
static final String KEEP_TEMP_FILES = System.getProperty("wasmtest.keepTempFiles", "false");
59-
}
60-
6150
public static class Names {
6251
public static final String RUN_CUSTOM_INITIALIZATION = "__testutil_run_custom_initialization";
63-
public static final String SAVE_BINARY_FILE = "__testutil_save_binary_file";
64-
}
65-
66-
private static Path createTemporaryDirectory() {
67-
try {
68-
if (Options.KEEP_TEMP_FILES.equals("true")) {
69-
final Path directory = Paths.get("./test-output/");
70-
directory.toFile().mkdirs();
71-
return directory;
72-
} else {
73-
final Path tempDirectory = Files.createTempDirectory("temp-dir-");
74-
tempDirectory.toFile().deleteOnExit();
75-
return tempDirectory;
76-
}
77-
} catch (IOException e) {
78-
throw new RuntimeException(e);
79-
}
8052
}
8153

8254
@Override
8355
protected WasmModule createModule(WasmLanguage language, WasmContext context, String name) {
84-
final Path temporaryDirectory = createTemporaryDirectory();
8556
WasmModule module = WasmModule.createBuiltin(name);
8657

8758
// Note: in the following methods, the types are not important here, since these methods
8859
// are not accessed by Wasm code.
8960
defineFunction(context, module, Names.RUN_CUSTOM_INITIALIZATION, types(), types(), new RunCustomInitializationNode(language, module));
9061

91-
// The following methods are exposed to the Wasm test programs.
92-
defineFunction(context, module, Names.SAVE_BINARY_FILE, types(I32_TYPE, I32_TYPE, I32_TYPE), types(), new SaveBinaryFileNode(language, module, temporaryDirectory));
9362
return module;
9463
}
9564
}

0 commit comments

Comments
 (0)