mirror of
https://github.com/i-net-software/JWebAssembly.git
synced 2025-03-14 18:43:27 +01:00
implements Unsafe.getObjectVolatile
This commit is contained in:
parent
ef2720537d
commit
bb20f0dbc2
@ -549,6 +549,11 @@ class UnsafeManager {
|
||||
return "local.get 1" // THIS
|
||||
+ " local.get 3" // x
|
||||
+ " struct.set " + state.typeName + ' ' + state.fieldName;
|
||||
|
||||
case "getObjectVolatile":
|
||||
return "local.get 1" // array
|
||||
+ " local.get 2" // the array index
|
||||
+ " array.get " + state.typeName;
|
||||
}
|
||||
|
||||
throw new RuntimeException( name.signatureName );
|
||||
|
@ -337,6 +337,11 @@ public class WatParser extends WasmCodeBuilder {
|
||||
typeName = get( tokens, ++i );
|
||||
addStructInstruction( StructOperator.NEW_WITH_RTT, typeName, null, javaCodePos, lineNumber );
|
||||
break;
|
||||
case "array.get":
|
||||
typeName = get( tokens, ++i );
|
||||
type = ((ArrayType)getTypeManager().valueOf( typeName )).getArrayType();
|
||||
addArrayInstruction( ArrayOperator.GET, type, javaCodePos, lineNumber );
|
||||
break;
|
||||
default:
|
||||
throw new WasmException( "Unknown WASM token: " + tok, lineNumber );
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user