[Wasm] Migrate to the new GC M6 instructions

This commit is contained in:
Zalim Bashorov
2022-11-14 18:05:43 +01:00
parent 838d419a84
commit 2fc6cea681
6 changed files with 29 additions and 45 deletions
@@ -405,7 +405,7 @@ class BodyGenerator(
body.buildStructGet(context.referenceGcType(irBuiltIns.anyClass), WasmSymbol(1))
val classITableReference = context.referenceClassITableGcType(symbol)
body.buildRefCastStatic(classITableReference)
body.buildRefCastNullStatic(classITableReference)
body.buildStructGet(classITableReference, context.referenceClassITableInterfaceSlot(symbol))
val vfSlot = context.getInterfaceMetadata(symbol).methods
@@ -430,7 +430,7 @@ class BodyGenerator(
private fun generateRefCast(fromType: IrType, toType: IrType) {
if (!isDownCastAlwaysSuccessInRuntime(fromType, toType)) {
body.buildRefCastStatic(
body.buildRefCastNullStatic(
toType = context.referenceGcType(toType.getRuntimeClass(irBuiltIns).symbol)
)
}