Switch to the latest GC coding of V8

This commit is contained in:
Volker Berlin 2020-09-26 15:59:57 +02:00
parent 856194dbce
commit ad1ea166dd
5 changed files with 17 additions and 13 deletions

View File

@ -1385,6 +1385,8 @@ public class BinaryModuleWriter extends ModuleWriter implements InstructionOpcod
switch(op) {
case NEW:
case NEW_DEFAULT:
codeStream.writeOpCode( RTT_CANON );
codeStream.writeValueType( type );
opCode = STRUCT_NEW;
break;
case GET:

View File

@ -487,22 +487,22 @@ interface InstructionOpcodes {
static final int TABLE_FILL = 0xFC11;
// === GC opcodes (unofficial, experimental) ===== https://github.com/lars-t-hansen/moz-gc-experiments/blob/master/version2.md
// === GC opcodes
static final int STRUCT_NEW = 0xFC50;
static final int STRUCT_NEW = 0xFB01;
static final int STRUCT_GET = 0xFC51;
static final int STRUCT_GET = 0xFB03;
static final int STRUCT_SET = 0xFC52;
static final int STRUCT_NARROW = 0xFC53;
static final int STRUCT_SET = 0xFB06;
static final int ARRAY_NEW = 0xFC60;
static final int ARRAY_NEW = 0xFB11;
static final int ARRAY_GET = 0xFC61;
static final int ARRAY_GET = 0xFB13;
static final int ARRAY_SET = 0xFC62;
static final int ARRAY_SET = 0xFB16;
static final int ARRAY_LEN = 0xFC63;
static final int ARRAY_LEN = 0xFB17;
static final int RTT_CANON = 0xFB30;
}

View File

@ -137,7 +137,7 @@ class WasmOutputStream extends LittleEndianOutputStream {
}
} else {
writeOpCode( InstructionOpcodes.REF_NULL );
writeValueType( ValueType.externref );
writeValueType( type );
}
}

View File

@ -852,6 +852,8 @@ public class TextModuleWriter extends ModuleWriter {
switch( op ) {
case NEW:
case NEW_DEFAULT:
newline( methodOutput );
methodOutput.append( "rtt.canon" ).append( ' ' ).append( normalizeName( type.toString() ) );
operation = "struct.new";
break;
case GET:

View File

@ -39,7 +39,7 @@ public class StructsGC extends AbstractBaseTest {
@Parameters( name = "{0}-{1}" )
public static Collection<Object[]> data() {
ArrayList<Object[]> list = new ArrayList<>();
ScriptEngine[] engines = { ScriptEngine.SpiderMonkeyGC, ScriptEngine.SpiderMonkeyWatGC, ScriptEngine.NodeJsGC, ScriptEngine.NodeWatGC };
ScriptEngine[] engines = { ScriptEngine.SpiderMonkeyGC, ScriptEngine.SpiderMonkeyWatGC, ScriptEngine.NodeJsGC/*, ScriptEngine.NodeWatGC*/ };
for( ScriptEngine script : engines ) {
addParam( list, script, "isNull" );
addParam( list, script, "isNotNull" );
@ -57,7 +57,7 @@ public class StructsGC extends AbstractBaseTest {
@Test
public void test() {
Assume.assumeFalse( true ); //TODO
Assume.assumeFalse( getScriptEngine().name().startsWith( "SpiderMonkey" ) ); //TODO
super.test();
}