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