mirror of
https://github.com/i-net-software/JWebAssembly.git
synced 2025-03-14 18:43:27 +01:00
Add support for Wat instruction struct.set
This commit is contained in:
parent
d9e78ef414
commit
4a802a8b15
@ -291,6 +291,8 @@ public class WatParser extends WasmCodeBuilder {
|
||||
i = addMemoryInstruction( MemoryOperator.load8_u, ValueType.i32, tokens, i, lineNumber );
|
||||
break;
|
||||
case "struct.get":
|
||||
case "struct.set":
|
||||
StructOperator op = "struct.get".equals( tok ) ? StructOperator.GET : StructOperator.SET;
|
||||
String typeName = get( tokens, ++i );
|
||||
String fieldName = get( tokens, ++i );
|
||||
NamedStorageType fieldNameType = null;
|
||||
@ -306,7 +308,7 @@ public class WatParser extends WasmCodeBuilder {
|
||||
if( fieldNameType == null ) {
|
||||
fieldNameType = new NamedStorageType( ValueType.externref, "", fieldName );
|
||||
}
|
||||
addStructInstruction( StructOperator.GET, typeName, fieldNameType, javaCodePos, lineNumber );
|
||||
addStructInstruction( op, typeName, fieldNameType, javaCodePos, lineNumber );
|
||||
break;
|
||||
case "array.len":
|
||||
typeName = get( tokens, ++i );
|
||||
|
Loading…
x
Reference in New Issue
Block a user