[Wasm] Revert ref cast and test instructions to be compatible with Binaryen
This commit is contained in:
@@ -179,8 +179,8 @@ class WasmSymbols(
|
||||
val refEq = getInternalFunction("wasm_ref_eq")
|
||||
val refIsNull = getInternalFunction("wasm_ref_is_null")
|
||||
val externRefIsNull = getInternalFunction("wasm_externref_is_null")
|
||||
val refTest = getInternalFunction("wasm_ref_test")
|
||||
val refCastNull = getInternalFunction("wasm_ref_cast_null")
|
||||
val refTest = getInternalFunction("wasm_ref_test_deprecated")
|
||||
val refCastNull = getInternalFunction("wasm_ref_cast_deprecated")
|
||||
val wasmArrayCopy = getInternalFunction("wasm_array_copy")
|
||||
val wasmArrayNewData0 = getInternalFunction("array_new_data0")
|
||||
|
||||
|
||||
+1
-1
@@ -492,7 +492,7 @@ class BodyGenerator(
|
||||
body.buildBlock("isInterface", WasmRefNullType(WasmHeapType.Simple.Data)) { innerLabel ->
|
||||
body.buildGetLocal(parameterLocal)
|
||||
body.buildStructGet(context.referenceGcType(irBuiltIns.anyClass), WasmSymbol(1))
|
||||
body.buildBrInstr(WasmOp.BR_ON_CAST_FAIL, innerLabel, classITable)
|
||||
body.buildBrInstr(WasmOp.BR_ON_CAST_FAIL_DEPRECATED, innerLabel, classITable)
|
||||
body.buildStructGet(classITable, context.referenceClassITableInterfaceSlot(irInterface.symbol))
|
||||
body.buildInstr(WasmOp.REF_IS_NULL)
|
||||
body.buildInstr(WasmOp.I32_EQZ)
|
||||
|
||||
Reference in New Issue
Block a user