From 99eab5a0582b37754478297bf7f7cde4978d6706 Mon Sep 17 00:00:00 2001 From: pyos Date: Mon, 30 Dec 2019 11:46:03 +0100 Subject: [PATCH] IR: unify 3 copies of function body remapping Also, 1. remove some redundant copies; 2. fix remapping of non-local returns in lambdas if the body is moved after LocalDeclarationsLowering (the lambda is no longer inside the body, but must still be visited) --- .../kotlin/backend/common/ir/IrInlineUtils.kt | 72 ++++++++++++++----- .../kotlin/backend/common/ir/IrUtils.kt | 41 ----------- .../common/lower/ArrayConstructorLowering.kt | 7 +- .../jvm/lower/AddContinuationLowering.kt | 11 +-- .../backend/jvm/lower/AssertionLowering.kt | 6 +- .../jvm/lower/CallableReferenceLowering.kt | 33 +-------- .../backend/jvm/lower/InterfaceLowering.kt | 15 ++-- .../lower/StaticDefaultFunctionLowering.kt | 20 +++--- .../fromInterfaceDefaultGetter.kt | 16 +++++ .../BlackBoxInlineCodegenTestGenerated.java | 5 ++ ...otlinAgainstInlineKotlinTestGenerated.java | 5 ++ .../IrBlackBoxInlineCodegenTestGenerated.java | 5 ++ ...otlinAgainstInlineKotlinTestGenerated.java | 5 ++ .../IrNonLocalReturnsTestGenerated.java | 5 ++ .../NonLocalReturnsTestGenerated.java | 5 ++ 15 files changed, 120 insertions(+), 131 deletions(-) create mode 100644 compiler/testData/codegen/boxInline/nonLocalReturns/fromInterfaceDefaultGetter.kt diff --git a/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/ir/IrInlineUtils.kt b/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/ir/IrInlineUtils.kt index cb23885cd72..4cbfeda267b 100644 --- a/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/ir/IrInlineUtils.kt +++ b/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/ir/IrInlineUtils.kt @@ -6,13 +6,14 @@ package org.jetbrains.kotlin.backend.common.ir import org.jetbrains.kotlin.backend.common.lower.VariableRemapper -import org.jetbrains.kotlin.ir.declarations.IrFunction -import org.jetbrains.kotlin.ir.declarations.IrSimpleFunction -import org.jetbrains.kotlin.ir.declarations.IrValueDeclaration +import org.jetbrains.kotlin.ir.IrStatement +import org.jetbrains.kotlin.ir.declarations.* import org.jetbrains.kotlin.ir.expressions.* import org.jetbrains.kotlin.ir.expressions.impl.IrReturnImpl import org.jetbrains.kotlin.ir.expressions.impl.IrReturnableBlockImpl +import org.jetbrains.kotlin.ir.symbols.IrReturnTargetSymbol import org.jetbrains.kotlin.ir.symbols.impl.IrReturnableBlockSymbolImpl +import org.jetbrains.kotlin.ir.util.deepCopyWithSymbols import org.jetbrains.kotlin.ir.util.isVararg import org.jetbrains.kotlin.ir.util.statements @@ -36,21 +37,56 @@ fun IrExpression.asSimpleLambda(): IrSimpleFunction? { return function } +private fun createParameterMapping(source: IrFunction, target: IrFunction): Map { + val sourceParameters = listOfNotNull(source.dispatchReceiverParameter, source.extensionReceiverParameter) + source.valueParameters + val targetParameters = listOfNotNull(target.dispatchReceiverParameter, target.extensionReceiverParameter) + target.valueParameters + assert(sourceParameters.size == targetParameters.size) + return sourceParameters.zip(targetParameters).toMap() +} + +fun IrFunction.copyBodyTo(target: IrFunction): IrBody? = + copyBodyTo(target, createParameterMapping(this, target)) + +fun IrFunction.copyBodyTo(target: IrFunction, arguments: Map): IrBody? = + body?.deepCopyWithSymbols(target)?.move(this, target, target.symbol, arguments) + +fun IrFunction.moveBodyTo(target: IrFunction): IrBody? = + moveBodyTo(target, createParameterMapping(this, target)) + +fun IrFunction.moveBodyTo(target: IrFunction, arguments: Map): IrBody? = + body?.move(this, target, target.symbol, arguments) + +private fun IrBody.move( + source: IrFunction, + target: IrDeclarationParent, + targetSymbol: IrReturnTargetSymbol, + arguments: Map +): IrBody = transform(object : VariableRemapper(arguments) { + override fun visitReturn(expression: IrReturn): IrExpression = super.visitReturn( + if (expression.returnTargetSymbol == source.symbol) + IrReturnImpl(expression.startOffset, expression.endOffset, expression.type, targetSymbol, expression.value) + else + expression + ) + + override fun visitBlock(expression: IrBlock): IrExpression { + // Might be an inline lambda argument; if the function has already been moved out, visit it explicitly. + if (expression.origin == IrStatementOrigin.LAMBDA || expression.origin == IrStatementOrigin.ANONYMOUS_FUNCTION) + if (expression.statements[0] !is IrFunction && expression.statements[1] is IrFunctionReference) + (expression.statements[1] as IrFunctionReference).symbol.owner.transformChildrenVoid() + return super.visitBlock(expression) + } + + override fun visitDeclaration(declaration: IrDeclaration): IrStatement { + if (declaration.parent == source) + declaration.parent = target + return super.visitDeclaration(declaration) + } +}, null) + // TODO use a generic inliner (e.g. JS/Native's FunctionInlining.Inliner) // Inline simple function calls without type parameters, default parameters, or varargs. -fun IrFunction.inline(arguments: List = listOf()): IrReturnableBlock { - require(body != null) - val argumentMap = valueParameters.zip(arguments).toMap() - val blockSymbol = IrReturnableBlockSymbolImpl(descriptor) - val block = IrReturnableBlockImpl(startOffset, endOffset, returnType, blockSymbol, null, symbol) - val remapper = object : VariableRemapper(argumentMap) { - override fun visitReturn(expression: IrReturn): IrExpression = super.visitReturn( - if (expression.returnTargetSymbol == symbol) - IrReturnImpl(expression.startOffset, expression.endOffset, expression.type, blockSymbol, expression.value) - else - expression - ) +fun IrFunction.inline(target: IrDeclarationParent, arguments: List = listOf()): IrReturnableBlock = + IrReturnableBlockImpl(startOffset, endOffset, returnType, IrReturnableBlockSymbolImpl(descriptor), null, symbol).apply { + statements += body!!.move(this@inline, target, symbol, valueParameters.zip(arguments).toMap()).statements } - body!!.statements.mapTo(block.statements) { it.transform(remapper, null) } - return block -} diff --git a/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/ir/IrUtils.kt b/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/ir/IrUtils.kt index fe05a6e7564..698cf505b33 100644 --- a/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/ir/IrUtils.kt +++ b/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/ir/IrUtils.kt @@ -598,46 +598,5 @@ fun createStaticFunctionWithReceivers( } } -fun copyBodyToStatic(oldFunction: IrFunction, staticFunction: IrFunction) { - val mapping: Map = - (listOfNotNull(oldFunction.dispatchReceiverParameter, oldFunction.extensionReceiverParameter) + oldFunction.valueParameters) - .zip(staticFunction.valueParameters).toMap() - copyBodyWithParametersMapping(staticFunction, oldFunction, mapping) -} - -fun copyBodyWithParametersMapping( - newFunction: IrFunction, - oldFunction: IrFunction, - mapping: Map -) { - newFunction.body = oldFunction.body?.deepCopyWithSymbols(oldFunction) - ?.transform( - object : IrElementTransformerVoid() { - // Remap return targets to the static method so they do not appear to be - // non-local returns. - override fun visitReturn(expression: IrReturn): IrExpression { - expression.transformChildrenVoid(this); - return if (expression.returnTargetSymbol == oldFunction.symbol) { - IrReturnImpl( - expression.startOffset, - expression.endOffset, - expression.type, - newFunction.symbol, - expression.value - ) - } else expression - } - - // Remap argument values. - override fun visitGetValue(expression: IrGetValue): IrExpression = - mapping[expression.symbol.owner]?.let { - IrGetValueImpl(expression.startOffset, expression.endOffset, it.type, it.symbol, expression.origin) - } ?: expression - - }, null - ) - ?.patchDeclarationParents(newFunction) -} - val IrSymbol.isSuspend: Boolean get() = this is IrSimpleFunctionSymbol && owner.isSuspend diff --git a/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/lower/ArrayConstructorLowering.kt b/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/lower/ArrayConstructorLowering.kt index d983d89f83c..2aef8fd25d7 100644 --- a/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/lower/ArrayConstructorLowering.kt +++ b/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/lower/ArrayConstructorLowering.kt @@ -23,7 +23,6 @@ import org.jetbrains.kotlin.ir.types.getClass import org.jetbrains.kotlin.ir.util.constructedClass import org.jetbrains.kotlin.ir.util.constructors import org.jetbrains.kotlin.ir.util.functions -import org.jetbrains.kotlin.ir.util.patchDeclarationParents import org.jetbrains.kotlin.ir.visitors.transformChildrenVoid import org.jetbrains.kotlin.util.OperatorNameConventions @@ -84,7 +83,7 @@ class ArrayConstructorLowering(val context: CommonBackendContext) : IrElementTra } body = irBlock { val tempIndex = irTemporary(irGet(index)) - val value = lambda?.inline(listOf(tempIndex)) ?: irCallOp( + val value = lambda?.inline(parent, listOf(tempIndex)) ?: irCallOp( invoke.symbol, invoke.returnType, irGet(invokableVar!!), @@ -100,10 +99,6 @@ class ArrayConstructorLowering(val context: CommonBackendContext) : IrElementTra } } +irGet(result) - }.also { - // Some parents of local declarations are not updated during ad-hoc inlining - // TODO: Remove when generic inliner is used - it.patchDeclarationParents(scope.getLocalDeclarationParent()) } } } diff --git a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/AddContinuationLowering.kt b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/AddContinuationLowering.kt index e9fc902c841..5a01825687a 100644 --- a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/AddContinuationLowering.kt +++ b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/AddContinuationLowering.kt @@ -221,13 +221,6 @@ private class AddContinuationLowering(private val context: JvmBackendContext) : }) } - private fun IrFunction.copyBodyFrom(oldFunction: IrFunction) { - val mapping: Map = - (listOfNotNull(oldFunction.dispatchReceiverParameter, oldFunction.extensionReceiverParameter) + oldFunction.valueParameters) - .zip(listOfNotNull(dispatchReceiverParameter, extensionReceiverParameter) + valueParameters).toMap() - copyBodyWithParametersMapping(this, oldFunction, mapping) - } - private fun IrDeclarationContainer.addFunctionOverride( function: IrSimpleFunction, modality: Modality = Modality.FINAL @@ -517,7 +510,7 @@ private class AddContinuationLowering(private val context: JvmBackendContext) : origin = JvmLoweredDeclarationOrigin.SUSPEND_IMPL_STATIC_FUNCTION, copyMetadata = false ) - copyBodyToStatic(irFunction, static) + static.body = irFunction.moveBodyTo(static) // Rewrite the body of the original suspend method to forward to the new static method. irFunction.body = context.createIrBuilder(irFunction.symbol).irBlockBody { +irReturn(irCall(static).also { @@ -568,7 +561,7 @@ private class AddContinuationLowering(private val context: JvmBackendContext) : dispatchReceiverParameter = function.dispatchReceiverParameter?.copyTo(this) extensionReceiverParameter = function.extensionReceiverParameter?.copyTo(this) function.valueParameters.mapTo(valueParameters) { it.copyTo(this) } - copyBodyFrom(function) + body = function.copyBodyTo(this) copyAttributes(function) } registerNewFunction(function.parentAsClass, newFunction) diff --git a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/AssertionLowering.kt b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/AssertionLowering.kt index 9aa5b120953..680d09a00c6 100644 --- a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/AssertionLowering.kt +++ b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/AssertionLowering.kt @@ -67,10 +67,6 @@ private class AssertionLowering(private val context: JvmBackendContext) : // to be false, meaning that assertions are checked. info.assertionsDisabledField?.let { declaration.declarations.add(0, it) - - // Some parents of local declarations are not updated during ad-hoc inlining - // TODO: Remove when generic inliner is used - declaration.patchDeclarationParents(declaration.parent) } return declaration @@ -112,7 +108,7 @@ private class AssertionLowering(private val context: JvmBackendContext) : putValueArgument( 0, when { - lambda != null -> lambda.inline() + lambda != null -> lambda.inline(parent) lambdaArgument != null -> { val invoke = lambdaArgument.type.getClass()!!.functions.single { it.name == OperatorNameConventions.INVOKE } diff --git a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/CallableReferenceLowering.kt b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/CallableReferenceLowering.kt index 3703b51ad47..c2b20181555 100644 --- a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/CallableReferenceLowering.kt +++ b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/CallableReferenceLowering.kt @@ -10,6 +10,7 @@ import org.jetbrains.kotlin.backend.common.IrElementTransformerVoidWithContext import org.jetbrains.kotlin.backend.common.ir.copyTo import org.jetbrains.kotlin.backend.common.ir.createImplicitParameterDeclarationWithWrappedDescriptor import org.jetbrains.kotlin.backend.common.ir.isSuspend +import org.jetbrains.kotlin.backend.common.ir.moveBodyTo import org.jetbrains.kotlin.backend.common.lower.createIrBuilder import org.jetbrains.kotlin.backend.common.phaser.makeIrFilePhase import org.jetbrains.kotlin.backend.jvm.JvmBackendContext @@ -20,7 +21,6 @@ import org.jetbrains.kotlin.backend.jvm.ir.irArray import org.jetbrains.kotlin.backend.jvm.ir.isLambda import org.jetbrains.kotlin.descriptors.Modality import org.jetbrains.kotlin.descriptors.Visibilities -import org.jetbrains.kotlin.ir.IrStatement import org.jetbrains.kotlin.ir.UNDEFINED_OFFSET import org.jetbrains.kotlin.ir.builders.* import org.jetbrains.kotlin.ir.builders.declarations.* @@ -32,7 +32,6 @@ import org.jetbrains.kotlin.ir.expressions.impl.IrFunctionReferenceImpl import org.jetbrains.kotlin.ir.expressions.impl.IrInstanceInitializerCallImpl import org.jetbrains.kotlin.ir.types.* import org.jetbrains.kotlin.ir.util.* -import org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid import org.jetbrains.kotlin.ir.visitors.transformChildrenVoid import org.jetbrains.kotlin.name.Name import org.jetbrains.kotlin.name.SpecialNames @@ -243,35 +242,7 @@ internal class CallableReferenceLowering(private val context: JvmBackendContext) param to param.copyTo(this, index = index) } valueParameters += valueParameterMap.values - - val calleeBody = callee.body as IrBlockBody - body = context.createIrBuilder(symbol).irBlockBody(calleeBody.startOffset, calleeBody.endOffset) { - calleeBody.statements.forEach { statement -> - +statement.transform(object : IrElementTransformerVoid() { - override fun visitGetValue(expression: IrGetValue): IrExpression { - val replacement = valueParameterMap[expression.symbol.owner] - ?: return super.visitGetValue(expression) - - at(expression.startOffset, expression.endOffset) - return irGet(replacement) - } - - override fun visitReturn(expression: IrReturn): IrExpression = - if (expression.returnTargetSymbol != callee.symbol) { - super.visitReturn(expression) - } else { - at(expression.startOffset, expression.endOffset) - irReturn(expression.value.transform(this, null)) - } - - override fun visitDeclaration(declaration: IrDeclaration): IrStatement { - if (declaration.parent == callee) - declaration.parent = this@createLambdaInvokeMethod - return super.visitDeclaration(declaration) - } - }, null) - } - } + body = callee.moveBodyTo(this, valueParameterMap) } private fun IrSimpleFunction.createFunctionReferenceInvokeMethod(receiver: IrValueDeclaration?) { diff --git a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/InterfaceLowering.kt b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/InterfaceLowering.kt index 86301fc51cb..8989f7ccad0 100644 --- a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/InterfaceLowering.kt +++ b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/InterfaceLowering.kt @@ -6,8 +6,8 @@ package org.jetbrains.kotlin.backend.jvm.lower import org.jetbrains.kotlin.backend.common.ClassLoweringPass -import org.jetbrains.kotlin.backend.common.ir.copyBodyToStatic import org.jetbrains.kotlin.backend.common.ir.isMethodOfAny +import org.jetbrains.kotlin.backend.common.ir.moveBodyTo import org.jetbrains.kotlin.backend.common.ir.passTypeArgumentsFrom import org.jetbrains.kotlin.backend.jvm.JvmBackendContext import org.jetbrains.kotlin.backend.jvm.JvmLoweredDeclarationOrigin @@ -122,7 +122,7 @@ internal class InterfaceLowering(val context: JvmBackendContext) : IrElementTran || (function.origin == IrDeclarationOrigin.FUNCTION_FOR_DEFAULT_PARAMETER && !function.hasJvmDefault()) || function.origin == JvmLoweredDeclarationOrigin.SYNTHETIC_METHOD_FOR_PROPERTY_ANNOTATIONS -> { val defaultImpl = createDefaultImpl(function) - function.copyImplementationTo(defaultImpl) + defaultImpl.body = function.moveBodyTo(defaultImpl) removedFunctions[function.symbol] = defaultImpl.symbol } @@ -132,7 +132,7 @@ internal class InterfaceLowering(val context: JvmBackendContext) : IrElementTran */ !function.hasJvmDefault() -> { val defaultImpl = createDefaultImpl(function) - function.copyImplementationTo(defaultImpl) + defaultImpl.body = function.moveBodyTo(defaultImpl) function.body = null //TODO reset modality to abstract } @@ -176,20 +176,17 @@ internal class InterfaceLowering(val context: JvmBackendContext) : IrElementTran if (annotationsMethods.none()) return for (function in annotationsMethods) { - removedFunctions[function.symbol] = createDefaultImpl(function).symbol + val defaultImpl = createDefaultImpl(function) + defaultImpl.body = function.moveBodyTo(defaultImpl) + removedFunctions[function.symbol] = defaultImpl.symbol } } private fun createDefaultImpl(function: IrSimpleFunction): IrSimpleFunction = context.declarationFactory.getDefaultImplsFunction(function).also { newFunction -> - newFunction.body = function.body?.patchDeclarationParents(newFunction) newFunction.parentAsClass.declarations.add(newFunction) } - private fun IrSimpleFunction.copyImplementationTo(target: IrSimpleFunction) { - copyBodyToStatic(this, target) - } - // Bridge from static to static method - simply fill the arguments to the parameters. // By nature of the generation of both source and target of bridge, they line up. private fun IrFunction.bridgeToStatic(callTarget: IrFunction) { diff --git a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/StaticDefaultFunctionLowering.kt b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/StaticDefaultFunctionLowering.kt index dcecbdc3854..986b7309e33 100644 --- a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/StaticDefaultFunctionLowering.kt +++ b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/StaticDefaultFunctionLowering.kt @@ -18,8 +18,8 @@ package org.jetbrains.kotlin.backend.jvm.lower import org.jetbrains.kotlin.backend.common.ClassLoweringPass import org.jetbrains.kotlin.backend.common.FileLoweringPass -import org.jetbrains.kotlin.backend.common.ir.copyBodyToStatic import org.jetbrains.kotlin.backend.common.ir.createStaticFunctionWithReceivers +import org.jetbrains.kotlin.backend.common.ir.moveBodyTo import org.jetbrains.kotlin.backend.common.phaser.SameTypeNamedPhaseWrapper import org.jetbrains.kotlin.backend.common.phaser.makeIrFilePhase import org.jetbrains.kotlin.backend.common.phaser.then @@ -60,16 +60,14 @@ private class StaticDefaultFunctionLowering(val context: JvmBackendContext) : Ir irClass.accept(this, null) } - override fun visitFunction(declaration: IrFunction): IrStatement { - return if (declaration.origin == IrDeclarationOrigin.FUNCTION_FOR_DEFAULT_PARAMETER && declaration.dispatchReceiverParameter != null) { + override fun visitFunction(declaration: IrFunction): IrStatement = super.visitFunction( + if (declaration.origin == IrDeclarationOrigin.FUNCTION_FOR_DEFAULT_PARAMETER && declaration.dispatchReceiverParameter != null) context.getStaticFunctionWithReceivers(declaration).also { - copyBodyToStatic(declaration, it) - super.visitFunction(it) + it.body = declaration.moveBodyTo(it) } - } else { - super.visitFunction(declaration) - } - } + else + declaration + ) override fun visitReturn(expression: IrReturn): IrExpression { return super.visitReturn( @@ -94,9 +92,7 @@ private class StaticDefaultCallLowering( override fun visitCall(expression: IrCall): IrExpression { val callee = expression.symbol.owner - if (callee.origin !== IrDeclarationOrigin.FUNCTION_FOR_DEFAULT_PARAMETER || - expression.dispatchReceiver == null - ) { + if (callee.origin !== IrDeclarationOrigin.FUNCTION_FOR_DEFAULT_PARAMETER || expression.dispatchReceiver == null) { return super.visitCall(expression) } diff --git a/compiler/testData/codegen/boxInline/nonLocalReturns/fromInterfaceDefaultGetter.kt b/compiler/testData/codegen/boxInline/nonLocalReturns/fromInterfaceDefaultGetter.kt new file mode 100644 index 00000000000..8f2b2734c17 --- /dev/null +++ b/compiler/testData/codegen/boxInline/nonLocalReturns/fromInterfaceDefaultGetter.kt @@ -0,0 +1,16 @@ +// FILE: 1.kt +package test + +inline fun myRun(f: () -> Nothing): Nothing = f() + +// FILE: 2.kt +import test.* + +interface I { + val ok: String + get() { myRun { return "OK" } } +} + +class C : I + +fun box(): String = C().ok diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxInlineCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxInlineCodegenTestGenerated.java index 05b46649a6d..4859f7a5161 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxInlineCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxInlineCodegenTestGenerated.java @@ -2119,6 +2119,11 @@ public class BlackBoxInlineCodegenTestGenerated extends AbstractBlackBoxInlineCo runTest("compiler/testData/codegen/boxInline/nonLocalReturns/explicitLocalReturn.kt"); } + @TestMetadata("fromInterfaceDefaultGetter.kt") + public void testFromInterfaceDefaultGetter() throws Exception { + runTest("compiler/testData/codegen/boxInline/nonLocalReturns/fromInterfaceDefaultGetter.kt"); + } + @TestMetadata("justReturnInLambda.kt") public void testJustReturnInLambda() throws Exception { runTest("compiler/testData/codegen/boxInline/nonLocalReturns/justReturnInLambda.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/CompileKotlinAgainstInlineKotlinTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/CompileKotlinAgainstInlineKotlinTestGenerated.java index 480ad337602..d98263dd48d 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/CompileKotlinAgainstInlineKotlinTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/CompileKotlinAgainstInlineKotlinTestGenerated.java @@ -2119,6 +2119,11 @@ public class CompileKotlinAgainstInlineKotlinTestGenerated extends AbstractCompi runTest("compiler/testData/codegen/boxInline/nonLocalReturns/explicitLocalReturn.kt"); } + @TestMetadata("fromInterfaceDefaultGetter.kt") + public void testFromInterfaceDefaultGetter() throws Exception { + runTest("compiler/testData/codegen/boxInline/nonLocalReturns/fromInterfaceDefaultGetter.kt"); + } + @TestMetadata("justReturnInLambda.kt") public void testJustReturnInLambda() throws Exception { runTest("compiler/testData/codegen/boxInline/nonLocalReturns/justReturnInLambda.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxInlineCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxInlineCodegenTestGenerated.java index e4b97e33d9f..579cf47e0e1 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxInlineCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxInlineCodegenTestGenerated.java @@ -2119,6 +2119,11 @@ public class IrBlackBoxInlineCodegenTestGenerated extends AbstractIrBlackBoxInli runTest("compiler/testData/codegen/boxInline/nonLocalReturns/explicitLocalReturn.kt"); } + @TestMetadata("fromInterfaceDefaultGetter.kt") + public void testFromInterfaceDefaultGetter() throws Exception { + runTest("compiler/testData/codegen/boxInline/nonLocalReturns/fromInterfaceDefaultGetter.kt"); + } + @TestMetadata("justReturnInLambda.kt") public void testJustReturnInLambda() throws Exception { runTest("compiler/testData/codegen/boxInline/nonLocalReturns/justReturnInLambda.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrCompileKotlinAgainstInlineKotlinTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrCompileKotlinAgainstInlineKotlinTestGenerated.java index 522f9027fd1..9ef73f9c6f0 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrCompileKotlinAgainstInlineKotlinTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrCompileKotlinAgainstInlineKotlinTestGenerated.java @@ -2119,6 +2119,11 @@ public class IrCompileKotlinAgainstInlineKotlinTestGenerated extends AbstractIrC runTest("compiler/testData/codegen/boxInline/nonLocalReturns/explicitLocalReturn.kt"); } + @TestMetadata("fromInterfaceDefaultGetter.kt") + public void testFromInterfaceDefaultGetter() throws Exception { + runTest("compiler/testData/codegen/boxInline/nonLocalReturns/fromInterfaceDefaultGetter.kt"); + } + @TestMetadata("justReturnInLambda.kt") public void testJustReturnInLambda() throws Exception { runTest("compiler/testData/codegen/boxInline/nonLocalReturns/justReturnInLambda.kt"); diff --git a/js/js.tests/test/org/jetbrains/kotlin/js/test/ir/semantics/IrNonLocalReturnsTestGenerated.java b/js/js.tests/test/org/jetbrains/kotlin/js/test/ir/semantics/IrNonLocalReturnsTestGenerated.java index 146049fb0e8..afbee92b8cf 100644 --- a/js/js.tests/test/org/jetbrains/kotlin/js/test/ir/semantics/IrNonLocalReturnsTestGenerated.java +++ b/js/js.tests/test/org/jetbrains/kotlin/js/test/ir/semantics/IrNonLocalReturnsTestGenerated.java @@ -34,6 +34,11 @@ public class IrNonLocalReturnsTestGenerated extends AbstractIrNonLocalReturnsTes runTest("compiler/testData/codegen/boxInline/nonLocalReturns/explicitLocalReturn.kt"); } + @TestMetadata("fromInterfaceDefaultGetter.kt") + public void testFromInterfaceDefaultGetter() throws Exception { + runTest("compiler/testData/codegen/boxInline/nonLocalReturns/fromInterfaceDefaultGetter.kt"); + } + @TestMetadata("justReturnInLambda.kt") public void testJustReturnInLambda() throws Exception { runTest("compiler/testData/codegen/boxInline/nonLocalReturns/justReturnInLambda.kt"); diff --git a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/NonLocalReturnsTestGenerated.java b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/NonLocalReturnsTestGenerated.java index e9f9fe20629..0ce11929ebf 100644 --- a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/NonLocalReturnsTestGenerated.java +++ b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/NonLocalReturnsTestGenerated.java @@ -34,6 +34,11 @@ public class NonLocalReturnsTestGenerated extends AbstractNonLocalReturnsTest { runTest("compiler/testData/codegen/boxInline/nonLocalReturns/explicitLocalReturn.kt"); } + @TestMetadata("fromInterfaceDefaultGetter.kt") + public void testFromInterfaceDefaultGetter() throws Exception { + runTest("compiler/testData/codegen/boxInline/nonLocalReturns/fromInterfaceDefaultGetter.kt"); + } + @TestMetadata("justReturnInLambda.kt") public void testJustReturnInLambda() throws Exception { runTest("compiler/testData/codegen/boxInline/nonLocalReturns/justReturnInLambda.kt");