[Wasm] Apply recent changes in TFR proposal and update v8

Type index immediate was added to call_ref and return_call_ref instructions.
More details here https://github.com/WebAssembly/function-references/pull/76
This commit is contained in:
Zalim Bashorov
2022-11-01 19:22:21 +01:00
parent 9ed94b25fa
commit d29010807a
4 changed files with 8 additions and 7 deletions
@@ -396,7 +396,7 @@ class BodyGenerator(
body.buildStructGet(context.referenceGcType(klass.symbol), WasmSymbol(0))
body.buildStructGet(context.referenceVTableGcType(klass.symbol), WasmSymbol(vfSlot))
body.buildInstr(WasmOp.CALL_REF)
body.buildInstr(WasmOp.CALL_REF, WasmImmediate.TypeIdx(context.referenceFunctionType(function.symbol)))
} else {
val symbol = klass.symbol
if (symbol in hierarchyDisjointUnions) {
@@ -412,7 +412,7 @@ class BodyGenerator(
.indexOfFirst { it.function == function }
body.buildStructGet(context.referenceVTableGcType(symbol), WasmSymbol(vfSlot))
body.buildInstr(WasmOp.CALL_REF)
body.buildInstr(WasmOp.CALL_REF, WasmImmediate.TypeIdx(context.referenceFunctionType(function.symbol)))
} else {
body.buildUnreachable()
}
@@ -877,4 +877,3 @@ class BodyGenerator(
return false
}
}