[Wasm] Require location for buildGetGlobal and fix all usages
This commit is contained in:
+3
-3
@@ -189,7 +189,7 @@ class BodyGenerator(
|
|||||||
generateInstanceFieldAccess(field)
|
generateInstanceFieldAccess(field)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
body.buildGetGlobal(context.referenceGlobalField(field.symbol))
|
body.buildGetGlobal(context.referenceGlobalField(field.symbol), expression.getSourceLocation())
|
||||||
body.commentPreviousInstr { "type: ${field.type.render()}" }
|
body.commentPreviousInstr { "type: ${field.type.render()}" }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -300,9 +300,9 @@ class BodyGenerator(
|
|||||||
private fun generateAnyParameters(klassSymbol: IrClassSymbol, location: SourceLocation) {
|
private fun generateAnyParameters(klassSymbol: IrClassSymbol, location: SourceLocation) {
|
||||||
//ClassITable and VTable load
|
//ClassITable and VTable load
|
||||||
body.commentGroupStart { "Any parameters" }
|
body.commentGroupStart { "Any parameters" }
|
||||||
body.buildGetGlobal(context.referenceGlobalVTable(klassSymbol))
|
body.buildGetGlobal(context.referenceGlobalVTable(klassSymbol), location)
|
||||||
if (klassSymbol.owner.hasInterfaceSuperClass()) {
|
if (klassSymbol.owner.hasInterfaceSuperClass()) {
|
||||||
body.buildGetGlobal(context.referenceGlobalClassITable(klassSymbol))
|
body.buildGetGlobal(context.referenceGlobalClassITable(klassSymbol), location)
|
||||||
} else {
|
} else {
|
||||||
body.buildRefNull(WasmHeapType.Simple.Data)
|
body.buildRefNull(WasmHeapType.Simple.Data)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -137,8 +137,8 @@ abstract class WasmExpressionBuilder {
|
|||||||
buildInstr(WasmOp.LOCAL_SET, location, WasmImmediate.LocalIdx(local))
|
buildInstr(WasmOp.LOCAL_SET, location, WasmImmediate.LocalIdx(local))
|
||||||
}
|
}
|
||||||
|
|
||||||
fun buildGetGlobal(global: WasmSymbol<WasmGlobal>) {
|
fun buildGetGlobal(global: WasmSymbol<WasmGlobal>, location: SourceLocation) {
|
||||||
buildInstr(WasmOp.GLOBAL_GET, WasmImmediate.GlobalIdx(global))
|
buildInstr(WasmOp.GLOBAL_GET, location, WasmImmediate.GlobalIdx(global))
|
||||||
}
|
}
|
||||||
|
|
||||||
fun buildSetGlobal(global: WasmSymbol<WasmGlobal>) {
|
fun buildSetGlobal(global: WasmSymbol<WasmGlobal>) {
|
||||||
|
|||||||
Reference in New Issue
Block a user