From 9f53d70109ef22920d5f37d957cd810d9dc64ae5 Mon Sep 17 00:00:00 2001 From: pyos Date: Tue, 4 May 2021 16:13:39 +0200 Subject: [PATCH] JVM_IR: move ArrayConstructor below function reference phases This allows taking function references to inline array constructors. Also, redundant classes are no longer generated when function references are passed as arguments to the array constructors. #KT-46426 Fixed --- .../FirBlackBoxCodegenTestGenerated.java | 12 +++++ .../kotlin/backend/common/ir/IrInlineUtils.kt | 52 ++++++++++++++++--- .../common/lower/ArrayConstructorLowering.kt | 21 ++------ .../jetbrains/kotlin/backend/jvm/JvmLower.kt | 2 +- .../backend/jvm/codegen/IrInlineCodegen.kt | 8 ++- .../backend/jvm/lower/AssertionLowering.kt | 23 ++------ .../bound/arrayConstructorArgument.kt | 10 ++++ .../inlineArrayConstructors.kt | 11 ++++ .../codegen/BlackBoxCodegenTestGenerated.java | 12 +++++ .../IrBlackBoxCodegenTestGenerated.java | 12 +++++ .../LightAnalysisModeTestGenerated.java | 10 ++++ .../IrJsCodegenBoxES6TestGenerated.java | 10 ++++ .../IrJsCodegenBoxTestGenerated.java | 10 ++++ .../semantics/JsCodegenBoxTestGenerated.java | 10 ++++ .../IrCodegenBoxWasmTestGenerated.java | 10 ++++ 15 files changed, 168 insertions(+), 45 deletions(-) create mode 100644 compiler/testData/codegen/box/callableReference/bound/arrayConstructorArgument.kt create mode 100644 compiler/testData/codegen/box/callableReference/inlineArrayConstructors.kt diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java index 71786b1f76b..f47644f9bf1 100644 --- a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java +++ b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java @@ -2440,6 +2440,12 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT runTest("compiler/testData/codegen/box/callableReference/genericLocalClassConstructorReference.kt"); } + @Test + @TestMetadata("inlineArrayConstructors.kt") + public void testInlineArrayConstructors() throws Exception { + runTest("compiler/testData/codegen/box/callableReference/inlineArrayConstructors.kt"); + } + @Test @TestMetadata("javaField.kt") public void testJavaField() throws Exception { @@ -2835,6 +2841,12 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT runTest("compiler/testData/codegen/box/callableReference/bound/array.kt"); } + @Test + @TestMetadata("arrayConstructorArgument.kt") + public void testArrayConstructorArgument() throws Exception { + runTest("compiler/testData/codegen/box/callableReference/bound/arrayConstructorArgument.kt"); + } + @Test @TestMetadata("arrayGetIntrinsic.kt") public void testArrayGetIntrinsic() throws Exception { 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 9598b50078c..74558ae85e5 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 @@ -7,38 +7,57 @@ package org.jetbrains.kotlin.backend.common.ir import org.jetbrains.kotlin.backend.common.lower.VariableRemapper import org.jetbrains.kotlin.ir.IrStatement +import org.jetbrains.kotlin.ir.UNDEFINED_OFFSET +import org.jetbrains.kotlin.ir.builders.IrStatementsBuilder +import org.jetbrains.kotlin.ir.builders.irTemporary import org.jetbrains.kotlin.ir.declarations.* import org.jetbrains.kotlin.ir.expressions.* +import org.jetbrains.kotlin.ir.expressions.impl.IrCallImpl +import org.jetbrains.kotlin.ir.expressions.impl.IrGetValueImpl 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.types.getClass +import org.jetbrains.kotlin.ir.util.explicitParameters +import org.jetbrains.kotlin.ir.util.functions import org.jetbrains.kotlin.ir.util.isVararg import org.jetbrains.kotlin.ir.util.statements +import org.jetbrains.kotlin.util.OperatorNameConventions + +sealed class IrInlinable +class IrInvokable(val invokable: IrValueDeclaration) : IrInlinable() +class IrInlinableLambda(val function: IrSimpleFunction, val boundReceiver: IrValueDeclaration?) : IrInlinable() // Return the underlying function for a lambda argument without bound or default parameters or varargs. -fun IrExpression.asSimpleLambda(): IrSimpleFunction? { +private fun IrExpression.asInlinableLambda(builder: IrStatementsBuilder<*>): IrInlinableLambda? { if (this is IrFunctionExpression) { if (function.valueParameters.any { it.isVararg || it.defaultValue != null }) return null - return function + return IrInlinableLambda(function, null) } // A lambda is represented as a block with a function declaration and a reference to it. + // Inlinable function references are also a kind of lambda; bound receivers are represented as extension receivers. if (this !is IrBlock || statements.size != 2) return null val (function, reference) = statements if (function !is IrSimpleFunction || reference !is IrFunctionReference || function.symbol != reference.symbol) return null + if (function.dispatchReceiverParameter != null) + return null if ((0 until reference.valueArgumentsCount).any { reference.getValueArgument(it) != null }) return null if (function.valueParameters.any { it.isVararg || it.defaultValue != null }) return null - return function + return IrInlinableLambda(function, reference.extensionReceiver?.let { builder.irTemporary(it) }) } +fun IrExpression.asInlinable(builder: IrStatementsBuilder<*>): IrInlinable = + asInlinableLambda(builder) ?: IrInvokable(builder.irTemporary(this)) + 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 + val sourceParameters = source.explicitParameters + val targetParameters = target.explicitParameters assert(sourceParameters.size == targetParameters.size) return sourceParameters.zip(targetParameters).toMap() } @@ -79,7 +98,26 @@ private fun IrBody.move( // 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(target: IrDeclarationParent, arguments: List = listOf()): IrReturnableBlock = +private fun IrFunction.inline(target: IrDeclarationParent, arguments: List = listOf()): IrReturnableBlock = IrReturnableBlockImpl(startOffset, endOffset, returnType, IrReturnableBlockSymbolImpl(), null, symbol).apply { - statements += body!!.move(this@inline, target, symbol, valueParameters.zip(arguments).toMap()).statements + statements += body!!.move(this@inline, target, symbol, explicitParameters.zip(arguments).toMap()).statements + } + +fun IrInlinable.inline(target: IrDeclarationParent, arguments: List = listOf()): IrExpression = + when (this) { + is IrInlinableLambda -> + function.inline(target, listOfNotNull(boundReceiver) + arguments) + + is IrInvokable -> { + val invoke = invokable.type.getClass()!!.functions.single { it.name == OperatorNameConventions.INVOKE } + IrCallImpl( + UNDEFINED_OFFSET, UNDEFINED_OFFSET, invoke.returnType, invoke.symbol, + typeArgumentsCount = 0, valueArgumentsCount = arguments.size, + ).apply { + dispatchReceiver = IrGetValueImpl(UNDEFINED_OFFSET, UNDEFINED_OFFSET, invokable.symbol) + for ((index, argument) in arguments.withIndex()) { + putValueArgument(index, IrGetValueImpl(UNDEFINED_OFFSET, UNDEFINED_OFFSET, argument.symbol)) + } + } + } } 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 c98827a7263..930ade135d0 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 @@ -8,12 +8,11 @@ package org.jetbrains.kotlin.backend.common.lower import org.jetbrains.kotlin.backend.common.BodyLoweringPass import org.jetbrains.kotlin.backend.common.CommonBackendContext import org.jetbrains.kotlin.backend.common.IrElementTransformerVoidWithContext -import org.jetbrains.kotlin.backend.common.ir.asSimpleLambda +import org.jetbrains.kotlin.backend.common.ir.asInlinable import org.jetbrains.kotlin.backend.common.ir.inline import org.jetbrains.kotlin.ir.builders.* import org.jetbrains.kotlin.ir.declarations.IrConstructor import org.jetbrains.kotlin.ir.declarations.IrDeclaration -import org.jetbrains.kotlin.ir.declarations.IrSimpleFunction import org.jetbrains.kotlin.ir.declarations.IrSymbolOwner import org.jetbrains.kotlin.ir.expressions.IrBody import org.jetbrains.kotlin.ir.expressions.IrConstructorCall @@ -49,15 +48,6 @@ open class ArrayConstructorTransformer( } } - private fun IrExpression.asSingleArgumentLambda(): IrSimpleFunction? { - val function = asSimpleLambda() ?: return null - // Only match the one that has exactly one non-vararg argument, as the code below - // does not handle defaults or varargs. - if (function.valueParameters.size != 1) - return null - return function - } - override fun visitConstructorCall(expression: IrConstructorCall): IrExpression { val sizeConstructor = arrayInlineToSizeConstructor(expression.symbol.owner) ?: return super.visitConstructorCall(expression) @@ -82,9 +72,7 @@ open class ArrayConstructorTransformer( putValueArgument(0, irGet(sizeVar)) }) - val lambda = invokable.asSingleArgumentLambda() - val invoke = invokable.type.getClass()!!.functions.single { it.name == OperatorNameConventions.INVOKE } - val invokableVar = if (lambda == null) createTmpVariable(invokable) else null + val generator = invokable.asInlinable(this) +irWhile().apply { condition = irCall(context.irBuiltIns.lessFunByOperandType[index.type.classifierOrFail]!!).apply { putValueArgument(0, irGet(index)) @@ -92,13 +80,10 @@ open class ArrayConstructorTransformer( } body = irBlock { val tempIndex = createTmpVariable(irGet(index)) - val value = - lambda?.run { inline(parent, listOf(tempIndex)).patchDeclarationParents(scope.getLocalDeclarationParent()) } - ?: irCallOp(invoke.symbol, invoke.returnType, irGet(invokableVar!!), irGet(tempIndex)) +irCall(result.type.getClass()!!.functions.single { it.name == OperatorNameConventions.SET }).apply { dispatchReceiver = irGet(result) putValueArgument(0, irGet(tempIndex)) - putValueArgument(1, value) + putValueArgument(1, generator.inline(parent, listOf(tempIndex)).patchDeclarationParents(scope.getLocalDeclarationParent())) } val inc = index.type.getClass()!!.functions.single { it.name == OperatorNameConventions.INC } +irSet(index.symbol, irCallOp(inc.symbol, index.type, irGet(index))) diff --git a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/JvmLower.kt b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/JvmLower.kt index 966b5a2b564..fa759ab983b 100644 --- a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/JvmLower.kt +++ b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/JvmLower.kt @@ -326,7 +326,6 @@ private val jvmFilePhases = listOf( annotationPhase, polymorphicSignaturePhase, varargPhase, - arrayConstructorPhase, lateinitNullableFieldsPhase, lateinitDeclarationLoweringPhase, @@ -336,6 +335,7 @@ private val jvmFilePhases = listOf( functionReferencePhase, suspendLambdaPhase, propertyReferencePhase, + arrayConstructorPhase, constPhase1, // TODO: merge the next three phases together, as visitors behave incorrectly between them // (backing fields moved out of companion objects are reachable by two paths): diff --git a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/IrInlineCodegen.kt b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/IrInlineCodegen.kt index a0d643d8174..872a4fe4834 100644 --- a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/IrInlineCodegen.kt +++ b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/IrInlineCodegen.kt @@ -263,4 +263,10 @@ fun IrStatementOrigin?.isInlineIrExpression() = isLambda || this == IrStatementOrigin.ADAPTED_FUNCTION_REFERENCE || this == IrStatementOrigin.SUSPEND_CONVERSION fun IrFunction.isInlineFunctionCall(context: JvmBackendContext) = - (!context.state.isInlineDisabled || typeParameters.any { it.isReified }) && isInline + (!context.state.isInlineDisabled || typeParameters.any { it.isReified }) && (isInline || isInlineArrayConstructor(context)) + +// Constructors can't be marked as inline in metadata, hence this hack. +private fun IrFunction.isInlineArrayConstructor(context: JvmBackendContext): Boolean = + this is IrConstructor && valueParameters.size == 2 && constructedClass.symbol.let { + it == context.irBuiltIns.arrayClass || it in context.irBuiltIns.primitiveArrays + } 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 2d898ab076d..f67c7ba3aa7 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 @@ -6,7 +6,7 @@ package org.jetbrains.kotlin.backend.jvm.lower import org.jetbrains.kotlin.backend.common.FileLoweringPass -import org.jetbrains.kotlin.backend.common.ir.asSimpleLambda +import org.jetbrains.kotlin.backend.common.ir.asInlinable import org.jetbrains.kotlin.backend.common.ir.inline import org.jetbrains.kotlin.backend.common.lower.* import org.jetbrains.kotlin.backend.common.phaser.makeIrFilePhase @@ -27,12 +27,10 @@ import org.jetbrains.kotlin.ir.declarations.IrFunction import org.jetbrains.kotlin.ir.expressions.IrCall import org.jetbrains.kotlin.ir.expressions.IrExpression import org.jetbrains.kotlin.ir.expressions.impl.IrCompositeImpl -import org.jetbrains.kotlin.ir.types.getClass import org.jetbrains.kotlin.ir.util.* import org.jetbrains.kotlin.ir.visitors.IrElementTransformer import org.jetbrains.kotlin.load.java.JavaDescriptorVisibilities import org.jetbrains.kotlin.name.Name -import org.jetbrains.kotlin.util.OperatorNameConventions internal val assertionPhase = makeIrFilePhase( ::AssertionLowering, @@ -102,23 +100,12 @@ private class AssertionLowering(private val context: JvmBackendContext) : private fun IrBuilderWithScope.checkAssertion(assertCondition: IrExpression, lambdaArgument: IrExpression?) = irBlock { - val lambda = lambdaArgument?.asSimpleLambda() - val invokeVar = if (lambda == null && lambdaArgument != null) irTemporary(lambdaArgument) else null - + val generator = lambdaArgument?.asInlinable(this) val constructor = this@AssertionLowering.context.ir.symbols.assertionErrorConstructor val throwError = irThrow(irCall(constructor).apply { - putValueArgument( - 0, - when { - lambda != null -> lambda.inline(parent) - lambdaArgument != null -> { - val invoke = - lambdaArgument.type.getClass()!!.functions.single { it.name == OperatorNameConventions.INVOKE } - irCallOp(invoke.symbol, invoke.returnType, irGet(invokeVar!!)) - } - else -> irString("Assertion failed") - } - ) + val message = generator?.inline(parent)?.patchDeclarationParents(scope.getLocalDeclarationParent()) + ?: irString("Assertion failed") + putValueArgument(0, message) }) +irIfThen(irNot(assertCondition), throwError) } diff --git a/compiler/testData/codegen/box/callableReference/bound/arrayConstructorArgument.kt b/compiler/testData/codegen/box/callableReference/bound/arrayConstructorArgument.kt new file mode 100644 index 00000000000..02953c875bb --- /dev/null +++ b/compiler/testData/codegen/box/callableReference/bound/arrayConstructorArgument.kt @@ -0,0 +1,10 @@ +// WITH_RUNTIME + +class C(val x: String) { + fun foo(i: Int): Char = x[i] +} + +fun box(): String { + val array = CharArray(2, C("OK")::foo) + return array[0].toString() + array[1].toString() +} diff --git a/compiler/testData/codegen/box/callableReference/inlineArrayConstructors.kt b/compiler/testData/codegen/box/callableReference/inlineArrayConstructors.kt new file mode 100644 index 00000000000..4b7962ae4c9 --- /dev/null +++ b/compiler/testData/codegen/box/callableReference/inlineArrayConstructors.kt @@ -0,0 +1,11 @@ +// WITH_RUNTIME +// IGNORE_BACKEND: JS_IR + +fun createArray(ctor: (Int, (Int) -> Char) -> CharArray) = + ctor(1) { 'O' } + +inline fun createArrayInline(ctor: (Int, (Int) -> Char) -> CharArray) = + ctor(1) { 'K' } + +fun box(): String = + createArray(::CharArray)[0].toString() + createArrayInline(::CharArray)[0].toString() diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java index 48ebf86b4c3..1bb9503aa03 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java @@ -2440,6 +2440,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { runTest("compiler/testData/codegen/box/callableReference/genericLocalClassConstructorReference.kt"); } + @Test + @TestMetadata("inlineArrayConstructors.kt") + public void testInlineArrayConstructors() throws Exception { + runTest("compiler/testData/codegen/box/callableReference/inlineArrayConstructors.kt"); + } + @Test @TestMetadata("javaField.kt") public void testJavaField() throws Exception { @@ -2835,6 +2841,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { runTest("compiler/testData/codegen/box/callableReference/bound/array.kt"); } + @Test + @TestMetadata("arrayConstructorArgument.kt") + public void testArrayConstructorArgument() throws Exception { + runTest("compiler/testData/codegen/box/callableReference/bound/arrayConstructorArgument.kt"); + } + @Test @TestMetadata("arrayGetIntrinsic.kt") public void testArrayGetIntrinsic() throws Exception { diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java index 40afe43d525..dc384e6bd8e 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java @@ -2440,6 +2440,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes runTest("compiler/testData/codegen/box/callableReference/genericLocalClassConstructorReference.kt"); } + @Test + @TestMetadata("inlineArrayConstructors.kt") + public void testInlineArrayConstructors() throws Exception { + runTest("compiler/testData/codegen/box/callableReference/inlineArrayConstructors.kt"); + } + @Test @TestMetadata("javaField.kt") public void testJavaField() throws Exception { @@ -2835,6 +2841,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes runTest("compiler/testData/codegen/box/callableReference/bound/array.kt"); } + @Test + @TestMetadata("arrayConstructorArgument.kt") + public void testArrayConstructorArgument() throws Exception { + runTest("compiler/testData/codegen/box/callableReference/bound/arrayConstructorArgument.kt"); + } + @Test @TestMetadata("arrayGetIntrinsic.kt") public void testArrayGetIntrinsic() throws Exception { diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java index ff4348b847a..eafd85e231f 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java @@ -2165,6 +2165,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes runTest("compiler/testData/codegen/box/callableReference/genericLocalClassConstructorReference.kt"); } + @TestMetadata("inlineArrayConstructors.kt") + public void testInlineArrayConstructors() throws Exception { + runTest("compiler/testData/codegen/box/callableReference/inlineArrayConstructors.kt"); + } + @TestMetadata("javaField.kt") public void testJavaField() throws Exception { runTest("compiler/testData/codegen/box/callableReference/javaField.kt"); @@ -2493,6 +2498,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes runTest("compiler/testData/codegen/box/callableReference/bound/array.kt"); } + @TestMetadata("arrayConstructorArgument.kt") + public void testArrayConstructorArgument() throws Exception { + runTest("compiler/testData/codegen/box/callableReference/bound/arrayConstructorArgument.kt"); + } + @TestMetadata("arrayGetIntrinsic.kt") public void testArrayGetIntrinsic() throws Exception { runTest("compiler/testData/codegen/box/callableReference/bound/arrayGetIntrinsic.kt"); diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java index 406a373a4c0..356b5ccabf1 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java @@ -1465,6 +1465,11 @@ public class IrJsCodegenBoxES6TestGenerated extends AbstractIrJsCodegenBoxES6Tes runTest("compiler/testData/codegen/box/callableReference/genericLocalClassConstructorReference.kt"); } + @TestMetadata("inlineArrayConstructors.kt") + public void testInlineArrayConstructors() throws Exception { + runTest("compiler/testData/codegen/box/callableReference/inlineArrayConstructors.kt"); + } + @TestMetadata("kt21014.kt") public void testKt21014() throws Exception { runTest("compiler/testData/codegen/box/callableReference/kt21014.kt"); @@ -1733,6 +1738,11 @@ public class IrJsCodegenBoxES6TestGenerated extends AbstractIrJsCodegenBoxES6Tes runTest("compiler/testData/codegen/box/callableReference/bound/array.kt"); } + @TestMetadata("arrayConstructorArgument.kt") + public void testArrayConstructorArgument() throws Exception { + runTest("compiler/testData/codegen/box/callableReference/bound/arrayConstructorArgument.kt"); + } + @TestMetadata("arrayGetIntrinsic.kt") public void testArrayGetIntrinsic() throws Exception { runTest("compiler/testData/codegen/box/callableReference/bound/arrayGetIntrinsic.kt"); diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java index 840c9d8163f..087ae075f6c 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java @@ -1465,6 +1465,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { runTest("compiler/testData/codegen/box/callableReference/genericLocalClassConstructorReference.kt"); } + @TestMetadata("inlineArrayConstructors.kt") + public void testInlineArrayConstructors() throws Exception { + runTest("compiler/testData/codegen/box/callableReference/inlineArrayConstructors.kt"); + } + @TestMetadata("kt21014.kt") public void testKt21014() throws Exception { runTest("compiler/testData/codegen/box/callableReference/kt21014.kt"); @@ -1733,6 +1738,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { runTest("compiler/testData/codegen/box/callableReference/bound/array.kt"); } + @TestMetadata("arrayConstructorArgument.kt") + public void testArrayConstructorArgument() throws Exception { + runTest("compiler/testData/codegen/box/callableReference/bound/arrayConstructorArgument.kt"); + } + @TestMetadata("arrayGetIntrinsic.kt") public void testArrayGetIntrinsic() throws Exception { runTest("compiler/testData/codegen/box/callableReference/bound/arrayGetIntrinsic.kt"); diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java index 29d76ea991d..be7f6ea0395 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java @@ -1465,6 +1465,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { runTest("compiler/testData/codegen/box/callableReference/genericLocalClassConstructorReference.kt"); } + @TestMetadata("inlineArrayConstructors.kt") + public void testInlineArrayConstructors() throws Exception { + runTest("compiler/testData/codegen/box/callableReference/inlineArrayConstructors.kt"); + } + @TestMetadata("kt21014.kt") public void testKt21014() throws Exception { runTest("compiler/testData/codegen/box/callableReference/kt21014.kt"); @@ -1733,6 +1738,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { runTest("compiler/testData/codegen/box/callableReference/bound/array.kt"); } + @TestMetadata("arrayConstructorArgument.kt") + public void testArrayConstructorArgument() throws Exception { + runTest("compiler/testData/codegen/box/callableReference/bound/arrayConstructorArgument.kt"); + } + @TestMetadata("arrayGetIntrinsic.kt") public void testArrayGetIntrinsic() throws Exception { runTest("compiler/testData/codegen/box/callableReference/bound/arrayGetIntrinsic.kt"); diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/wasm/semantics/IrCodegenBoxWasmTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/wasm/semantics/IrCodegenBoxWasmTestGenerated.java index 9f552e67f27..775d425e1dc 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/wasm/semantics/IrCodegenBoxWasmTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/wasm/semantics/IrCodegenBoxWasmTestGenerated.java @@ -1265,6 +1265,11 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/callableReference"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.WASM, true); } + @TestMetadata("inlineArrayConstructors.kt") + public void testInlineArrayConstructors() throws Exception { + runTest("compiler/testData/codegen/box/callableReference/inlineArrayConstructors.kt"); + } + @TestMetadata("kt37604.kt") public void testKt37604() throws Exception { runTest("compiler/testData/codegen/box/callableReference/kt37604.kt"); @@ -1358,6 +1363,11 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/callableReference/bound"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.WASM, true); } + @TestMetadata("arrayConstructorArgument.kt") + public void testArrayConstructorArgument() throws Exception { + runTest("compiler/testData/codegen/box/callableReference/bound/arrayConstructorArgument.kt"); + } + @TestMetadata("captureVarInInitBlock.kt") public void testCaptureVarInInitBlock() throws Exception { runTest("compiler/testData/codegen/box/callableReference/bound/captureVarInInitBlock.kt");