diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/inline/SourceCompilerForInline.kt b/compiler/backend/src/org/jetbrains/kotlin/codegen/inline/SourceCompilerForInline.kt index d7bd9dff72c..c9f91a0f351 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/inline/SourceCompilerForInline.kt +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/inline/SourceCompilerForInline.kt @@ -437,6 +437,6 @@ class PsiSourceCompilerForInline(private val codegen: ExpressionCodegen, overrid } } -private fun DeclarationDescriptor.isInlineOrInsideInline(): Boolean = +fun DeclarationDescriptor.isInlineOrInsideInline(): Boolean = if (this is FunctionDescriptor && isInline) true else containingDeclaration?.isInlineOrInsideInline() == true diff --git a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/CoroutineCodegen.kt b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/CoroutineCodegen.kt index 4d5e539f989..1be1a4745cb 100644 --- a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/CoroutineCodegen.kt +++ b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/CoroutineCodegen.kt @@ -260,7 +260,7 @@ internal fun generateFakeContinuationConstructorCall( load(continuationIndex, Type.getObjectType("kotlin/coroutines/Continuation")) invokespecial(continuationType.internalName, "", "(Lkotlin/coroutines/Continuation;)V", false) } - pop() addFakeContinuationConstructorCallMarker(this, false) + pop() } } \ No newline at end of file diff --git a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/IrSourceCompilerForInline.kt b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/IrSourceCompilerForInline.kt index f28e9c75180..781b096a7fa 100644 --- a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/IrSourceCompilerForInline.kt +++ b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/IrSourceCompilerForInline.kt @@ -68,8 +68,7 @@ class IrSourceCompilerForInline( root.classCodegen.type.internalName, root.signature.asmMethod.name, root.signature.asmMethod.descriptor, - //compilationContextFunctionDescriptor.isInlineOrInsideInline() - false, + compilationContextFunctionDescriptor.isInlineOrInsideInline(), compilationContextFunctionDescriptor.isSuspend, findElement()?.let { CodegenUtil.getLineNumberForElement(it, false) } ?: 0 ) diff --git a/compiler/testData/codegen/box/coroutines/javaInterop/returnLambda.kt b/compiler/testData/codegen/box/coroutines/javaInterop/returnLambda.kt index d91352f60f0..0a8205c76ae 100644 --- a/compiler/testData/codegen/box/coroutines/javaInterop/returnLambda.kt +++ b/compiler/testData/codegen/box/coroutines/javaInterop/returnLambda.kt @@ -1,5 +1,4 @@ // IGNORE_BACKEND_FIR: JVM_IR -// IGNORE_BACKEND: JVM_IR // TARGET_BACKEND: JVM // COMMON_COROUTINES_TEST // WITH_RUNTIME diff --git a/compiler/testData/codegen/box/coroutines/javaInterop/returnObject.kt b/compiler/testData/codegen/box/coroutines/javaInterop/returnObject.kt index b7904832dfe..d1e3a64cd98 100644 --- a/compiler/testData/codegen/box/coroutines/javaInterop/returnObject.kt +++ b/compiler/testData/codegen/box/coroutines/javaInterop/returnObject.kt @@ -1,5 +1,4 @@ // IGNORE_BACKEND_FIR: JVM_IR -// IGNORE_BACKEND: JVM_IR // TARGET_BACKEND: JVM // COMMON_COROUTINES_TEST // WITH_RUNTIME diff --git a/compiler/testData/codegen/box/coroutines/tailCallOptimizations/innerObjectRetransformation_ir.txt b/compiler/testData/codegen/box/coroutines/tailCallOptimizations/innerObjectRetransformation_ir.txt index ffe3d25608b..9308395d3aa 100644 --- a/compiler/testData/codegen/box/coroutines/tailCallOptimizations/innerObjectRetransformation_ir.txt +++ b/compiler/testData/codegen/box/coroutines/tailCallOptimizations/innerObjectRetransformation_ir.txt @@ -19,10 +19,20 @@ final class flow/InnerObjectRetransformationKt$box$1 { public final @org.jetbrains.annotations.Nullable method invokeSuspend(@org.jetbrains.annotations.NotNull p0: java.lang.Object): java.lang.Object } +@kotlin.Metadata +final class flow/InnerObjectRetransformationKt$check$$inlined$collect$1$1 { + field label: int + @org.jetbrains.annotations.NotNull field result: java.lang.Object + synthetic final field this$0: flow.InnerObjectRetransformationKt$check$$inlined$collect$1 + public method (p0: flow.InnerObjectRetransformationKt$check$$inlined$collect$1, p1: kotlin.coroutines.Continuation): void + public final @org.jetbrains.annotations.Nullable method invokeSuspend(@org.jetbrains.annotations.NotNull p0: java.lang.Object): java.lang.Object +} + @kotlin.Metadata public final class flow/InnerObjectRetransformationKt$check$$inlined$collect$1 { inner class flow/InnerObjectRetransformationKt$check$$inlined$collect$1 public method (): void + public @org.jetbrains.annotations.Nullable method emit$$forInline(@org.jetbrains.annotations.NotNull p0: java.lang.Object, @org.jetbrains.annotations.NotNull p1: kotlin.coroutines.Continuation): java.lang.Object public @org.jetbrains.annotations.Nullable method emit(@org.jetbrains.annotations.NotNull p0: java.lang.Object, @org.jetbrains.annotations.NotNull p1: kotlin.coroutines.Continuation): java.lang.Object } @@ -43,10 +53,12 @@ final class flow/InnerObjectRetransformationKt$check$$inlined$flow$1$1 { public final class flow/InnerObjectRetransformationKt$check$$inlined$flow$1 { inner class flow/InnerObjectRetransformationKt$check$$inlined$flow$1 public method (): void + public @org.jetbrains.annotations.Nullable method collect$$forInline(@org.jetbrains.annotations.NotNull p0: flow.FlowCollector, @org.jetbrains.annotations.NotNull p1: kotlin.coroutines.Continuation): java.lang.Object public @org.jetbrains.annotations.Nullable method collect(@org.jetbrains.annotations.NotNull p0: flow.FlowCollector, @org.jetbrains.annotations.NotNull p1: kotlin.coroutines.Continuation): java.lang.Object } @kotlin.Metadata +@kotlin.coroutines.jvm.internal.DebugMetadata final class flow/InnerObjectRetransformationKt$check$$inlined$flowWith$1$1 { field L$0: java.lang.Object field L$1: java.lang.Object @@ -63,6 +75,7 @@ public final class flow/InnerObjectRetransformationKt$check$$inlined$flowWith$1 synthetic final field $this$inlined: flow.Flow inner class flow/InnerObjectRetransformationKt$check$$inlined$flowWith$1 public method (p0: flow.Flow): void + public @org.jetbrains.annotations.Nullable method collect$$forInline(@org.jetbrains.annotations.NotNull p0: flow.FlowCollector, @org.jetbrains.annotations.NotNull p1: kotlin.coroutines.Continuation): java.lang.Object public @org.jetbrains.annotations.Nullable method collect(@org.jetbrains.annotations.NotNull p0: flow.FlowCollector, @org.jetbrains.annotations.NotNull p1: kotlin.coroutines.Continuation): java.lang.Object } @@ -139,6 +152,7 @@ public final class flow/InnerObjectRetransformationKt$flowWith$$inlined$flow$1 { synthetic final field $this$inlined: flow.Flow inner class flow/InnerObjectRetransformationKt$flowWith$$inlined$flow$1 public method (p0: kotlin.jvm.functions.Function2, p1: flow.Flow): void + public @org.jetbrains.annotations.Nullable method collect$$forInline(@org.jetbrains.annotations.NotNull p0: flow.FlowCollector, @org.jetbrains.annotations.NotNull p1: kotlin.coroutines.Continuation): java.lang.Object public @org.jetbrains.annotations.Nullable method collect(@org.jetbrains.annotations.NotNull p0: flow.FlowCollector, @org.jetbrains.annotations.NotNull p1: kotlin.coroutines.Continuation): java.lang.Object } @@ -161,6 +175,7 @@ public final class flow/InnerObjectRetransformationKt$flowWith$$inlined$flow$2 { synthetic final field $this$inlined: flow.Flow inner class flow/InnerObjectRetransformationKt$flowWith$$inlined$flow$2 public method (p0: kotlin.jvm.functions.Function2, p1: flow.Flow): void + public @org.jetbrains.annotations.Nullable method collect$$forInline(@org.jetbrains.annotations.NotNull p0: flow.FlowCollector, @org.jetbrains.annotations.NotNull p1: kotlin.coroutines.Continuation): java.lang.Object public @org.jetbrains.annotations.Nullable method collect(@org.jetbrains.annotations.NotNull p0: flow.FlowCollector, @org.jetbrains.annotations.NotNull p1: kotlin.coroutines.Continuation): java.lang.Object } diff --git a/compiler/testData/codegen/boxInline/suspend/stateMachine/innerObjectInsideInnerObject.kt b/compiler/testData/codegen/boxInline/suspend/stateMachine/innerObjectInsideInnerObject.kt index a26d49d425a..a5a336fbe4a 100644 --- a/compiler/testData/codegen/boxInline/suspend/stateMachine/innerObjectInsideInnerObject.kt +++ b/compiler/testData/codegen/boxInline/suspend/stateMachine/innerObjectInsideInnerObject.kt @@ -1,5 +1,3 @@ -// IGNORE_BACKEND: JVM_IR -// IGNORE_BACKEND_MULTI_MODULE: JVM_IR // FILE: inlined.kt // COMMON_COROUTINES_TEST // WITH_RUNTIME diff --git a/compiler/testData/codegen/boxInline/suspend/stateMachine/innerObjectRetransformation.kt b/compiler/testData/codegen/boxInline/suspend/stateMachine/innerObjectRetransformation.kt index ce7c893c3ba..72049cdce51 100644 --- a/compiler/testData/codegen/boxInline/suspend/stateMachine/innerObjectRetransformation.kt +++ b/compiler/testData/codegen/boxInline/suspend/stateMachine/innerObjectRetransformation.kt @@ -1,5 +1,3 @@ -// IGNORE_BACKEND: JVM_IR -// IGNORE_BACKEND_MULTI_MODULE: JVM_IR // COMMON_COROUTINES_TEST // WITH_RUNTIME // WITH_COROUTINES diff --git a/compiler/testData/codegen/boxInline/suspend/stateMachine/numberOfSuspentions.kt b/compiler/testData/codegen/boxInline/suspend/stateMachine/numberOfSuspentions.kt index 5f772b2bcf1..3cf406512ec 100644 --- a/compiler/testData/codegen/boxInline/suspend/stateMachine/numberOfSuspentions.kt +++ b/compiler/testData/codegen/boxInline/suspend/stateMachine/numberOfSuspentions.kt @@ -1,5 +1,3 @@ -// IGNORE_BACKEND: JVM_IR -// IGNORE_BACKEND_MULTI_MODULE: JVM_IR // FILE: inlined.kt // COMMON_COROUTINES_TEST // WITH_RUNTIME diff --git a/compiler/testData/codegen/boxInline/suspend/stateMachine/passLambda.kt b/compiler/testData/codegen/boxInline/suspend/stateMachine/passLambda.kt index c4971a4f0e0..2ad6b7dd82f 100644 --- a/compiler/testData/codegen/boxInline/suspend/stateMachine/passLambda.kt +++ b/compiler/testData/codegen/boxInline/suspend/stateMachine/passLambda.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_MULTI_MODULE: JVM_IR // COMMON_COROUTINES_TEST // WITH_RUNTIME // WITH_COROUTINES diff --git a/compiler/testData/codegen/boxInline/suspend/stateMachine/passParameter.kt b/compiler/testData/codegen/boxInline/suspend/stateMachine/passParameter.kt index f8c2dd254ac..0592b2005bd 100644 --- a/compiler/testData/codegen/boxInline/suspend/stateMachine/passParameter.kt +++ b/compiler/testData/codegen/boxInline/suspend/stateMachine/passParameter.kt @@ -1,5 +1,3 @@ -// IGNORE_BACKEND: JVM_IR -// IGNORE_BACKEND_MULTI_MODULE: JVM_IR // COMMON_COROUTINES_TEST // WITH_RUNTIME // WITH_COROUTINES diff --git a/compiler/testData/codegen/boxInline/suspend/stateMachine/passParameterLambda.kt b/compiler/testData/codegen/boxInline/suspend/stateMachine/passParameterLambda.kt index 2b47c25a9a3..d8c3b9f2a92 100644 --- a/compiler/testData/codegen/boxInline/suspend/stateMachine/passParameterLambda.kt +++ b/compiler/testData/codegen/boxInline/suspend/stateMachine/passParameterLambda.kt @@ -1,5 +1,3 @@ -// IGNORE_BACKEND: JVM_IR -// IGNORE_BACKEND_MULTI_MODULE: JVM_IR // COMMON_COROUTINES_TEST // WITH_RUNTIME // WITH_COROUTINES