mirror of
https://github.com/i-net-software/JWebAssembly.git
synced 2025-03-15 02:44:47 +01:00
add script engine SpiderMonkeyWatGC
This commit is contained in:
parent
5437ed54ed
commit
88b925fbde
@ -28,6 +28,7 @@ public enum ScriptEngine {
|
||||
SpiderMonkeyWat,
|
||||
Wat2Wasm,
|
||||
SpiderMonkeyGC,
|
||||
SpiderMonkeyWatGC,
|
||||
;
|
||||
|
||||
public static ScriptEngine[] testEngines() {
|
||||
|
@ -1,5 +1,5 @@
|
||||
load( "spiderMonkey.wasm.js" );
|
||||
var wasm = wasmTextToBinary( read( "spiderMonkey.wat" ) );
|
||||
load( "{test}.wasm.js" );
|
||||
var wasm = wasmTextToBinary( read( "{test}.wat" ) );
|
||||
var testData = JSON.parse( read( "testdata.json" ) );
|
||||
|
||||
function callExport(instance) {
|
||||
|
@ -70,6 +70,8 @@ public class WasmRule extends TemporaryFolder {
|
||||
|
||||
private File spiderMonkeyScriptGC;
|
||||
|
||||
private File spiderMonkeyScriptWatGC;
|
||||
|
||||
private File nodeWatScript;
|
||||
|
||||
private File spiderMonkeyWatScript;
|
||||
@ -405,6 +407,8 @@ public class WasmRule extends TemporaryFolder {
|
||||
return spiderMonkeyCommand( false, false );
|
||||
case SpiderMonkeyGC:
|
||||
return spiderMonkeyCommand( true, true );
|
||||
case SpiderMonkeyWatGC:
|
||||
return spiderMonkeyCommand( false, true );
|
||||
case NodeJS:
|
||||
return nodeJsCommand( nodeScript );
|
||||
case NodeWat:
|
||||
@ -495,28 +499,39 @@ public class WasmRule extends TemporaryFolder {
|
||||
try {
|
||||
System.setProperty( "SpiderMonkey", "true" );
|
||||
if( gc ) {
|
||||
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() );
|
||||
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() );
|
||||
}
|
||||
script = spiderMonkeyScriptGC;
|
||||
} 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" );
|
||||
}
|
||||
script = spiderMonkeyScriptWatGC;
|
||||
}
|
||||
script = spiderMonkeyScriptGC;
|
||||
|
||||
} else if( binary ) {
|
||||
if( spiderMonkeyScript == null ) {
|
||||
File file = newFile( "spiderMonkey.wasm" );
|
||||
compiler.compileToBinary( file );
|
||||
spiderMonkeyScript = createScript( "SpiderMonkeyTest.js", "{test.wasm}", file.getName() );
|
||||
}
|
||||
script = spiderMonkeyScript;
|
||||
} else {
|
||||
if( spiderMonkeyWatScript == null ) {
|
||||
File file = newFile( "spiderMonkey.wat" );
|
||||
compiler.compileToText( file );
|
||||
spiderMonkeyWatScript = createScript( "SpiderMonkeyWatTest.js", "{test.wat}", file.getName() );
|
||||
if( binary ) {
|
||||
if( spiderMonkeyScript == null ) {
|
||||
File file = newFile( "spiderMonkey.wasm" );
|
||||
compiler.compileToBinary( file );
|
||||
spiderMonkeyScript = createScript( "SpiderMonkeyTest.js", "{test.wasm}", file.getName() );
|
||||
}
|
||||
script = spiderMonkeyScript;
|
||||
} else {
|
||||
if( spiderMonkeyWatScript == null ) {
|
||||
File file = newFile( "spiderMonkey.wat" );
|
||||
compiler.compileToText( file );
|
||||
spiderMonkeyWatScript = createScript( "SpiderMonkeyWatTest.js", "{test}", "spiderMonkey" );
|
||||
}
|
||||
script = spiderMonkeyWatScript;
|
||||
}
|
||||
script = spiderMonkeyWatScript;
|
||||
}
|
||||
} finally {
|
||||
compiler.setProperty( JWebAssembly.WASM_USE_GC, null );
|
||||
|
Loading…
x
Reference in New Issue
Block a user