mirror of
https://github.com/i-net-software/JWebAssembly.git
synced 2025-03-25 07:27:52 +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
|
return "local.get 1" // THIS
|
||||||
+ " local.get 3" // x
|
+ " local.get 3" // x
|
||||||
+ " struct.set " + state.typeName + ' ' + state.fieldName;
|
+ " 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 );
|
throw new RuntimeException( name.signatureName );
|
||||||
|
@ -337,6 +337,11 @@ public class WatParser extends WasmCodeBuilder {
|
|||||||
typeName = get( tokens, ++i );
|
typeName = get( tokens, ++i );
|
||||||
addStructInstruction( StructOperator.NEW_WITH_RTT, typeName, null, javaCodePos, lineNumber );
|
addStructInstruction( StructOperator.NEW_WITH_RTT, typeName, null, javaCodePos, lineNumber );
|
||||||
break;
|
break;
|
||||||
|
case "array.get":
|
||||||
|
typeName = get( tokens, ++i );
|
||||||
|
type = ((ArrayType)getTypeManager().valueOf( typeName )).getArrayType();
|
||||||
|
addArrayInstruction( ArrayOperator.GET, type, javaCodePos, lineNumber );
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
throw new WasmException( "Unknown WASM token: " + tok, lineNumber );
|
throw new WasmException( "Unknown WASM token: " + tok, lineNumber );
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user