[K/N][optmz] Fixed a minor bug with DataFlowIR

Because of the bug, hanging (detached from the graph) NewObject nodes
would be created. The escape analysis algorithm then happily would
decide to allocate them on the stack, thus spoiling the statistics
about actual percentage of objects allocated on the stack.
This commit is contained in:
Igor Chevdar
2022-10-31 08:47:12 +02:00
committed by Space Team
parent 72615ee845
commit 8a03313818
@@ -309,6 +309,15 @@ internal class ModuleDFGBuilder(val context: Context, val irModule: IrModuleFrag
expressions += expression to currentLoop
}
if (expression is IrCall && expression.symbol == initInstanceSymbol) {
// Skip the constructor call as initInstance is handled specially later.
val thiz = expression.getValueArgument(0)!!
val constructorCall = expression.getValueArgument(1)!!
thiz.acceptVoid(this)
constructorCall.acceptChildrenVoid(this)
return
}
if (expression is IrCall && expression.symbol == executeImplSymbol) {
// Producer and job of executeImpl are called externally, we need to reflect this somehow.
val producerInvocation = IrCallImpl.fromSymbolDescriptor(expression.startOffset, expression.endOffset,