mirror of
https://github.com/i-net-software/JWebAssembly.git
synced 2025-03-15 02:44:47 +01:00
generalize the use of the flag useGC
This commit is contained in:
parent
ff5b8f8442
commit
dd01ad10b2
@ -27,10 +27,20 @@ public enum ScriptEngine {
|
||||
NodeWat,
|
||||
SpiderMonkeyWat,
|
||||
Wat2Wasm,
|
||||
SpiderMonkeyGC,
|
||||
SpiderMonkeyWatGC,
|
||||
SpiderMonkeyGC(true),
|
||||
SpiderMonkeyWatGC(true),
|
||||
;
|
||||
|
||||
public final String useGC;
|
||||
|
||||
private ScriptEngine() {
|
||||
this.useGC = null;
|
||||
}
|
||||
|
||||
private ScriptEngine( boolean useGC ) {
|
||||
this.useGC = Boolean.toString( useGC );
|
||||
}
|
||||
|
||||
public static ScriptEngine[] testEngines() {
|
||||
ScriptEngine[] val = { //
|
||||
SpiderMonkey, //
|
||||
|
@ -485,6 +485,7 @@ public class WasmRule extends TemporaryFolder {
|
||||
writeJsonTestData( Collections.singletonMap( methodName, params ) );
|
||||
}
|
||||
|
||||
compiler.setProperty( JWebAssembly.WASM_USE_GC, script.useGC );
|
||||
processBuilder = createCommand( script );
|
||||
processBuilder.directory( getRoot() );
|
||||
Process process = processBuilder.start();
|
||||
@ -540,7 +541,6 @@ public class WasmRule extends TemporaryFolder {
|
||||
if( binary ) {
|
||||
if( spiderMonkeyScriptGC == null ) {
|
||||
File file = newFile( "spiderMonkeyGC.wasm" );
|
||||
compiler.setProperty( JWebAssembly.WASM_USE_GC, "true" );
|
||||
compiler.compileToBinary( file );
|
||||
spiderMonkeyScriptGC = createScript( "SpiderMonkeyTest.js", "{test.wasm}", file.getName() );
|
||||
}
|
||||
@ -548,7 +548,6 @@ public class WasmRule extends TemporaryFolder {
|
||||
} else {
|
||||
if( spiderMonkeyScriptWatGC == null ) {
|
||||
File file = newFile( "spiderMonkeyGC.wat" );
|
||||
compiler.setProperty( JWebAssembly.WASM_USE_GC, "true" );
|
||||
compiler.compileToText( file );
|
||||
spiderMonkeyScriptWatGC = createScript( "SpiderMonkeyWatTest.js", "{test}", "spiderMonkeyGC" );
|
||||
}
|
||||
@ -572,7 +571,6 @@ public class WasmRule extends TemporaryFolder {
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
compiler.setProperty( JWebAssembly.WASM_USE_GC, null );
|
||||
System.clearProperty( "SpiderMonkey" );
|
||||
}
|
||||
ProcessBuilder process = new ProcessBuilder( spiderMonkey.getCommand(), script.getAbsolutePath() );
|
||||
|
Loading…
x
Reference in New Issue
Block a user