From 0fee8a6946828046c1bdd58012cbf043813faafa Mon Sep 17 00:00:00 2001 From: Mikhail Glukhikh Date: Tue, 3 Mar 2020 19:26:15 +0300 Subject: [PATCH] FIR2IR: cache functions and their parents properly --- .../fir/backend/Fir2IrDeclarationStorage.kt | 145 ++++++++---------- .../kotlin/fir/backend/Fir2IrVisitor.kt | 2 +- .../comanionObjectFieldVsClassField.kt | 1 - .../codegen/box/closures/extensionClosure.kt | 1 - .../testData/codegen/box/closures/kt3738.kt | 1 - .../box/contracts/constructorArgument.kt | 1 - .../tryCatchInExpressions/kt17572_2_ext.kt | 1 - .../tryCatchInExpressions/kt17572_ext.kt | 1 - .../codegen/box/extensionFunctions/kt13312.kt | 1 - .../codegen/box/extensionFunctions/kt3646.kt | 1 - .../codegen/box/extensionFunctions/kt606.kt | 1 - .../codegen/box/extensionFunctions/nested2.kt | 1 - .../box/fullJdk/intCountDownLatchExtension.kt | 1 - .../invoke/castFunctionToExtension.kt | 1 - .../functions/invoke/kt3450getAndInvoke.kt | 1 - .../testData/codegen/box/functions/kt3573.kt | 1 - .../testData/codegen/box/functions/kt3724.kt | 1 - .../testData/codegen/box/functions/kt395.kt | 1 - .../codegen/box/increment/memberExtOnLong.kt | 1 - .../testData/codegen/box/inference/kt35684.kt | 1 - .../testData/codegen/box/inference/kt36446.kt | 1 - .../testData/codegen/box/jvmStatic/simple.kt | 1 - .../privateExtensionFromInitializer_kt4543.kt | 1 - .../box/operatorConventions/plusExplicit.kt | 1 - .../codegen/box/regressions/kt10143.kt | 1 - .../testData/codegen/box/safeCall/kt3430.kt | 1 - .../codegen/box/safeCall/safeCallOnLong.kt | 1 - .../ir/irText/lambdas/extensionLambda.fir.txt | 2 +- .../lambdas/multipleImplicitReceivers.fir.txt | 6 +- .../ir/irText/stubs/builtinMap.fir.txt | 2 +- .../castsInsideCoroutineInference.fir.txt | 10 +- 31 files changed, 71 insertions(+), 121 deletions(-) diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrDeclarationStorage.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrDeclarationStorage.kt index d3848f00139..8c12b8e6ba8 100644 --- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrDeclarationStorage.kt +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrDeclarationStorage.kt @@ -62,7 +62,7 @@ class Fir2IrDeclarationStorage( private val typeParameterCacheForSetter = mutableMapOf() - private val functionCache = mutableMapOf() + private val functionCache = mutableMapOf, IrSimpleFunction>() private val constructorCache = mutableMapOf() @@ -537,57 +537,60 @@ class Fir2IrDeclarationStorage( return this } - fun getIrFunction( - function: FirSimpleFunction, + private fun getCachedIrFunction(function: FirFunction<*>): IrSimpleFunction? { + return if (function !is FirSimpleFunction || function.visibility == Visibilities.LOCAL) { + localStorage.getLocalFunction(function) + } else { + functionCache[function] + } + } + + private fun createIrFunction( + function: FirFunction<*>, irParent: IrDeclarationParent?, shouldLeaveScope: Boolean = true, origin: IrDeclarationOrigin = IrDeclarationOrigin.DEFINED ): IrSimpleFunction { - fun create(): IrSimpleFunction { - val containerSource = function.containerSource - val descriptor = containerSource?.let { WrappedFunctionDescriptorWithContainerSource(it) } ?: WrappedSimpleFunctionDescriptor() - val updatedOrigin = if (function.symbol.callableId.isKFunctionInvoke()) IrDeclarationOrigin.FAKE_OVERRIDE else origin - preCacheTypeParameters(function) - return function.convertWithOffsets { startOffset, endOffset -> - enterScope(descriptor) - val result = irSymbolTable.declareSimpleFunction(startOffset, endOffset, origin, descriptor) { symbol -> - IrFunctionImpl( - startOffset, endOffset, updatedOrigin, symbol, - function.name, function.visibility, function.modality!!, - function.returnTypeRef.toIrType(), - isInline = function.isInline, - isExternal = function.isExternal, - isTailrec = function.isTailRec, - isSuspend = function.isSuspend, - isExpect = function.isExpect, - isFakeOverride = updatedOrigin == IrDeclarationOrigin.FAKE_OVERRIDE, - isOperator = function.isOperator - ) - } - result - }.bindAndDeclareParameters(function, descriptor, irParent, isStatic = function.isStatic) + val simpleFunction = function as? FirSimpleFunction + val containerSource = simpleFunction?.containerSource + val descriptor = containerSource?.let { WrappedFunctionDescriptorWithContainerSource(it) } ?: WrappedSimpleFunctionDescriptor() + val isLambda = function.psi is KtFunctionLiteral + val updatedOrigin = when { + isLambda -> IrDeclarationOrigin.LOCAL_FUNCTION_FOR_LAMBDA + function.symbol.callableId.isKFunctionInvoke() -> IrDeclarationOrigin.FAKE_OVERRIDE + else -> origin } + preCacheTypeParameters(function) + val name = simpleFunction?.name + ?: if (isLambda) Name.special("") else Name.special("") + val visibility = simpleFunction?.visibility ?: Visibilities.LOCAL + val created = function.convertWithOffsets { startOffset, endOffset -> + enterScope(descriptor) + val result = irSymbolTable.declareSimpleFunction(startOffset, endOffset, origin, descriptor) { symbol -> + IrFunctionImpl( + startOffset, endOffset, updatedOrigin, symbol, + name, visibility, + simpleFunction?.modality ?: Modality.FINAL, + function.returnTypeRef.toIrType(), + isInline = simpleFunction?.isInline == true, + isExternal = simpleFunction?.isExternal == true, + isTailrec = simpleFunction?.isTailRec == true, + isSuspend = simpleFunction?.isSuspend == true, + isExpect = simpleFunction?.isExpect == true, + isFakeOverride = updatedOrigin == IrDeclarationOrigin.FAKE_OVERRIDE, + isOperator = simpleFunction?.isOperator == true + ) + } + result + }.bindAndDeclareParameters(function, descriptor, irParent, isStatic = simpleFunction?.isStatic == true) - if (function.visibility == Visibilities.LOCAL) { - val cached = localStorage.getLocalFunction(function) - if (cached != null) { - return if (shouldLeaveScope) cached else cached.enterLocalScope(function) - } - val created = create() - if (shouldLeaveScope) { - leaveScope(created.descriptor) - } - localStorage.putLocalFunction(function, created) - return created - } - val cached = functionCache[function] - if (cached != null) { - return if (shouldLeaveScope) cached else cached.enterLocalScope(function) - } - val created = create() if (shouldLeaveScope) { leaveScope(created.descriptor) } + if (visibility == Visibilities.LOCAL) { + localStorage.putLocalFunction(function, created) + return created + } if (function.symbol.callableId.isKFunctionInvoke()) { (function.symbol.overriddenSymbol as? FirNamedFunctionSymbol)?.let { created.overriddenSymbols += getIrFunctionSymbol(it) as IrSimpleFunctionSymbol @@ -597,38 +600,15 @@ class Fir2IrDeclarationStorage( return created } - fun getIrLocalFunction( - function: FirAnonymousFunction, - irParent: IrDeclarationParent? = null, - shouldLeaveScope: Boolean = true + fun getIrFunction( + function: FirFunction<*>, + irParent: IrDeclarationParent?, + shouldLeaveScope: Boolean = true, + origin: IrDeclarationOrigin = IrDeclarationOrigin.DEFINED ): IrSimpleFunction { - val descriptor = WrappedSimpleFunctionDescriptor() - val isLambda = function.psi is KtFunctionLiteral - val origin = if (isLambda) IrDeclarationOrigin.LOCAL_FUNCTION_FOR_LAMBDA else IrDeclarationOrigin.DEFINED - return function.convertWithOffsets { startOffset, endOffset -> - irSymbolTable.declareSimpleFunction(startOffset, endOffset, origin, descriptor) { symbol -> - IrFunctionImpl( - startOffset, endOffset, origin, symbol, - if (isLambda) Name.special("") else Name.special(""), - Visibilities.LOCAL, Modality.FINAL, - function.returnTypeRef.toIrType(), - isInline = false, isExternal = false, isTailrec = false, - // TODO: suspend lambda - isSuspend = false, - isExpect = false, - isFakeOverride = false, - isOperator = false - ).apply { - enterScope(descriptor) - } - }.bindAndDeclareParameters( - function, descriptor, irParent = irParent, isStatic = false - ).apply { - if (shouldLeaveScope) { - leaveScope(descriptor) - } - } - } + return getCachedIrFunction(function)?.apply { + if (!shouldLeaveScope) enterLocalScope(function) + } ?: createIrFunction(function, irParent, shouldLeaveScope, origin) } fun getIrConstructor( @@ -979,22 +959,17 @@ class Fir2IrDeclarationStorage( } fun getIrFunctionSymbol(firFunctionSymbol: FirFunctionSymbol<*>): IrFunctionSymbol { - val firDeclaration = firFunctionSymbol.fir - val irParent = (firDeclaration as? FirCallableDeclaration<*>)?.let { findIrParent(it) } - return when (firDeclaration) { - is FirSimpleFunction -> { - val irDeclaration = getIrFunction(firDeclaration, irParent).apply { - setAndModifyParent(irParent) - } - irSymbolTable.referenceSimpleFunction(irDeclaration.descriptor) - } - is FirAnonymousFunction -> { - val irDeclaration = getIrLocalFunction(firDeclaration, irParent).apply { + return when (val firDeclaration = firFunctionSymbol.fir) { + is FirSimpleFunction, is FirAnonymousFunction -> { + getCachedIrFunction(firDeclaration)?.let { return irSymbolTable.referenceSimpleFunction(it.descriptor) } + val irParent = findIrParent(firDeclaration) + val irDeclaration = createIrFunction(firDeclaration, irParent).apply { setAndModifyParent(irParent) } irSymbolTable.referenceSimpleFunction(irDeclaration.descriptor) } is FirConstructor -> { + val irParent = findIrParent(firDeclaration) val irDeclaration = getIrConstructor(firDeclaration, irParent).apply { setAndModifyParent(irParent) } diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrVisitor.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrVisitor.kt index 2b9e29cc3a2..cddd6b4b18f 100644 --- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrVisitor.kt +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrVisitor.kt @@ -300,7 +300,7 @@ class Fir2IrVisitor( override fun visitAnonymousFunction(anonymousFunction: FirAnonymousFunction, data: Any?): IrElement { return anonymousFunction.convertWithOffsets { startOffset, endOffset -> - val irFunction = declarationStorage.getIrLocalFunction(anonymousFunction, conversionScope.parent(), shouldLeaveScope = false) + val irFunction = declarationStorage.getIrFunction(anonymousFunction, conversionScope.parent(), shouldLeaveScope = false) conversionScope.withFunction(irFunction) { setFunctionContent(irFunction.descriptor, anonymousFunction) } diff --git a/compiler/testData/codegen/box/classes/comanionObjectFieldVsClassField.kt b/compiler/testData/codegen/box/classes/comanionObjectFieldVsClassField.kt index 99584318a3a..b5249099f80 100644 --- a/compiler/testData/codegen/box/classes/comanionObjectFieldVsClassField.kt +++ b/compiler/testData/codegen/box/classes/comanionObjectFieldVsClassField.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME // WITH_RUNTIME diff --git a/compiler/testData/codegen/box/closures/extensionClosure.kt b/compiler/testData/codegen/box/closures/extensionClosure.kt index 4994de0a368..d4c73c7bcfe 100644 --- a/compiler/testData/codegen/box/closures/extensionClosure.kt +++ b/compiler/testData/codegen/box/closures/extensionClosure.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR class Point(val x : Int, val y : Int) fun box() : String { diff --git a/compiler/testData/codegen/box/closures/kt3738.kt b/compiler/testData/codegen/box/closures/kt3738.kt index 0f4b38e8eb9..a05dbde0ae1 100644 --- a/compiler/testData/codegen/box/closures/kt3738.kt +++ b/compiler/testData/codegen/box/closures/kt3738.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR class A { fun foo() {} fun bar(f: A.() -> Unit = {}) {} diff --git a/compiler/testData/codegen/box/contracts/constructorArgument.kt b/compiler/testData/codegen/box/contracts/constructorArgument.kt index 5781a14fd1e..7471b1adbf7 100644 --- a/compiler/testData/codegen/box/contracts/constructorArgument.kt +++ b/compiler/testData/codegen/box/contracts/constructorArgument.kt @@ -1,5 +1,4 @@ // !USE_EXPERIMENTAL: kotlin.contracts.ExperimentalContracts -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: NATIVE import kotlin.contracts.* diff --git a/compiler/testData/codegen/box/controlStructures/tryCatchInExpressions/kt17572_2_ext.kt b/compiler/testData/codegen/box/controlStructures/tryCatchInExpressions/kt17572_2_ext.kt index bbf5fd015cd..6f5cb1df234 100644 --- a/compiler/testData/codegen/box/controlStructures/tryCatchInExpressions/kt17572_2_ext.kt +++ b/compiler/testData/codegen/box/controlStructures/tryCatchInExpressions/kt17572_2_ext.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR fun zap(s: String) = s inline fun tryZap(s1: String, s2: String, fn: String.(String) -> String) = diff --git a/compiler/testData/codegen/box/controlStructures/tryCatchInExpressions/kt17572_ext.kt b/compiler/testData/codegen/box/controlStructures/tryCatchInExpressions/kt17572_ext.kt index 5419be42f51..8e9066f7cc7 100644 --- a/compiler/testData/codegen/box/controlStructures/tryCatchInExpressions/kt17572_ext.kt +++ b/compiler/testData/codegen/box/controlStructures/tryCatchInExpressions/kt17572_ext.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR fun zap(s: String) = s inline fun tryZap(string: String, fn: String.() -> String) = diff --git a/compiler/testData/codegen/box/extensionFunctions/kt13312.kt b/compiler/testData/codegen/box/extensionFunctions/kt13312.kt index 8d996d0f78a..097fa273eb5 100644 --- a/compiler/testData/codegen/box/extensionFunctions/kt13312.kt +++ b/compiler/testData/codegen/box/extensionFunctions/kt13312.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR fun test1(f: (Int) -> Int) = f(1) fun test2(f: Int.() -> Int) = 2.f() diff --git a/compiler/testData/codegen/box/extensionFunctions/kt3646.kt b/compiler/testData/codegen/box/extensionFunctions/kt3646.kt index 01e34851f60..c3f758cf9a5 100644 --- a/compiler/testData/codegen/box/extensionFunctions/kt3646.kt +++ b/compiler/testData/codegen/box/extensionFunctions/kt3646.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR fun test(cl: Int.() -> Int):Int = 11.cl() class Foo { diff --git a/compiler/testData/codegen/box/extensionFunctions/kt606.kt b/compiler/testData/codegen/box/extensionFunctions/kt606.kt index 3beee50f825..05db432964a 100644 --- a/compiler/testData/codegen/box/extensionFunctions/kt606.kt +++ b/compiler/testData/codegen/box/extensionFunctions/kt606.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS_IR // TODO: muted automatically, investigate should it be ran for JS or not // IGNORE_BACKEND: JS, NATIVE diff --git a/compiler/testData/codegen/box/extensionFunctions/nested2.kt b/compiler/testData/codegen/box/extensionFunctions/nested2.kt index 13038de459e..9c0aecd0ffb 100644 --- a/compiler/testData/codegen/box/extensionFunctions/nested2.kt +++ b/compiler/testData/codegen/box/extensionFunctions/nested2.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR fun box() : String { val y = 12 val op = { x:Int -> (x + y).toString() } diff --git a/compiler/testData/codegen/box/fullJdk/intCountDownLatchExtension.kt b/compiler/testData/codegen/box/fullJdk/intCountDownLatchExtension.kt index f15c6a446d0..de02f10104e 100644 --- a/compiler/testData/codegen/box/fullJdk/intCountDownLatchExtension.kt +++ b/compiler/testData/codegen/box/fullJdk/intCountDownLatchExtension.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM // FULL_JDK diff --git a/compiler/testData/codegen/box/functions/invoke/castFunctionToExtension.kt b/compiler/testData/codegen/box/functions/invoke/castFunctionToExtension.kt index 7fcf72bdce0..cb638d7b24f 100644 --- a/compiler/testData/codegen/box/functions/invoke/castFunctionToExtension.kt +++ b/compiler/testData/codegen/box/functions/invoke/castFunctionToExtension.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR fun box(): String { val f = fun (s: String): String = s val g = f as String.() -> String diff --git a/compiler/testData/codegen/box/functions/invoke/kt3450getAndInvoke.kt b/compiler/testData/codegen/box/functions/invoke/kt3450getAndInvoke.kt index eaa2890c3c9..012853d3a69 100644 --- a/compiler/testData/codegen/box/functions/invoke/kt3450getAndInvoke.kt +++ b/compiler/testData/codegen/box/functions/invoke/kt3450getAndInvoke.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR //KT-3450 get and invoke are not parsed in one expression public class A(val s: String) { diff --git a/compiler/testData/codegen/box/functions/kt3573.kt b/compiler/testData/codegen/box/functions/kt3573.kt index bf88c3890f5..e97d3620de0 100644 --- a/compiler/testData/codegen/box/functions/kt3573.kt +++ b/compiler/testData/codegen/box/functions/kt3573.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR class Data fun newInit(f: Data.() -> Data) = Data().f() diff --git a/compiler/testData/codegen/box/functions/kt3724.kt b/compiler/testData/codegen/box/functions/kt3724.kt index 835e9de578d..e1e5edac345 100644 --- a/compiler/testData/codegen/box/functions/kt3724.kt +++ b/compiler/testData/codegen/box/functions/kt3724.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR class Comment() { var article = "" } diff --git a/compiler/testData/codegen/box/functions/kt395.kt b/compiler/testData/codegen/box/functions/kt395.kt index 910b4d9c491..310640226e0 100644 --- a/compiler/testData/codegen/box/functions/kt395.kt +++ b/compiler/testData/codegen/box/functions/kt395.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR fun Any.with(operation : Any.() -> Any) = operation().toString() val f = { a : Int -> } diff --git a/compiler/testData/codegen/box/increment/memberExtOnLong.kt b/compiler/testData/codegen/box/increment/memberExtOnLong.kt index 57f3a95b8a3..c51bf9b901d 100644 --- a/compiler/testData/codegen/box/increment/memberExtOnLong.kt +++ b/compiler/testData/codegen/box/increment/memberExtOnLong.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // WITH_RUNTIME object ExtProvider { diff --git a/compiler/testData/codegen/box/inference/kt35684.kt b/compiler/testData/codegen/box/inference/kt35684.kt index a30d1b8c0c8..a8c96ba733e 100644 --- a/compiler/testData/codegen/box/inference/kt35684.kt +++ b/compiler/testData/codegen/box/inference/kt35684.kt @@ -1,6 +1,5 @@ // !LANGUAGE: +NewInference // !USE_EXPERIMENTAL: kotlin.Experimental -// IGNORE_BACKEND_FIR: JVM_IR // WITH_RUNTIME // ISSUE: KT-35684 diff --git a/compiler/testData/codegen/box/inference/kt36446.kt b/compiler/testData/codegen/box/inference/kt36446.kt index b309bb63fdf..06fbf4bb317 100644 --- a/compiler/testData/codegen/box/inference/kt36446.kt +++ b/compiler/testData/codegen/box/inference/kt36446.kt @@ -1,7 +1,6 @@ // !LANGUAGE: +NewInference // WITH_RUNTIME // KJS_WITH_FULL_RUNTIME -// IGNORE_BACKEND_FIR: JVM_IR // WITH_REFLECT import kotlin.experimental.ExperimentalTypeInference diff --git a/compiler/testData/codegen/box/jvmStatic/simple.kt b/compiler/testData/codegen/box/jvmStatic/simple.kt index b6e4cfa8a79..24289b13cfc 100644 --- a/compiler/testData/codegen/box/jvmStatic/simple.kt +++ b/compiler/testData/codegen/box/jvmStatic/simple.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM // WITH_RUNTIME diff --git a/compiler/testData/codegen/box/objects/privateExtensionFromInitializer_kt4543.kt b/compiler/testData/codegen/box/objects/privateExtensionFromInitializer_kt4543.kt index d097d3dc03f..ffcb2ada647 100644 --- a/compiler/testData/codegen/box/objects/privateExtensionFromInitializer_kt4543.kt +++ b/compiler/testData/codegen/box/objects/privateExtensionFromInitializer_kt4543.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR class A(val result: String) fun a(body: A.() -> String): String { diff --git a/compiler/testData/codegen/box/operatorConventions/plusExplicit.kt b/compiler/testData/codegen/box/operatorConventions/plusExplicit.kt index 3405df11963..78456f971c6 100644 --- a/compiler/testData/codegen/box/operatorConventions/plusExplicit.kt +++ b/compiler/testData/codegen/box/operatorConventions/plusExplicit.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME // WITH_RUNTIME diff --git a/compiler/testData/codegen/box/regressions/kt10143.kt b/compiler/testData/codegen/box/regressions/kt10143.kt index 9378ac5c3f6..33a0cbbce16 100644 --- a/compiler/testData/codegen/box/regressions/kt10143.kt +++ b/compiler/testData/codegen/box/regressions/kt10143.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // FILE: Outer.kt package another diff --git a/compiler/testData/codegen/box/safeCall/kt3430.kt b/compiler/testData/codegen/box/safeCall/kt3430.kt index d2c2e5b727f..19620029283 100644 --- a/compiler/testData/codegen/box/safeCall/kt3430.kt +++ b/compiler/testData/codegen/box/safeCall/kt3430.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR fun f(b : Int.(Int)->Int) = 1?.b(1) fun box(): String { diff --git a/compiler/testData/codegen/box/safeCall/safeCallOnLong.kt b/compiler/testData/codegen/box/safeCall/safeCallOnLong.kt index 65e9ba81a3f..9937adc2991 100644 --- a/compiler/testData/codegen/box/safeCall/safeCallOnLong.kt +++ b/compiler/testData/codegen/box/safeCall/safeCallOnLong.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR fun f(b : Long.(Long)->Long) = 1L?.b(2L) fun box(): String { diff --git a/compiler/testData/ir/irText/lambdas/extensionLambda.fir.txt b/compiler/testData/ir/irText/lambdas/extensionLambda.fir.txt index a9324a4e787..3002d793c2b 100644 --- a/compiler/testData/ir/irText/lambdas/extensionLambda.fir.txt +++ b/compiler/testData/ir/irText/lambdas/extensionLambda.fir.txt @@ -12,4 +12,4 @@ FILE fqName: fileName:/extensionLambda.kt BLOCK_BODY RETURN type=kotlin.Nothing from='local final fun (): kotlin.Int declared in .test1' CALL 'public open fun (): kotlin.Int declared in kotlin.String' type=kotlin.Int origin=GET_PROPERTY - $this: GET_VAR ': kotlin.String declared in special.' type=kotlin.String origin=null + $this: GET_VAR ': kotlin.String declared in .test1.' type=kotlin.String origin=null diff --git a/compiler/testData/ir/irText/lambdas/multipleImplicitReceivers.fir.txt b/compiler/testData/ir/irText/lambdas/multipleImplicitReceivers.fir.txt index 546e0de37bf..3c762d644a0 100644 --- a/compiler/testData/ir/irText/lambdas/multipleImplicitReceivers.fir.txt +++ b/compiler/testData/ir/irText/lambdas/multipleImplicitReceivers.fir.txt @@ -113,7 +113,7 @@ FILE fqName: fileName:/multipleImplicitReceivers.kt BLOCK_BODY RETURN type=kotlin.Nothing from='local final fun (): kotlin.Int declared in .test..' CALL 'public open fun invoke (): kotlin.Int [operator] declared in .IInvoke' type=kotlin.Int origin=null - $this: GET_VAR ': .IInvoke declared in special.' type=.IInvoke origin=null + $this: GET_VAR ': .IInvoke declared in .test...' type=.IInvoke origin=null $receiver: CALL 'public open fun (): .B declared in .IFoo' type=.B origin=GET_PROPERTY - $this: GET_VAR ': .IFoo declared in special.' type=.IFoo origin=null - $receiver: GET_VAR ': .A declared in special.' type=.A origin=null + $this: GET_VAR ': .IFoo declared in .test..' type=.IFoo origin=null + $receiver: GET_VAR ': .A declared in .test.' type=.A origin=null diff --git a/compiler/testData/ir/irText/stubs/builtinMap.fir.txt b/compiler/testData/ir/irText/stubs/builtinMap.fir.txt index 52f9cb333a0..01e4770f49d 100644 --- a/compiler/testData/ir/irText/stubs/builtinMap.fir.txt +++ b/compiler/testData/ir/irText/stubs/builtinMap.fir.txt @@ -28,7 +28,7 @@ FILE fqName: fileName:/builtinMap.kt BLOCK_BODY RETURN type=kotlin.Nothing from='local final fun (): kotlin.Unit declared in .plus' CALL 'public open fun put (p0: K of java.util.LinkedHashMap?, p1: V of java.util.LinkedHashMap?): V of java.util.LinkedHashMap? declared in java.util.LinkedHashMap' type=V1 of .plus? origin=null - $this: GET_VAR ': java.util.LinkedHashMap.plus?, V1 of .plus?> declared in special.' type=java.util.LinkedHashMap.plus?, V1 of .plus?> origin=null + $this: GET_VAR ': java.util.LinkedHashMap.plus?, V1 of .plus?> declared in .plus.' type=java.util.LinkedHashMap.plus?, V1 of .plus?> origin=null p0: CALL 'public final fun (): A of kotlin.Pair declared in kotlin.Pair' type=K1 of .plus origin=GET_PROPERTY $this: GET_VAR 'pair: kotlin.Pair.plus, V1 of .plus> declared in .plus' type=kotlin.Pair.plus, V1 of .plus> origin=null p1: CALL 'public final fun (): B of kotlin.Pair declared in kotlin.Pair' type=V1 of .plus origin=GET_PROPERTY diff --git a/compiler/testData/ir/irText/types/castsInsideCoroutineInference.fir.txt b/compiler/testData/ir/irText/types/castsInsideCoroutineInference.fir.txt index 274f249f8e9..9e5069d4237 100644 --- a/compiler/testData/ir/irText/types/castsInsideCoroutineInference.fir.txt +++ b/compiler/testData/ir/irText/types/castsInsideCoroutineInference.fir.txt @@ -11,7 +11,7 @@ FILE fqName: fileName:/castsInsideCoroutineInference.kt $receiver: VALUE_PARAMETER name: type:.FlowCollector.scopedFlow> BLOCK_BODY VAR name:collector type:.FlowCollector.scopedFlow> [val] - GET_VAR ': .FlowCollector.scopedFlow> declared in special.' type=.FlowCollector.scopedFlow> origin=null + GET_VAR ': .FlowCollector.scopedFlow> declared in .scopedFlow.' type=.FlowCollector.scopedFlow> origin=null CALL 'public final fun flowScope (block: kotlin.Function1<.CoroutineScope, R of .flowScope>): R of .flowScope [suspend] declared in ' type=kotlin.Unit origin=null : kotlin.Unit block: FUN_EXPR type=kotlin.Function1<.CoroutineScope, kotlin.Unit> origin=LAMBDA @@ -20,7 +20,7 @@ FILE fqName: fileName:/castsInsideCoroutineInference.kt BLOCK_BODY CALL 'public abstract fun invoke (p1: P1 of kotlin.Function2, p2: P2 of kotlin.Function2): R of kotlin.Function2 [operator] declared in kotlin.Function2' type=kotlin.Unit origin=INVOKE $this: GET_VAR 'block: kotlin.Function2<.CoroutineScope, .FlowCollector.scopedFlow>, kotlin.Unit> declared in .scopedFlow' type=kotlin.Function2<.CoroutineScope, .FlowCollector.scopedFlow>, kotlin.Unit> origin=null - p1: GET_VAR ': .CoroutineScope declared in special.' type=.CoroutineScope origin=null + p1: GET_VAR ': .CoroutineScope declared in .scopedFlow..' type=.CoroutineScope origin=null p2: GET_VAR 'val collector: .FlowCollector.scopedFlow> [val] declared in .scopedFlow.' type=.FlowCollector.scopedFlow> origin=null FUN name:onCompletion visibility:public modality:FINAL ($receiver:.Flow.onCompletion>, action:kotlin.Function2<.FlowCollector.onCompletion>, kotlin.Throwable?, kotlin.Unit>) returnType:.Flow.onCompletion> TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] @@ -37,7 +37,7 @@ FILE fqName: fileName:/castsInsideCoroutineInference.kt VAR name:safeCollector type:.SafeCollector.onCompletion> [val] CONSTRUCTOR_CALL 'public constructor (collector: .FlowCollector.SafeCollector>) [primary] declared in .SafeCollector' type=.SafeCollector.onCompletion> origin=null : T of .onCompletion - collector: GET_VAR ': .FlowCollector.onCompletion> declared in special.' type=.FlowCollector.onCompletion> origin=null + collector: GET_VAR ': .FlowCollector.onCompletion> declared in .onCompletion.' type=.FlowCollector.onCompletion> origin=null CALL 'public final fun invokeSafely (action: kotlin.Function2<.FlowCollector.invokeSafely>, kotlin.Throwable?, kotlin.Unit>): kotlin.Unit [suspend] declared in ' type=kotlin.Unit origin=null : T of .onCompletion $receiver: GET_VAR 'val safeCollector: .SafeCollector.onCompletion> [val] declared in .onCompletion.' type=.SafeCollector.onCompletion> origin=null @@ -81,7 +81,7 @@ FILE fqName: fileName:/castsInsideCoroutineInference.kt VAR name:channel type:.ChannelCoroutine [val] TYPE_OP type=.ChannelCoroutine origin=CAST typeOperand=.ChannelCoroutine CALL 'public abstract fun (): .SendChannel.ProducerScope> declared in .ProducerScope' type=.SendChannel origin=GET_PROPERTY - $this: GET_VAR ': .ProducerScope declared in special.' type=.ProducerScope origin=null + $this: GET_VAR ': .ProducerScope declared in .asFairChannel.' type=.ProducerScope origin=null CALL 'public abstract fun collect (collector: .FlowCollector.Flow>): kotlin.Unit [suspend] declared in .Flow' type=kotlin.Unit origin=null $this: GET_VAR 'flow: .Flow<*> declared in .asFairChannel' type=.Flow<*> origin=null collector: FUN_EXPR type=kotlin.Function1 origin=LAMBDA @@ -125,7 +125,7 @@ FILE fqName: fileName:/castsInsideCoroutineInference.kt RETURN type=kotlin.Nothing from='local final fun (value: kotlin.Any?): kotlin.Unit declared in .asChannel.' CALL 'public abstract fun send (e: E of .SendChannel): kotlin.Unit [suspend] declared in .SendChannel' type=kotlin.Unit origin=null $this: CALL 'public abstract fun (): .SendChannel.ProducerScope> declared in .ProducerScope' type=.SendChannel origin=GET_PROPERTY - $this: GET_VAR ': .ProducerScope declared in special.' type=.ProducerScope origin=null + $this: GET_VAR ': .ProducerScope declared in .asChannel.' type=.ProducerScope origin=null e: BLOCK type=kotlin.Any origin=ELVIS VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.Any? [val] GET_VAR 'value: kotlin.Any? declared in .asChannel..' type=kotlin.Any? origin=null