JVM_IR: do not inline @JvmStatic into their static proxies
This commit is contained in:
@@ -192,8 +192,6 @@ class JvmCachedDeclarations(
|
||||
valueParameters = target.valueParameters.map { it.copyTo(this) }
|
||||
|
||||
body = context.createIrBuilder(symbol).run {
|
||||
// TODO: if the `@JvmStatic` function is inline, this inlines it into the proxy - not great (?)
|
||||
// for something that's supposed to be only relevant for Java compatibility.
|
||||
irExprBody(irCall(target).apply {
|
||||
passTypeArgumentsFrom(this@proxy)
|
||||
if (target.dispatchReceiverParameter != null) {
|
||||
|
||||
+2
-4
@@ -460,10 +460,7 @@ class ExpressionCodegen(
|
||||
addSuspendMarker(mv, isStartNotEnd = true, isSuspensionPoint == SuspensionPointKind.NOT_INLINE)
|
||||
}
|
||||
|
||||
val generatorForActualCall =
|
||||
// Do not inline callee to continuation, instead, call it
|
||||
if (irFunction.isInvokeSuspendOfContinuation()) IrCallGenerator.DefaultCallGenerator else callGenerator
|
||||
generatorForActualCall.genCall(callable, this, expression, isInsideCondition)
|
||||
callGenerator.genCall(callable, this, expression, isInsideCondition)
|
||||
|
||||
val unboxedInlineClassIrType =
|
||||
callee.suspendFunctionOriginal().originalReturnTypeOfSuspendFunctionReturningUnboxedInlineClass()
|
||||
@@ -1351,6 +1348,7 @@ class ExpressionCodegen(
|
||||
): IrCallGenerator {
|
||||
if (!element.symbol.owner.isInlineFunctionCall(context) ||
|
||||
classCodegen.irClass.fileParent.fileEntry is MultifileFacadeFileEntry ||
|
||||
irFunction.origin == JvmLoweredDeclarationOrigin.JVM_STATIC_WRAPPER ||
|
||||
irFunction.isInvokeSuspendOfContinuation()
|
||||
) {
|
||||
return IrCallGenerator.DefaultCallGenerator
|
||||
|
||||
Reference in New Issue
Block a user