diff --git a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/optimizations/DFGBuilder.kt b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/optimizations/DFGBuilder.kt index 3acd2475a13..e92771603a6 100644 --- a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/optimizations/DFGBuilder.kt +++ b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/optimizations/DFGBuilder.kt @@ -499,7 +499,8 @@ internal class ModuleDFGBuilder(val context: Context, val irModule: IrModuleFrag DataFlowIR.Node.NewObject( symbolTable.mapFunction(callee), arguments, - symbolTable.mapClass(callee.constructedClass) + symbolTable.mapClass(callee.constructedClass), + value ) } else { if (callee.isOverridable && value.superQualifier == null) { @@ -532,7 +533,8 @@ internal class ModuleDFGBuilder(val context: Context, val irModule: IrModuleFrag symbolTable.mapFunction(actualCallee), arguments, symbolTable.mapType(actualCallee.returnType!!), - actualCallee.dispatchReceiverParameter?.let { symbolTable.mapType(it.type) } + actualCallee.dispatchReceiverParameter?.let { symbolTable.mapType(it.type) }, + value ) } } @@ -547,7 +549,8 @@ internal class ModuleDFGBuilder(val context: Context, val irModule: IrModuleFrag symbolTable.mapFunction(value.descriptor), arguments.map { expressionToEdge(it) }, symbolTable.mapClass(context.builtIns.unit), - symbolTable.mapType(thiz.type) + symbolTable.mapType(thiz.type), + value ) } diff --git a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/optimizations/DFGSerializer.kt b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/optimizations/DFGSerializer.kt index 561975a1017..02bc5010c5b 100644 --- a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/optimizations/DFGSerializer.kt +++ b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/optimizations/DFGSerializer.kt @@ -864,7 +864,8 @@ internal object DFGSerializer { DataFlowIR.Node.Call( functionSymbols[call.callee], call.arguments.map { deserializeEdge(it) }, - types[call.returnType] + types[call.returnType], + null ) fun deserializeVirtualCall(virtualCall: VirtualCall): DataFlowIR.Node.VirtualCall { @@ -894,12 +895,12 @@ internal object DFGSerializer { val staticCall = it.staticCall!! val call = deserializeCall(staticCall.call) val receiverType = staticCall.receiverType?.let { types[it] } - DataFlowIR.Node.StaticCall(call.callee, call.arguments, call.returnType, receiverType) + DataFlowIR.Node.StaticCall(call.callee, call.arguments, call.returnType, receiverType, null) } NodeType.NEW_OBJECT -> { val call = deserializeCall(it.newObject!!.call) - DataFlowIR.Node.NewObject(call.callee, call.arguments, call.returnType) + DataFlowIR.Node.NewObject(call.callee, call.arguments, call.returnType, null) } NodeType.VTABLE_CALL -> { diff --git a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/optimizations/DataFlowIR.kt b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/optimizations/DataFlowIR.kt index 0ddc4cd706e..4d3f92c239a 100644 --- a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/optimizations/DataFlowIR.kt +++ b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/optimizations/DataFlowIR.kt @@ -17,6 +17,7 @@ import org.jetbrains.kotlin.ir.declarations.IrField import org.jetbrains.kotlin.ir.declarations.IrFunction import org.jetbrains.kotlin.ir.declarations.IrModuleFragment import org.jetbrains.kotlin.ir.expressions.IrCall +import org.jetbrains.kotlin.ir.expressions.IrFunctionAccessExpression import org.jetbrains.kotlin.ir.visitors.IrElementVisitorVoid import org.jetbrains.kotlin.ir.visitors.acceptChildrenVoid import org.jetbrains.kotlin.name.FqName @@ -169,15 +170,19 @@ internal object DataFlowIR { class Const(val type: Type) : Node() - open class Call(val callee: FunctionSymbol, val arguments: List, val returnType: Type) : Node() + open class Call(val callee: FunctionSymbol, val arguments: List, val returnType: Type, + open val callSite: IrFunctionAccessExpression?) : Node() class StaticCall(callee: FunctionSymbol, arguments: List, returnType: Type, - val receiverType: Type?) : Call(callee, arguments, returnType) + val receiverType: Type?, callSite: IrFunctionAccessExpression?) + : Call(callee, arguments, returnType, callSite) - class NewObject(constructor: FunctionSymbol, arguments: List, type: Type) : Call(constructor, arguments, type) + class NewObject(constructor: FunctionSymbol, arguments: List, type: Type, override val callSite: IrCall?) + : Call(constructor, arguments, type, callSite) open class VirtualCall(callee: FunctionSymbol, arguments: List, returnType: Type, - val receiverType: Type, val callSite: IrCall?) : Call(callee, arguments, returnType) + val receiverType: Type, override val callSite: IrCall?) + : Call(callee, arguments, returnType, callSite) class VtableCall(callee: FunctionSymbol, receiverType: Type, val calleeVtableIndex: Int, arguments: List, returnType: Type, callSite: IrCall?)