Introduce CHECK_TAIL_CALL_OPTIMIZATION directive
This directive generates TailCallOptimizationChecker in package helpers. The check for tail call optimization is based on coroutine stack traces bug (feature?): when tail call optimization hits, the continuation object is not generated. Thus, there is no debug metadata for this suspend function. Consequently, the coroutines stack trace does not contain stack trace element for that function. This check is performed by TailCallOptimizationChecker. Since this is runtime check, unlike bytecode tests, it does not require test data adjustments on each codegen or inliner change. Since the check is based on debug metadata, which is JVM specific, there is not support for other backends yet.
This commit is contained in:
-1
@@ -3,7 +3,6 @@
|
||||
// COMMON_COROUTINES_TEST
|
||||
// WITH_RUNTIME
|
||||
// WITH_COROUTINES
|
||||
// CHECK_BYTECODE_LISTING
|
||||
|
||||
import helpers.*
|
||||
import COROUTINES_PACKAGE.*
|
||||
@@ -1,13 +1,14 @@
|
||||
// IGNORE_BACKEND: JVM_IR
|
||||
// COMMON_COROUTINES_TEST
|
||||
// TARGET_BACKEND: JVM
|
||||
// FULL_JDK
|
||||
// WITH_RUNTIME
|
||||
// WITH_COROUTINES
|
||||
// CHECK_BYTECODE_LISTING
|
||||
|
||||
// CHECK_TAIL_CALL_OPTIMIZATION
|
||||
import helpers.*
|
||||
import COROUTINES_PACKAGE.*
|
||||
import kotlin.coroutines.*
|
||||
import kotlin.coroutines.intrinsics.*
|
||||
|
||||
suspend fun dummy(): Unit = Unit
|
||||
suspend fun dummy() = TailCallOptimizationChecker.saveStackTrace()
|
||||
suspend fun test(): Int = 1.also {
|
||||
dummy()
|
||||
}
|
||||
@@ -21,5 +22,6 @@ fun box(): String {
|
||||
builder {
|
||||
res = test()
|
||||
}
|
||||
TailCallOptimizationChecker.checkStateMachineIn("test")
|
||||
return if (res == 1) "OK" else "FAIL"
|
||||
}
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
@kotlin.coroutines.jvm.internal.DebugMetadata
|
||||
@kotlin.Metadata
|
||||
final class AlsoKt$box$1 {
|
||||
synthetic final field $res: kotlin.jvm.internal.Ref$IntRef
|
||||
field L$0: java.lang.Object
|
||||
field label: int
|
||||
inner class AlsoKt$box$1
|
||||
method <init>(p0: kotlin.jvm.internal.Ref$IntRef, p1: kotlin.coroutines.Continuation): void
|
||||
public final @org.jetbrains.annotations.NotNull method create(@org.jetbrains.annotations.NotNull p0: kotlin.coroutines.Continuation): kotlin.coroutines.Continuation
|
||||
public final method invoke(p0: java.lang.Object): java.lang.Object
|
||||
public final @org.jetbrains.annotations.Nullable method invokeSuspend(@org.jetbrains.annotations.NotNull p0: java.lang.Object): java.lang.Object
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
@kotlin.coroutines.jvm.internal.DebugMetadata
|
||||
final class AlsoKt$test$1 {
|
||||
field I$0: int
|
||||
field L$0: java.lang.Object
|
||||
field label: int
|
||||
synthetic field result: java.lang.Object
|
||||
inner class AlsoKt$test$1
|
||||
method <init>(p0: 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 AlsoKt {
|
||||
inner class AlsoKt$box$1
|
||||
inner class AlsoKt$test$1
|
||||
public final static @org.jetbrains.annotations.NotNull method box(): java.lang.String
|
||||
public final static method builder(@org.jetbrains.annotations.NotNull p0: kotlin.jvm.functions.Function1): void
|
||||
public final static @org.jetbrains.annotations.Nullable method dummy(@org.jetbrains.annotations.NotNull p0: kotlin.coroutines.Continuation): java.lang.Object
|
||||
public final static @org.jetbrains.annotations.Nullable method test(@org.jetbrains.annotations.NotNull p0: kotlin.coroutines.Continuation): java.lang.Object
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
@kotlin.Metadata
|
||||
final class AlsoKt$box$1 {
|
||||
synthetic final field $res: kotlin.jvm.internal.Ref$IntRef
|
||||
field L$0: java.lang.Object
|
||||
inner class AlsoKt$box$1
|
||||
method <init>(p0: kotlin.jvm.internal.Ref$IntRef, p1: kotlin.coroutines.experimental.Continuation): void
|
||||
public final @org.jetbrains.annotations.NotNull method create(@org.jetbrains.annotations.NotNull p0: kotlin.coroutines.experimental.Continuation): kotlin.coroutines.experimental.Continuation
|
||||
public final @org.jetbrains.annotations.Nullable method doResume(@org.jetbrains.annotations.Nullable p0: java.lang.Object, @org.jetbrains.annotations.Nullable p1: java.lang.Throwable): java.lang.Object
|
||||
public final method invoke(p0: java.lang.Object): java.lang.Object
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
final class AlsoKt$test$1 {
|
||||
field I$0: int
|
||||
field L$0: java.lang.Object
|
||||
synthetic field data: java.lang.Object
|
||||
synthetic field exception: java.lang.Throwable
|
||||
inner class AlsoKt$test$1
|
||||
method <init>(p0: kotlin.coroutines.experimental.Continuation): void
|
||||
public final @org.jetbrains.annotations.Nullable method doResume(@org.jetbrains.annotations.Nullable p0: java.lang.Object, @org.jetbrains.annotations.Nullable p1: java.lang.Throwable): java.lang.Object
|
||||
synthetic final method getLabel(): int
|
||||
synthetic final method setLabel(p0: int): void
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
public final class AlsoKt {
|
||||
inner class AlsoKt$box$1
|
||||
inner class AlsoKt$test$1
|
||||
public final static @org.jetbrains.annotations.NotNull method box(): java.lang.String
|
||||
public final static method builder(@org.jetbrains.annotations.NotNull p0: kotlin.jvm.functions.Function1): void
|
||||
public final static @org.jetbrains.annotations.Nullable method dummy(@org.jetbrains.annotations.NotNull p0: kotlin.coroutines.experimental.Continuation): java.lang.Object
|
||||
public final static @org.jetbrains.annotations.Nullable method test(@org.jetbrains.annotations.NotNull p0: kotlin.coroutines.experimental.Continuation): java.lang.Object
|
||||
}
|
||||
@@ -1,83 +0,0 @@
|
||||
@kotlin.coroutines.jvm.internal.DebugMetadata
|
||||
@kotlin.Metadata
|
||||
public final class EpamKt$box$1$invokeSuspend$$inlined$zip$1 {
|
||||
synthetic final field $source1: MyDeferred
|
||||
synthetic final field $source2: MyDeferred
|
||||
field L$0: java.lang.Object
|
||||
field label: int
|
||||
inner class EpamKt$box$1$invokeSuspend$$inlined$zip$1
|
||||
public method <init>(p0: MyDeferred, p1: MyDeferred, p2: kotlin.coroutines.Continuation): void
|
||||
public final @org.jetbrains.annotations.NotNull method create(@org.jetbrains.annotations.NotNull p0: kotlin.coroutines.Continuation): kotlin.coroutines.Continuation
|
||||
public final method invoke(p0: java.lang.Object): java.lang.Object
|
||||
public final @org.jetbrains.annotations.Nullable method invokeSuspend(@org.jetbrains.annotations.NotNull p0: java.lang.Object): java.lang.Object
|
||||
}
|
||||
|
||||
@kotlin.coroutines.jvm.internal.DebugMetadata
|
||||
@kotlin.Metadata
|
||||
final class EpamKt$box$1 {
|
||||
synthetic final field $first: MyDeferred
|
||||
synthetic final field $result: kotlin.jvm.internal.Ref$IntRef
|
||||
synthetic final field $second: MyDeferred
|
||||
field L$0: java.lang.Object
|
||||
field label: int
|
||||
inner class EpamKt$box$1
|
||||
method <init>(p0: kotlin.jvm.internal.Ref$IntRef, p1: MyDeferred, p2: MyDeferred, p3: kotlin.coroutines.Continuation): void
|
||||
public final @org.jetbrains.annotations.NotNull method create(@org.jetbrains.annotations.NotNull p0: kotlin.coroutines.Continuation): kotlin.coroutines.Continuation
|
||||
public final method invoke(p0: java.lang.Object): java.lang.Object
|
||||
public final @org.jetbrains.annotations.Nullable method invokeSuspend(@org.jetbrains.annotations.NotNull p0: java.lang.Object): java.lang.Object
|
||||
}
|
||||
|
||||
@kotlin.coroutines.jvm.internal.DebugMetadata
|
||||
@kotlin.Metadata
|
||||
final class EpamKt$box$first$1 {
|
||||
field label: int
|
||||
inner class EpamKt$box$first$1
|
||||
method <init>(p0: kotlin.coroutines.Continuation): void
|
||||
public final @org.jetbrains.annotations.NotNull method create(@org.jetbrains.annotations.NotNull p0: kotlin.coroutines.Continuation): kotlin.coroutines.Continuation
|
||||
public final method invoke(p0: java.lang.Object): java.lang.Object
|
||||
public final @org.jetbrains.annotations.Nullable method invokeSuspend(@org.jetbrains.annotations.NotNull p0: java.lang.Object): java.lang.Object
|
||||
}
|
||||
|
||||
@kotlin.coroutines.jvm.internal.DebugMetadata
|
||||
@kotlin.Metadata
|
||||
final class EpamKt$box$second$1 {
|
||||
field label: int
|
||||
inner class EpamKt$box$second$1
|
||||
method <init>(p0: kotlin.coroutines.Continuation): void
|
||||
public final @org.jetbrains.annotations.NotNull method create(@org.jetbrains.annotations.NotNull p0: kotlin.coroutines.Continuation): kotlin.coroutines.Continuation
|
||||
public final method invoke(p0: java.lang.Object): java.lang.Object
|
||||
public final @org.jetbrains.annotations.Nullable method invokeSuspend(@org.jetbrains.annotations.NotNull p0: java.lang.Object): java.lang.Object
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
public final class EpamKt$zip$1 {
|
||||
synthetic final field $source1: MyDeferred
|
||||
synthetic final field $source2: MyDeferred
|
||||
synthetic final field $zipper: kotlin.jvm.functions.Function2
|
||||
field label: int
|
||||
inner class EpamKt$zip$1
|
||||
public method <init>(p0: kotlin.jvm.functions.Function2, p1: MyDeferred, p2: MyDeferred, p3: kotlin.coroutines.Continuation): void
|
||||
public final @org.jetbrains.annotations.NotNull method create(@org.jetbrains.annotations.NotNull p0: kotlin.coroutines.Continuation): kotlin.coroutines.Continuation
|
||||
public final method invoke(p0: java.lang.Object): java.lang.Object
|
||||
public final @org.jetbrains.annotations.Nullable method invokeSuspend(@org.jetbrains.annotations.NotNull p0: java.lang.Object): java.lang.Object
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
public final class EpamKt {
|
||||
inner class EpamKt$box$1
|
||||
inner class EpamKt$box$first$1
|
||||
inner class EpamKt$box$second$1
|
||||
inner class EpamKt$zip$1
|
||||
public final static @org.jetbrains.annotations.NotNull method async(@org.jetbrains.annotations.NotNull p0: kotlin.jvm.functions.Function1): MyDeferred
|
||||
public final static @org.jetbrains.annotations.NotNull method box(): java.lang.String
|
||||
public final static method builder(@org.jetbrains.annotations.NotNull p0: kotlin.jvm.functions.Function1): void
|
||||
public final static @org.jetbrains.annotations.NotNull method zip(@org.jetbrains.annotations.NotNull p0: MyDeferred, @org.jetbrains.annotations.NotNull p1: MyDeferred, @org.jetbrains.annotations.NotNull p2: kotlin.jvm.functions.Function2): MyDeferred
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
public final class MyDeferred {
|
||||
private final @org.jetbrains.annotations.NotNull field t: kotlin.jvm.functions.Function1
|
||||
public method <init>(@org.jetbrains.annotations.NotNull p0: kotlin.jvm.functions.Function1): void
|
||||
public final @org.jetbrains.annotations.Nullable method await(@org.jetbrains.annotations.NotNull p0: kotlin.coroutines.Continuation): java.lang.Object
|
||||
public final @org.jetbrains.annotations.NotNull method getT(): kotlin.jvm.functions.Function1
|
||||
}
|
||||
@@ -1,74 +0,0 @@
|
||||
@kotlin.Metadata
|
||||
public final class EpamKt$box$1$doResume$$inlined$zip$1 {
|
||||
synthetic final field $source1: MyDeferred
|
||||
synthetic final field $source2: MyDeferred
|
||||
field L$0: java.lang.Object
|
||||
inner class EpamKt$box$1$doResume$$inlined$zip$1
|
||||
public method <init>(p0: MyDeferred, p1: MyDeferred, p2: kotlin.coroutines.experimental.Continuation): void
|
||||
public final @org.jetbrains.annotations.NotNull method create(@org.jetbrains.annotations.NotNull p0: kotlin.coroutines.experimental.Continuation): kotlin.coroutines.experimental.Continuation
|
||||
public final @org.jetbrains.annotations.Nullable method doResume(@org.jetbrains.annotations.Nullable p0: java.lang.Object, @org.jetbrains.annotations.Nullable p1: java.lang.Throwable): java.lang.Object
|
||||
public final method invoke(p0: java.lang.Object): java.lang.Object
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
final class EpamKt$box$1 {
|
||||
synthetic final field $first: MyDeferred
|
||||
synthetic final field $result: kotlin.jvm.internal.Ref$IntRef
|
||||
synthetic final field $second: MyDeferred
|
||||
field L$0: java.lang.Object
|
||||
inner class EpamKt$box$1
|
||||
method <init>(p0: kotlin.jvm.internal.Ref$IntRef, p1: MyDeferred, p2: MyDeferred, p3: kotlin.coroutines.experimental.Continuation): void
|
||||
public final @org.jetbrains.annotations.NotNull method create(@org.jetbrains.annotations.NotNull p0: kotlin.coroutines.experimental.Continuation): kotlin.coroutines.experimental.Continuation
|
||||
public final @org.jetbrains.annotations.Nullable method doResume(@org.jetbrains.annotations.Nullable p0: java.lang.Object, @org.jetbrains.annotations.Nullable p1: java.lang.Throwable): java.lang.Object
|
||||
public final method invoke(p0: java.lang.Object): java.lang.Object
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
final class EpamKt$box$first$1 {
|
||||
inner class EpamKt$box$first$1
|
||||
method <init>(p0: kotlin.coroutines.experimental.Continuation): void
|
||||
public final @org.jetbrains.annotations.NotNull method create(@org.jetbrains.annotations.NotNull p0: kotlin.coroutines.experimental.Continuation): kotlin.coroutines.experimental.Continuation
|
||||
public final @org.jetbrains.annotations.Nullable method doResume(@org.jetbrains.annotations.Nullable p0: java.lang.Object, @org.jetbrains.annotations.Nullable p1: java.lang.Throwable): java.lang.Object
|
||||
public final method invoke(p0: java.lang.Object): java.lang.Object
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
final class EpamKt$box$second$1 {
|
||||
inner class EpamKt$box$second$1
|
||||
method <init>(p0: kotlin.coroutines.experimental.Continuation): void
|
||||
public final @org.jetbrains.annotations.NotNull method create(@org.jetbrains.annotations.NotNull p0: kotlin.coroutines.experimental.Continuation): kotlin.coroutines.experimental.Continuation
|
||||
public final @org.jetbrains.annotations.Nullable method doResume(@org.jetbrains.annotations.Nullable p0: java.lang.Object, @org.jetbrains.annotations.Nullable p1: java.lang.Throwable): java.lang.Object
|
||||
public final method invoke(p0: java.lang.Object): java.lang.Object
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
public final class EpamKt$zip$1 {
|
||||
synthetic final field $source1: MyDeferred
|
||||
synthetic final field $source2: MyDeferred
|
||||
synthetic final field $zipper: kotlin.jvm.functions.Function2
|
||||
inner class EpamKt$zip$1
|
||||
public method <init>(p0: kotlin.jvm.functions.Function2, p1: MyDeferred, p2: MyDeferred, p3: kotlin.coroutines.experimental.Continuation): void
|
||||
public final @org.jetbrains.annotations.NotNull method create(@org.jetbrains.annotations.NotNull p0: kotlin.coroutines.experimental.Continuation): kotlin.coroutines.experimental.Continuation
|
||||
public final @org.jetbrains.annotations.Nullable method doResume(@org.jetbrains.annotations.Nullable p0: java.lang.Object, @org.jetbrains.annotations.Nullable p1: java.lang.Throwable): java.lang.Object
|
||||
public final method invoke(p0: java.lang.Object): java.lang.Object
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
public final class EpamKt {
|
||||
inner class EpamKt$box$1
|
||||
inner class EpamKt$box$first$1
|
||||
inner class EpamKt$box$second$1
|
||||
inner class EpamKt$zip$1
|
||||
public final static @org.jetbrains.annotations.NotNull method async(@org.jetbrains.annotations.NotNull p0: kotlin.jvm.functions.Function1): MyDeferred
|
||||
public final static @org.jetbrains.annotations.NotNull method box(): java.lang.String
|
||||
public final static method builder(@org.jetbrains.annotations.NotNull p0: kotlin.jvm.functions.Function1): void
|
||||
public final static @org.jetbrains.annotations.NotNull method zip(@org.jetbrains.annotations.NotNull p0: MyDeferred, @org.jetbrains.annotations.NotNull p1: MyDeferred, @org.jetbrains.annotations.NotNull p2: kotlin.jvm.functions.Function2): MyDeferred
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
public final class MyDeferred {
|
||||
private final @org.jetbrains.annotations.NotNull field t: kotlin.jvm.functions.Function1
|
||||
public method <init>(@org.jetbrains.annotations.NotNull p0: kotlin.jvm.functions.Function1): void
|
||||
public final @org.jetbrains.annotations.Nullable method await(@org.jetbrains.annotations.NotNull p0: kotlin.coroutines.experimental.Continuation): java.lang.Object
|
||||
public final @org.jetbrains.annotations.NotNull method getT(): kotlin.jvm.functions.Function1
|
||||
}
|
||||
+8
-6
@@ -1,15 +1,15 @@
|
||||
// IGNORE_BACKEND: JVM_IR
|
||||
// TARGET_BACKEND: JVM
|
||||
// FULL_JDK
|
||||
// WITH_RUNTIME
|
||||
// WITH_COROUTINES
|
||||
// COMMON_COROUTINES_TEST
|
||||
// CHECK_TAIL_CALL_OPTIMIZATION
|
||||
import helpers.*
|
||||
// CHECK_BYTECODE_LISTING
|
||||
// CHECK_NEW_COUNT: function=suspendHere count=1
|
||||
// CHECK_NEW_COUNT: function=mainSuspend count=1
|
||||
import COROUTINES_PACKAGE.*
|
||||
import COROUTINES_PACKAGE.intrinsics.*
|
||||
import kotlin.coroutines.*
|
||||
import kotlin.coroutines.intrinsics.*
|
||||
|
||||
inline suspend fun suspendThere(v: String): String = suspendCoroutineUninterceptedOrReturn { x ->
|
||||
TailCallOptimizationChecker.saveStackTrace(x)
|
||||
x.resume(v)
|
||||
COROUTINE_SUSPENDED
|
||||
}
|
||||
@@ -30,5 +30,7 @@ fun box(): String {
|
||||
result = mainSuspend()
|
||||
}
|
||||
|
||||
TailCallOptimizationChecker.checkStateMachineIn("mainSuspend")
|
||||
|
||||
return result
|
||||
}
|
||||
|
||||
-50
@@ -1,50 +0,0 @@
|
||||
@kotlin.coroutines.jvm.internal.DebugMetadata
|
||||
@kotlin.Metadata
|
||||
final class InlineWithStateMachineKt$box$1 {
|
||||
synthetic final field $result: kotlin.jvm.internal.Ref$ObjectRef
|
||||
field L$0: java.lang.Object
|
||||
field label: int
|
||||
inner class InlineWithStateMachineKt$box$1
|
||||
method <init>(p0: kotlin.jvm.internal.Ref$ObjectRef, p1: kotlin.coroutines.Continuation): void
|
||||
public final @org.jetbrains.annotations.NotNull method create(@org.jetbrains.annotations.NotNull p0: kotlin.coroutines.Continuation): kotlin.coroutines.Continuation
|
||||
public final method invoke(p0: java.lang.Object): java.lang.Object
|
||||
public final @org.jetbrains.annotations.Nullable method invokeSuspend(@org.jetbrains.annotations.NotNull p0: java.lang.Object): java.lang.Object
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
@kotlin.coroutines.jvm.internal.DebugMetadata
|
||||
final class InlineWithStateMachineKt$mainSuspend$1 {
|
||||
field L$0: java.lang.Object
|
||||
field L$1: java.lang.Object
|
||||
field label: int
|
||||
synthetic field result: java.lang.Object
|
||||
inner class InlineWithStateMachineKt$mainSuspend$1
|
||||
method <init>(p0: 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
|
||||
@kotlin.coroutines.jvm.internal.DebugMetadata
|
||||
public final class InlineWithStateMachineKt$suspendHere$1 {
|
||||
field L$0: java.lang.Object
|
||||
field L$1: java.lang.Object
|
||||
field label: int
|
||||
synthetic field result: java.lang.Object
|
||||
inner class InlineWithStateMachineKt$suspendHere$1
|
||||
public method <init>(p0: 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 InlineWithStateMachineKt {
|
||||
inner class InlineWithStateMachineKt$box$1
|
||||
inner class InlineWithStateMachineKt$mainSuspend$1
|
||||
inner class InlineWithStateMachineKt$suspendHere$1
|
||||
public final static @org.jetbrains.annotations.NotNull method box(): java.lang.String
|
||||
public final static method builder(@org.jetbrains.annotations.NotNull p0: kotlin.jvm.functions.Function1): void
|
||||
public final static @org.jetbrains.annotations.Nullable method mainSuspend(@org.jetbrains.annotations.NotNull p0: kotlin.coroutines.Continuation): java.lang.Object
|
||||
private final static @org.jetbrains.annotations.Nullable method suspendHere$$forInline(@org.jetbrains.annotations.NotNull p0: kotlin.coroutines.Continuation): java.lang.Object
|
||||
public final static @org.jetbrains.annotations.Nullable method suspendHere(@org.jetbrains.annotations.NotNull p0: kotlin.coroutines.Continuation): java.lang.Object
|
||||
private final static @org.jetbrains.annotations.Nullable method suspendThere$$forInline(@org.jetbrains.annotations.NotNull p0: java.lang.String, @org.jetbrains.annotations.NotNull p1: kotlin.coroutines.Continuation): java.lang.Object
|
||||
public final static @org.jetbrains.annotations.Nullable method suspendThere(@org.jetbrains.annotations.NotNull p0: java.lang.String, @org.jetbrains.annotations.NotNull p1: kotlin.coroutines.Continuation): java.lang.Object
|
||||
}
|
||||
Vendored
-50
@@ -1,50 +0,0 @@
|
||||
@kotlin.Metadata
|
||||
final class InlineWithStateMachineKt$box$1 {
|
||||
synthetic final field $result: kotlin.jvm.internal.Ref$ObjectRef
|
||||
field L$0: java.lang.Object
|
||||
inner class InlineWithStateMachineKt$box$1
|
||||
method <init>(p0: kotlin.jvm.internal.Ref$ObjectRef, p1: kotlin.coroutines.experimental.Continuation): void
|
||||
public final @org.jetbrains.annotations.NotNull method create(@org.jetbrains.annotations.NotNull p0: kotlin.coroutines.experimental.Continuation): kotlin.coroutines.experimental.Continuation
|
||||
public final @org.jetbrains.annotations.Nullable method doResume(@org.jetbrains.annotations.Nullable p0: java.lang.Object, @org.jetbrains.annotations.Nullable p1: java.lang.Throwable): java.lang.Object
|
||||
public final method invoke(p0: java.lang.Object): java.lang.Object
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
final class InlineWithStateMachineKt$mainSuspend$1 {
|
||||
field L$0: java.lang.Object
|
||||
field L$1: java.lang.Object
|
||||
synthetic field data: java.lang.Object
|
||||
synthetic field exception: java.lang.Throwable
|
||||
inner class InlineWithStateMachineKt$mainSuspend$1
|
||||
method <init>(p0: kotlin.coroutines.experimental.Continuation): void
|
||||
public final @org.jetbrains.annotations.Nullable method doResume(@org.jetbrains.annotations.Nullable p0: java.lang.Object, @org.jetbrains.annotations.Nullable p1: java.lang.Throwable): java.lang.Object
|
||||
synthetic final method getLabel(): int
|
||||
synthetic final method setLabel(p0: int): void
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
public final class InlineWithStateMachineKt$suspendHere$1 {
|
||||
field L$0: java.lang.Object
|
||||
field L$1: java.lang.Object
|
||||
synthetic field data: java.lang.Object
|
||||
synthetic field exception: java.lang.Throwable
|
||||
inner class InlineWithStateMachineKt$suspendHere$1
|
||||
public method <init>(p0: kotlin.coroutines.experimental.Continuation): void
|
||||
public final @org.jetbrains.annotations.Nullable method doResume(@org.jetbrains.annotations.Nullable p0: java.lang.Object, @org.jetbrains.annotations.Nullable p1: java.lang.Throwable): java.lang.Object
|
||||
synthetic final method getLabel(): int
|
||||
synthetic final method setLabel(p0: int): void
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
public final class InlineWithStateMachineKt {
|
||||
inner class InlineWithStateMachineKt$box$1
|
||||
inner class InlineWithStateMachineKt$mainSuspend$1
|
||||
inner class InlineWithStateMachineKt$suspendHere$1
|
||||
public final static @org.jetbrains.annotations.NotNull method box(): java.lang.String
|
||||
public final static method builder(@org.jetbrains.annotations.NotNull p0: kotlin.jvm.functions.Function1): void
|
||||
public final static @org.jetbrains.annotations.Nullable method mainSuspend(@org.jetbrains.annotations.NotNull p0: kotlin.coroutines.experimental.Continuation): java.lang.Object
|
||||
private final static @org.jetbrains.annotations.Nullable method suspendHere$$forInline(@org.jetbrains.annotations.NotNull p0: kotlin.coroutines.experimental.Continuation): java.lang.Object
|
||||
public final static @org.jetbrains.annotations.Nullable method suspendHere(@org.jetbrains.annotations.NotNull p0: kotlin.coroutines.experimental.Continuation): java.lang.Object
|
||||
private final static @org.jetbrains.annotations.Nullable method suspendThere$$forInline(@org.jetbrains.annotations.NotNull p0: java.lang.String, @org.jetbrains.annotations.NotNull p1: kotlin.coroutines.experimental.Continuation): java.lang.Object
|
||||
public final static @org.jetbrains.annotations.Nullable method suspendThere(@org.jetbrains.annotations.NotNull p0: java.lang.String, @org.jetbrains.annotations.NotNull p1: kotlin.coroutines.experimental.Continuation): java.lang.Object
|
||||
}
|
||||
@@ -1,14 +1,15 @@
|
||||
// IGNORE_BACKEND: JVM_IR
|
||||
// TARGET_BACKEND: JVM
|
||||
// FULL_JDK
|
||||
// WITH_RUNTIME
|
||||
// WITH_COROUTINES
|
||||
// CHECK_BYTECODE_LISTING
|
||||
// CHECK_NEW_COUNT: function=suspendHere count=0
|
||||
// COMMON_COROUTINES_TEST
|
||||
// CHECK_TAIL_CALL_OPTIMIZATION
|
||||
import helpers.*
|
||||
import COROUTINES_PACKAGE.*
|
||||
import COROUTINES_PACKAGE.intrinsics.*
|
||||
import kotlin.coroutines.*
|
||||
import kotlin.coroutines.intrinsics.*
|
||||
|
||||
suspend fun suspendThere(v: String): String = suspendCoroutineUninterceptedOrReturn { x ->
|
||||
TailCallOptimizationChecker.saveStackTrace(x)
|
||||
x.resume(v)
|
||||
COROUTINE_SUSPENDED
|
||||
}
|
||||
@@ -25,6 +26,7 @@ fun box(): String {
|
||||
builder {
|
||||
result = suspendHere()
|
||||
}
|
||||
TailCallOptimizationChecker.checkNoStateMachineIn("suspendHere")
|
||||
|
||||
return result
|
||||
}
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
@kotlin.coroutines.jvm.internal.DebugMetadata
|
||||
@kotlin.Metadata
|
||||
final class SimpleKt$box$1 {
|
||||
synthetic final field $result: kotlin.jvm.internal.Ref$ObjectRef
|
||||
field L$0: java.lang.Object
|
||||
field label: int
|
||||
inner class SimpleKt$box$1
|
||||
method <init>(p0: kotlin.jvm.internal.Ref$ObjectRef, p1: kotlin.coroutines.Continuation): void
|
||||
public final @org.jetbrains.annotations.NotNull method create(@org.jetbrains.annotations.NotNull p0: kotlin.coroutines.Continuation): kotlin.coroutines.Continuation
|
||||
public final method invoke(p0: java.lang.Object): java.lang.Object
|
||||
public final @org.jetbrains.annotations.Nullable method invokeSuspend(@org.jetbrains.annotations.NotNull p0: java.lang.Object): java.lang.Object
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
public final class SimpleKt {
|
||||
inner class SimpleKt$box$1
|
||||
public final static @org.jetbrains.annotations.NotNull method box(): java.lang.String
|
||||
public final static method builder(@org.jetbrains.annotations.NotNull p0: kotlin.jvm.functions.Function1): void
|
||||
public final static @org.jetbrains.annotations.Nullable method suspendHere(@org.jetbrains.annotations.NotNull p0: kotlin.coroutines.Continuation): java.lang.Object
|
||||
public final static @org.jetbrains.annotations.Nullable method suspendThere(@org.jetbrains.annotations.NotNull p0: java.lang.String, @org.jetbrains.annotations.NotNull p1: kotlin.coroutines.Continuation): java.lang.Object
|
||||
}
|
||||
-19
@@ -1,19 +0,0 @@
|
||||
@kotlin.Metadata
|
||||
final class SimpleKt$box$1 {
|
||||
synthetic final field $result: kotlin.jvm.internal.Ref$ObjectRef
|
||||
field L$0: java.lang.Object
|
||||
inner class SimpleKt$box$1
|
||||
method <init>(p0: kotlin.jvm.internal.Ref$ObjectRef, p1: kotlin.coroutines.experimental.Continuation): void
|
||||
public final @org.jetbrains.annotations.NotNull method create(@org.jetbrains.annotations.NotNull p0: kotlin.coroutines.experimental.Continuation): kotlin.coroutines.experimental.Continuation
|
||||
public final @org.jetbrains.annotations.Nullable method doResume(@org.jetbrains.annotations.Nullable p0: java.lang.Object, @org.jetbrains.annotations.Nullable p1: java.lang.Throwable): java.lang.Object
|
||||
public final method invoke(p0: java.lang.Object): java.lang.Object
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
public final class SimpleKt {
|
||||
inner class SimpleKt$box$1
|
||||
public final static @org.jetbrains.annotations.NotNull method box(): java.lang.String
|
||||
public final static method builder(@org.jetbrains.annotations.NotNull p0: kotlin.jvm.functions.Function1): void
|
||||
public final static @org.jetbrains.annotations.Nullable method suspendHere(@org.jetbrains.annotations.NotNull p0: kotlin.coroutines.experimental.Continuation): java.lang.Object
|
||||
public final static @org.jetbrains.annotations.Nullable method suspendThere(@org.jetbrains.annotations.NotNull p0: java.lang.String, @org.jetbrains.annotations.NotNull p1: kotlin.coroutines.experimental.Continuation): java.lang.Object
|
||||
}
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
// IGNORE_BACKEND: JVM_IR
|
||||
// TARGET_BACKEND: JVM
|
||||
// FULL_JDK
|
||||
// WITH_RUNTIME
|
||||
// WITH_COROUTINES
|
||||
// CHECK_TAIL_CALL_OPTIMIZATION
|
||||
import helpers.*
|
||||
import kotlin.coroutines.*
|
||||
import kotlin.coroutines.intrinsics.*
|
||||
|
||||
fun check() = true
|
||||
|
||||
suspend fun f_1(): Unit {
|
||||
return f_2()
|
||||
}
|
||||
|
||||
private inline suspend fun f_2(): Unit {
|
||||
if (check()) return
|
||||
return suspendCoroutineUninterceptedOrReturn {
|
||||
TailCallOptimizationChecker.saveStackTrace(it)
|
||||
COROUTINE_SUSPENDED
|
||||
}
|
||||
}
|
||||
|
||||
fun builder(c: suspend () -> Unit) {
|
||||
c.startCoroutine(EmptyContinuation)
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
builder { f_1() }
|
||||
TailCallOptimizationChecker.checkNoStateMachineIn("f_1")
|
||||
return "OK"
|
||||
}
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
// IGNORE_BACKEND: JVM_IR
|
||||
// TARGET_BACKEND: JVM
|
||||
// FULL_JDK
|
||||
// WITH_RUNTIME
|
||||
// WITH_COROUTINES
|
||||
// CHECK_TAIL_CALL_OPTIMIZATION
|
||||
import helpers.*
|
||||
import kotlin.coroutines.*
|
||||
import kotlin.coroutines.intrinsics.*
|
||||
|
||||
var p: Int = 5846814
|
||||
private suspend fun withoutInline() {
|
||||
val c = { c: Continuation<Unit> ->
|
||||
TailCallOptimizationChecker.saveStackTrace(c)
|
||||
if (p > 52158) Unit else COROUTINE_SUSPENDED
|
||||
}
|
||||
|
||||
return suspendCoroutineUninterceptedOrReturn(c)
|
||||
}
|
||||
|
||||
private suspend fun withInline() {
|
||||
return suspendCoroutineUninterceptedOrReturn { c ->
|
||||
TailCallOptimizationChecker.saveStackTrace(c)
|
||||
if (p > 52158) Unit else COROUTINE_SUSPENDED
|
||||
}
|
||||
}
|
||||
|
||||
fun builder(c: suspend () -> Unit) {
|
||||
c.startCoroutine(EmptyContinuation)
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
builder {
|
||||
withoutInline()
|
||||
TailCallOptimizationChecker.checkNoStateMachineIn("withoutInline")
|
||||
withInline()
|
||||
TailCallOptimizationChecker.checkNoStateMachineIn("withInline")
|
||||
}
|
||||
return "OK"
|
||||
}
|
||||
+129
@@ -0,0 +1,129 @@
|
||||
// IGNORE_BACKEND: JVM_IR
|
||||
// TARGET_BACKEND: JVM
|
||||
// FULL_JDK
|
||||
// WITH_RUNTIME
|
||||
// WITH_COROUTINES
|
||||
// CHECK_TAIL_CALL_OPTIMIZATION
|
||||
import helpers.*
|
||||
import kotlin.coroutines.*
|
||||
import kotlin.coroutines.intrinsics.*
|
||||
|
||||
suspend fun empty() = TailCallOptimizationChecker.saveStackTrace()
|
||||
suspend fun withoutReturn() { empty() }
|
||||
suspend fun withReturn() { return empty() }
|
||||
suspend fun notTailCall() { empty(); empty() }
|
||||
suspend fun lambdaAsParameter(c: suspend ()->Unit) { c() }
|
||||
suspend fun lambdaAsParameterNotTailCall(c: suspend ()->Unit) { c(); c() }
|
||||
suspend fun lambdaAsParameterReturn(c: suspend ()->Unit) { return c() }
|
||||
suspend fun returnsInt() = 42.also { TailCallOptimizationChecker.saveStackTrace() }
|
||||
// This should not be tail-call, since the caller should push Unit.INSTANCE on stack
|
||||
suspend fun callsIntNotTailCall() { returnsInt() }
|
||||
suspend fun multipleExitPoints(b: Boolean) { if (b) empty() else withoutReturn() }
|
||||
suspend fun multipleExitPointsNotTailCall(b: Boolean) { if (b) empty() else returnsInt() }
|
||||
|
||||
fun ordinary() = 1
|
||||
inline fun ordinaryInline() { ordinary() }
|
||||
suspend fun multipleExitPointsWithOrdinaryInline(b: Boolean) { if (b) empty() else ordinaryInline() }
|
||||
|
||||
suspend fun multipleExitPointsWhen(i: Int) {
|
||||
when(i) {
|
||||
1 -> empty()
|
||||
2 -> withReturn()
|
||||
3 -> withoutReturn()
|
||||
else -> lambdaAsParameter {}
|
||||
}
|
||||
}
|
||||
|
||||
suspend fun <T> generic() = (Unit as T).also { TailCallOptimizationChecker.saveStackTrace() }
|
||||
suspend fun useGenericReturningUnit() {
|
||||
generic<Unit>()
|
||||
}
|
||||
|
||||
class Generic<T> {
|
||||
suspend fun foo() = generic<T>()
|
||||
}
|
||||
suspend fun useGenericClass(g: Generic<Unit>) {
|
||||
g.foo()
|
||||
}
|
||||
|
||||
suspend fun <T> genericInferType(c: () -> T) = c().also { TailCallOptimizationChecker.saveStackTrace() }
|
||||
suspend fun useGenericInferType() {
|
||||
genericInferType {}
|
||||
}
|
||||
|
||||
suspend fun nullableUnit(): Unit? = null.also { TailCallOptimizationChecker.saveStackTrace() }
|
||||
suspend fun useNullableUnit() {
|
||||
nullableUnit()
|
||||
}
|
||||
|
||||
suspend fun useRunRunRunRunRun() {
|
||||
run {
|
||||
run {
|
||||
run {
|
||||
run {
|
||||
run {
|
||||
empty()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
fun builder(c: suspend () -> Unit) {
|
||||
c.startCoroutine(EmptyContinuation)
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
builder {
|
||||
withoutReturn()
|
||||
TailCallOptimizationChecker.checkNoStateMachineIn("withoutReturn")
|
||||
|
||||
withReturn()
|
||||
TailCallOptimizationChecker.checkNoStateMachineIn("withReturn")
|
||||
|
||||
notTailCall()
|
||||
TailCallOptimizationChecker.checkStateMachineIn("notTailCall")
|
||||
|
||||
lambdaAsParameter { TailCallOptimizationChecker.saveStackTrace() }
|
||||
TailCallOptimizationChecker.checkNoStateMachineIn("lambdaAsParameter")
|
||||
|
||||
lambdaAsParameterNotTailCall { TailCallOptimizationChecker.saveStackTrace() }
|
||||
TailCallOptimizationChecker.checkStateMachineIn("lambdaAsParameterNotTailCall")
|
||||
|
||||
lambdaAsParameterReturn { TailCallOptimizationChecker.saveStackTrace() }
|
||||
TailCallOptimizationChecker.checkNoStateMachineIn("lambdaAsParameterReturn")
|
||||
|
||||
callsIntNotTailCall()
|
||||
TailCallOptimizationChecker.checkStateMachineIn("callsIntNotTailCall")
|
||||
|
||||
multipleExitPoints(false)
|
||||
TailCallOptimizationChecker.checkNoStateMachineIn("multipleExitPoints")
|
||||
|
||||
multipleExitPointsNotTailCall(false)
|
||||
TailCallOptimizationChecker.checkStateMachineIn("multipleExitPointsNotTailCall")
|
||||
|
||||
multipleExitPointsWithOrdinaryInline(true)
|
||||
TailCallOptimizationChecker.checkNoStateMachineIn("multipleExitPointsWithOrdinaryInline")
|
||||
|
||||
multipleExitPointsWhen(1)
|
||||
TailCallOptimizationChecker.checkNoStateMachineIn("multipleExitPointsWhen")
|
||||
|
||||
useGenericReturningUnit()
|
||||
TailCallOptimizationChecker.checkNoStateMachineIn("useGenericReturningUnit")
|
||||
|
||||
useGenericClass(Generic())
|
||||
TailCallOptimizationChecker.checkNoStateMachineIn("useGenericClass")
|
||||
|
||||
useGenericInferType()
|
||||
TailCallOptimizationChecker.checkNoStateMachineIn("useGenericInferType")
|
||||
|
||||
useNullableUnit()
|
||||
TailCallOptimizationChecker.checkStateMachineIn("useNullableUnit")
|
||||
|
||||
useRunRunRunRunRun()
|
||||
TailCallOptimizationChecker.checkNoStateMachineIn("useRunRunRunRunRun")
|
||||
}
|
||||
return "OK"
|
||||
}
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
// IGNORE_BACKEND: JVM_IR
|
||||
// TARGET_BACKEND: JVM
|
||||
// FULL_JDK
|
||||
// WITH_RUNTIME
|
||||
// WITH_COROUTINES
|
||||
// CHECK_TAIL_CALL_OPTIMIZATION
|
||||
import helpers.*
|
||||
import kotlin.coroutines.*
|
||||
import kotlin.coroutines.intrinsics.*
|
||||
|
||||
suspend fun catchException(): String {
|
||||
try {
|
||||
return suspendWithException()
|
||||
}
|
||||
catch(e: Exception) {
|
||||
return e.message!!
|
||||
}
|
||||
}
|
||||
|
||||
suspend fun suspendWithException(): String = "OK".also { TailCallOptimizationChecker.saveStackTrace() }
|
||||
|
||||
fun builder(c: suspend () -> Unit) {
|
||||
c.startCoroutine(EmptyContinuation)
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
var res = "FAIL"
|
||||
builder {
|
||||
res = catchException()
|
||||
}
|
||||
TailCallOptimizationChecker.checkStateMachineIn("catchException")
|
||||
return res
|
||||
}
|
||||
+172
-11
@@ -1,26 +1,187 @@
|
||||
// IGNORE_BACKEND: JVM_IR
|
||||
// TARGET_BACKEND: JVM
|
||||
// FULL_JDK
|
||||
// WITH_RUNTIME
|
||||
// WITH_COROUTINES
|
||||
// COMMON_COROUTINES_TEST
|
||||
// CHECK_TAIL_CALL_OPTIMIZATION
|
||||
import helpers.*
|
||||
import COROUTINES_PACKAGE.*
|
||||
import COROUTINES_PACKAGE.intrinsics.*
|
||||
import kotlin.coroutines.*
|
||||
import kotlin.coroutines.intrinsics.*
|
||||
|
||||
suspend fun twoReturns(c: suspend () -> Unit) {
|
||||
return c()
|
||||
throw RuntimeException("FAIL 1")
|
||||
suspend fun empty() = TailCallOptimizationChecker.saveStackTrace()
|
||||
suspend fun withoutReturn() {
|
||||
empty()
|
||||
}
|
||||
|
||||
suspend fun withReturn() {
|
||||
return empty()
|
||||
return empty()
|
||||
}
|
||||
|
||||
suspend fun notTailCall() {
|
||||
empty()
|
||||
return empty()
|
||||
empty()
|
||||
}
|
||||
|
||||
suspend fun lambdaAsParameter(c: suspend () -> Unit) {
|
||||
c()
|
||||
}
|
||||
|
||||
suspend fun lambdaAsParameterNotTailCall(c: suspend () -> Unit) {
|
||||
c()
|
||||
return c()
|
||||
c()
|
||||
}
|
||||
|
||||
suspend fun lambdaAsParameterReturn(c: suspend () -> Unit) {
|
||||
return c()
|
||||
c()
|
||||
}
|
||||
|
||||
suspend fun returnsInt() = 42.also { TailCallOptimizationChecker.saveStackTrace() }
|
||||
// This should not be tail-call, since the caller should push Unit.INSTANCE on stack
|
||||
suspend fun callsIntNotTailCall() {
|
||||
returnsInt()
|
||||
return
|
||||
empty()
|
||||
}
|
||||
|
||||
suspend fun multipleExitPoints(b: Boolean) {
|
||||
if (b) empty() else withoutReturn()
|
||||
return
|
||||
empty()
|
||||
}
|
||||
|
||||
suspend fun multipleExitPointsNotTailCall(b: Boolean) {
|
||||
if (b) empty() else returnsInt()
|
||||
return
|
||||
empty()
|
||||
}
|
||||
|
||||
fun ordinary() = 1
|
||||
inline fun ordinaryInline() {
|
||||
ordinary()
|
||||
}
|
||||
|
||||
suspend fun multipleExitPointsWithOrdinaryInline(b: Boolean) {
|
||||
if (b) empty() else ordinaryInline()
|
||||
return
|
||||
empty()
|
||||
}
|
||||
|
||||
suspend fun multipleExitPointsWhen(i: Int) {
|
||||
when (i) {
|
||||
1 -> empty()
|
||||
2 -> withReturn()
|
||||
3 -> withoutReturn()
|
||||
else -> lambdaAsParameter {}
|
||||
}
|
||||
return
|
||||
empty()
|
||||
}
|
||||
|
||||
suspend fun <T> generic() = (Unit as T).also { TailCallOptimizationChecker.saveStackTrace() }
|
||||
suspend fun useGenericReturningUnit() {
|
||||
generic<Unit>()
|
||||
return
|
||||
empty()
|
||||
}
|
||||
|
||||
class Generic<T> {
|
||||
suspend fun foo() = generic<T>()
|
||||
}
|
||||
|
||||
suspend fun useGenericClass(g: Generic<Unit>) {
|
||||
g.foo()
|
||||
return
|
||||
empty()
|
||||
}
|
||||
|
||||
suspend fun <T> genericInferType(c: () -> T) = c().also { TailCallOptimizationChecker.saveStackTrace() }
|
||||
suspend fun useGenericInferType() {
|
||||
genericInferType {}
|
||||
return
|
||||
empty()
|
||||
}
|
||||
|
||||
suspend fun nullableUnit(): Unit? = null.also { TailCallOptimizationChecker.saveStackTrace() }
|
||||
suspend fun useNullableUnit() {
|
||||
nullableUnit()
|
||||
return
|
||||
empty()
|
||||
}
|
||||
|
||||
suspend fun useRunRunRunRunRun() {
|
||||
run {
|
||||
run {
|
||||
run {
|
||||
run {
|
||||
run {
|
||||
empty()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return
|
||||
empty()
|
||||
}
|
||||
|
||||
|
||||
fun builder(c: suspend () -> Unit) {
|
||||
c.startCoroutine(EmptyContinuation)
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
var res = "FAIL"
|
||||
builder {
|
||||
twoReturns {
|
||||
res = "OK"
|
||||
}
|
||||
withoutReturn()
|
||||
TailCallOptimizationChecker.checkNoStateMachineIn("withoutReturn")
|
||||
|
||||
withReturn()
|
||||
TailCallOptimizationChecker.checkNoStateMachineIn("withReturn")
|
||||
|
||||
notTailCall()
|
||||
TailCallOptimizationChecker.checkStateMachineIn("notTailCall")
|
||||
|
||||
lambdaAsParameter { TailCallOptimizationChecker.saveStackTrace() }
|
||||
TailCallOptimizationChecker.checkNoStateMachineIn("lambdaAsParameter")
|
||||
|
||||
lambdaAsParameterNotTailCall { TailCallOptimizationChecker.saveStackTrace() }
|
||||
TailCallOptimizationChecker.checkStateMachineIn("lambdaAsParameterNotTailCall")
|
||||
|
||||
lambdaAsParameterReturn { TailCallOptimizationChecker.saveStackTrace() }
|
||||
TailCallOptimizationChecker.checkNoStateMachineIn("lambdaAsParameterReturn")
|
||||
|
||||
callsIntNotTailCall()
|
||||
TailCallOptimizationChecker.checkStateMachineIn("callsIntNotTailCall")
|
||||
|
||||
multipleExitPoints(false)
|
||||
TailCallOptimizationChecker.checkNoStateMachineIn("multipleExitPoints")
|
||||
|
||||
multipleExitPointsNotTailCall(false)
|
||||
TailCallOptimizationChecker.checkStateMachineIn("multipleExitPointsNotTailCall")
|
||||
|
||||
multipleExitPointsWithOrdinaryInline(true)
|
||||
TailCallOptimizationChecker.checkNoStateMachineIn("multipleExitPointsWithOrdinaryInline")
|
||||
|
||||
multipleExitPointsWhen(1)
|
||||
TailCallOptimizationChecker.checkNoStateMachineIn("multipleExitPointsWhen")
|
||||
|
||||
useGenericReturningUnit()
|
||||
TailCallOptimizationChecker.checkNoStateMachineIn("useGenericReturningUnit")
|
||||
|
||||
useGenericClass(Generic())
|
||||
TailCallOptimizationChecker.checkNoStateMachineIn("useGenericClass")
|
||||
|
||||
useGenericInferType()
|
||||
TailCallOptimizationChecker.checkNoStateMachineIn("useGenericInferType")
|
||||
|
||||
useNullableUnit()
|
||||
TailCallOptimizationChecker.checkStateMachineIn("useNullableUnit")
|
||||
|
||||
useRunRunRunRunRun()
|
||||
TailCallOptimizationChecker.checkNoStateMachineIn("useRunRunRunRunRun")
|
||||
}
|
||||
return res
|
||||
return "OK"
|
||||
}
|
||||
|
||||
+16
-5
@@ -1,10 +1,12 @@
|
||||
// IGNORE_BACKEND: JVM_IR
|
||||
// TARGET_BACKEND: JVM
|
||||
// FULL_JDK
|
||||
// WITH_RUNTIME
|
||||
// WITH_COROUTINES
|
||||
// COMMON_COROUTINES_TEST
|
||||
// CHECK_BYTECODE_LISTING
|
||||
// CHECK_TAIL_CALL_OPTIMIZATION
|
||||
import helpers.*
|
||||
import COROUTINES_PACKAGE.*
|
||||
import kotlin.coroutines.*
|
||||
import kotlin.coroutines.intrinsics.*
|
||||
|
||||
sealed class X {
|
||||
class A : X()
|
||||
@@ -13,8 +15,15 @@ sealed class X {
|
||||
|
||||
var log = ""
|
||||
|
||||
suspend fun process(a: X.A) { log = "${log}from A;" }
|
||||
suspend fun process(b: X.B) { log = "${log}from B;" }
|
||||
suspend fun process(a: X.A) {
|
||||
log = "${log}from A;"
|
||||
TailCallOptimizationChecker.saveStackTrace()
|
||||
}
|
||||
|
||||
suspend fun process(b: X.B) {
|
||||
log = "${log}from B;"
|
||||
TailCallOptimizationChecker.saveStackTrace()
|
||||
}
|
||||
|
||||
suspend fun process(x: X) = when (x) {
|
||||
is X.A -> process(x)
|
||||
@@ -28,7 +37,9 @@ fun builder(c: suspend () -> Unit) {
|
||||
fun box(): String {
|
||||
builder {
|
||||
process(X.A())
|
||||
TailCallOptimizationChecker.checkNoStateMachineIn("process")
|
||||
process(X.B())
|
||||
TailCallOptimizationChecker.checkNoStateMachineIn("process")
|
||||
}
|
||||
if (log != "from A;from B;") return log
|
||||
return "OK"
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
@kotlin.coroutines.jvm.internal.DebugMetadata
|
||||
@kotlin.Metadata
|
||||
final class WhenUnitKt$box$1 {
|
||||
field label: int
|
||||
inner class WhenUnitKt$box$1
|
||||
method <init>(p0: kotlin.coroutines.Continuation): void
|
||||
public final @org.jetbrains.annotations.NotNull method create(@org.jetbrains.annotations.NotNull p0: kotlin.coroutines.Continuation): kotlin.coroutines.Continuation
|
||||
public final method invoke(p0: java.lang.Object): java.lang.Object
|
||||
public final @org.jetbrains.annotations.Nullable method invokeSuspend(@org.jetbrains.annotations.NotNull p0: java.lang.Object): java.lang.Object
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
public final class WhenUnitKt {
|
||||
private static @org.jetbrains.annotations.NotNull field log: java.lang.String
|
||||
inner class WhenUnitKt$box$1
|
||||
static method <clinit>(): void
|
||||
public final static @org.jetbrains.annotations.NotNull method box(): java.lang.String
|
||||
public final static method builder(@org.jetbrains.annotations.NotNull p0: kotlin.jvm.functions.Function1): void
|
||||
public final static @org.jetbrains.annotations.NotNull method getLog(): java.lang.String
|
||||
public final static @org.jetbrains.annotations.Nullable method process(@org.jetbrains.annotations.NotNull p0: X$A, @org.jetbrains.annotations.NotNull p1: kotlin.coroutines.Continuation): java.lang.Object
|
||||
public final static @org.jetbrains.annotations.Nullable method process(@org.jetbrains.annotations.NotNull p0: X$B, @org.jetbrains.annotations.NotNull p1: kotlin.coroutines.Continuation): java.lang.Object
|
||||
public final static @org.jetbrains.annotations.Nullable method process(@org.jetbrains.annotations.NotNull p0: X, @org.jetbrains.annotations.NotNull p1: kotlin.coroutines.Continuation): java.lang.Object
|
||||
public final static method setLog(@org.jetbrains.annotations.NotNull p0: java.lang.String): void
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
public final class X$A {
|
||||
inner class X$A
|
||||
public method <init>(): void
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
public final class X$B {
|
||||
inner class X$B
|
||||
public method <init>(): void
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
public abstract class X {
|
||||
inner class X$A
|
||||
inner class X$B
|
||||
private method <init>(): void
|
||||
public synthetic method <init>(p0: kotlin.jvm.internal.DefaultConstructorMarker): void
|
||||
}
|
||||
-42
@@ -1,42 +0,0 @@
|
||||
@kotlin.Metadata
|
||||
final class WhenUnitKt$box$1 {
|
||||
inner class WhenUnitKt$box$1
|
||||
method <init>(p0: kotlin.coroutines.experimental.Continuation): void
|
||||
public final @org.jetbrains.annotations.NotNull method create(@org.jetbrains.annotations.NotNull p0: kotlin.coroutines.experimental.Continuation): kotlin.coroutines.experimental.Continuation
|
||||
public final @org.jetbrains.annotations.Nullable method doResume(@org.jetbrains.annotations.Nullable p0: java.lang.Object, @org.jetbrains.annotations.Nullable p1: java.lang.Throwable): java.lang.Object
|
||||
public final method invoke(p0: java.lang.Object): java.lang.Object
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
public final class WhenUnitKt {
|
||||
private static @org.jetbrains.annotations.NotNull field log: java.lang.String
|
||||
inner class WhenUnitKt$box$1
|
||||
static method <clinit>(): void
|
||||
public final static @org.jetbrains.annotations.NotNull method box(): java.lang.String
|
||||
public final static method builder(@org.jetbrains.annotations.NotNull p0: kotlin.jvm.functions.Function1): void
|
||||
public final static @org.jetbrains.annotations.NotNull method getLog(): java.lang.String
|
||||
public final static @org.jetbrains.annotations.Nullable method process(@org.jetbrains.annotations.NotNull p0: X$A, @org.jetbrains.annotations.NotNull p1: kotlin.coroutines.experimental.Continuation): java.lang.Object
|
||||
public final static @org.jetbrains.annotations.Nullable method process(@org.jetbrains.annotations.NotNull p0: X$B, @org.jetbrains.annotations.NotNull p1: kotlin.coroutines.experimental.Continuation): java.lang.Object
|
||||
public final static @org.jetbrains.annotations.Nullable method process(@org.jetbrains.annotations.NotNull p0: X, @org.jetbrains.annotations.NotNull p1: kotlin.coroutines.experimental.Continuation): java.lang.Object
|
||||
public final static method setLog(@org.jetbrains.annotations.NotNull p0: java.lang.String): void
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
public final class X$A {
|
||||
inner class X$A
|
||||
public method <init>(): void
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
public final class X$B {
|
||||
inner class X$B
|
||||
public method <init>(): void
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
public abstract class X {
|
||||
inner class X$A
|
||||
inner class X$B
|
||||
private method <init>(): void
|
||||
public synthetic method <init>(p0: kotlin.jvm.internal.DefaultConstructorMarker): void
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
@kotlin.Metadata
|
||||
final class ReleaseCoroutinesKt$l$1 {
|
||||
field label: int
|
||||
inner class ReleaseCoroutinesKt$l$1
|
||||
method <init>(p0: kotlin.coroutines.Continuation): void
|
||||
public final @org.jetbrains.annotations.NotNull method create(@org.jetbrains.annotations.NotNull p0: kotlin.coroutines.Continuation): kotlin.coroutines.Continuation
|
||||
public final @org.jetbrains.annotations.Nullable method invoke(@org.jetbrains.annotations.NotNull p0: kotlin.coroutines.Continuation): java.lang.Object
|
||||
public synthetic method invoke(p0: java.lang.Object): java.lang.Object
|
||||
public final @org.jetbrains.annotations.Nullable method invokeSuspend(@org.jetbrains.annotations.NotNull p0: java.lang.Object): java.lang.Object
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
final class ReleaseCoroutinesKt$withStateMachine$1 {
|
||||
synthetic field data: java.lang.Object
|
||||
field label: int
|
||||
inner class ReleaseCoroutinesKt$withStateMachine$1
|
||||
method <init>(p0: kotlin.coroutines.Continuation): void
|
||||
synthetic final method getLabel(): int
|
||||
public final @org.jetbrains.annotations.Nullable method invokeSuspend(@org.jetbrains.annotations.NotNull p0: java.lang.Object): java.lang.Object
|
||||
synthetic final method setLabel(p0: int): void
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
public final class ReleaseCoroutinesKt {
|
||||
private final static @org.jetbrains.annotations.NotNull field l: kotlin.jvm.functions.Function1
|
||||
inner class ReleaseCoroutinesKt$l$1
|
||||
inner class ReleaseCoroutinesKt$withStateMachine$1
|
||||
static method <clinit>(): void
|
||||
public final static @org.jetbrains.annotations.NotNull method getL(): kotlin.jvm.functions.Function1
|
||||
public final static @org.jetbrains.annotations.Nullable method named(@org.jetbrains.annotations.NotNull p0: kotlin.coroutines.Continuation): java.lang.Object
|
||||
public final static @org.jetbrains.annotations.Nullable method withStateMachine(@org.jetbrains.annotations.NotNull p0: kotlin.coroutines.Continuation): java.lang.Object
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
// WITH_RUNTIME
|
||||
// COMMON_COROUTINES_TEST
|
||||
|
||||
import COROUTINES_PACKAGE.intrinsics.*
|
||||
|
||||
fun check() = true
|
||||
|
||||
suspend fun f(i: Int): Unit {
|
||||
return f_2()
|
||||
}
|
||||
|
||||
private inline suspend fun f_2(): Unit {
|
||||
if (check()) return
|
||||
return suspendCoroutineUninterceptedOrReturn {
|
||||
COROUTINE_SUSPENDED
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
@kotlin.Metadata
|
||||
public final class TailCallIfReturnUnitKt {
|
||||
public final static method check(): boolean
|
||||
public final static @org.jetbrains.annotations.Nullable method f(p0: int, @org.jetbrains.annotations.NotNull p1: kotlin.coroutines.experimental.Continuation): java.lang.Object
|
||||
private synthetic final static method f_2(p0: kotlin.coroutines.experimental.Continuation): java.lang.Object
|
||||
}
|
||||
-6
@@ -1,6 +0,0 @@
|
||||
@kotlin.Metadata
|
||||
public final class TailCallIfReturnUnitKt {
|
||||
public final static method check(): boolean
|
||||
public final static @org.jetbrains.annotations.Nullable method f(p0: int, @org.jetbrains.annotations.NotNull p1: kotlin.coroutines.Continuation): java.lang.Object
|
||||
private synthetic final static method f_2(p0: kotlin.coroutines.Continuation): java.lang.Object
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
// WITH_RUNTIME
|
||||
// COMMON_COROUTINES_TEST
|
||||
import COROUTINES_PACKAGE.*
|
||||
import COROUTINES_PACKAGE.intrinsics.*
|
||||
|
||||
var p: Int = 5846814
|
||||
private suspend fun withoutInline() {
|
||||
val c = { c: Continuation<Unit> ->
|
||||
if (p > 52158) Unit else COROUTINE_SUSPENDED
|
||||
}
|
||||
|
||||
return suspendCoroutineUninterceptedOrReturn(c)
|
||||
}
|
||||
|
||||
private suspend fun withInline() {
|
||||
return suspendCoroutineUninterceptedOrReturn { c ->
|
||||
if (p > 52158) Unit else COROUTINE_SUSPENDED
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
@kotlin.Metadata
|
||||
final class TailCallIntrinsicsKt$withoutInline$c$1 {
|
||||
public final static field INSTANCE: TailCallIntrinsicsKt$withoutInline$c$1
|
||||
inner class TailCallIntrinsicsKt$withoutInline$c$1
|
||||
static method <clinit>(): void
|
||||
method <init>(): void
|
||||
public final @org.jetbrains.annotations.NotNull method invoke(@org.jetbrains.annotations.NotNull p0: COROUTINES_PACKAGE.Continuation): java.lang.Object
|
||||
public synthetic method invoke(p0: java.lang.Object): java.lang.Object
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
public final class TailCallIntrinsicsKt {
|
||||
private static field p: int
|
||||
inner class TailCallIntrinsicsKt$withoutInline$c$1
|
||||
static method <clinit>(): void
|
||||
public final static method getP(): int
|
||||
public final static method setP(p0: int): void
|
||||
synthetic final static @org.jetbrains.annotations.Nullable method withInline(@org.jetbrains.annotations.NotNull p0: COROUTINES_PACKAGE.Continuation): java.lang.Object
|
||||
synthetic final static @org.jetbrains.annotations.Nullable method withoutInline(@org.jetbrains.annotations.NotNull p0: COROUTINES_PACKAGE.Continuation): java.lang.Object
|
||||
}
|
||||
@@ -1,64 +0,0 @@
|
||||
// COMMON_COROUTINES_TEST
|
||||
// WITH_RUNTIME
|
||||
|
||||
suspend fun empty() {}
|
||||
suspend fun withoutReturn() { empty() }
|
||||
suspend fun withReturn() { return empty() }
|
||||
suspend fun notTailCall() { empty(); empty() }
|
||||
suspend fun lambdaAsParameter(c: suspend ()->Unit) { c() }
|
||||
suspend fun lambdaAsParameterNotTailCall(c: suspend ()->Unit) { c(); c() }
|
||||
suspend fun lambdaAsParameterReturn(c: suspend ()->Unit) { return c() }
|
||||
suspend fun returnsInt() = 42
|
||||
// This should not be tail-call, since the caller should push Unit.INSTANCE on stack
|
||||
suspend fun callsIntNotTailCall() { returnsInt() }
|
||||
suspend fun multipleExitPoints(b: Boolean) { if (b) empty() else withoutReturn() }
|
||||
suspend fun multipleExitPointsNotTailCall(b: Boolean) { if (b) empty() else returnsInt() }
|
||||
|
||||
fun ordinary() = 1
|
||||
inline fun ordinaryInline() { ordinary() }
|
||||
suspend fun multipleExitPointsWithOrdinaryInline(b: Boolean) { if (b) empty() else ordinaryInline() }
|
||||
|
||||
suspend fun multipleExitPointsWhen(i: Int) {
|
||||
when(i) {
|
||||
1 -> empty()
|
||||
2 -> withReturn()
|
||||
3 -> withoutReturn()
|
||||
else -> lambdaAsParameter {}
|
||||
}
|
||||
}
|
||||
|
||||
suspend fun <T> generic(): T = TODO()
|
||||
suspend fun useGenericReturningUnit() {
|
||||
generic<Unit>()
|
||||
}
|
||||
|
||||
class Generic<T> {
|
||||
suspend fun foo(): T = TODO()
|
||||
}
|
||||
suspend fun useGenericClass(g: Generic<Unit>) {
|
||||
g.foo()
|
||||
}
|
||||
|
||||
suspend fun <T> genericInferType(c: () -> T): T = TODO()
|
||||
suspend fun useGenericIngerType() {
|
||||
genericInferType {}
|
||||
}
|
||||
|
||||
suspend fun nullableUnit(): Unit? = null
|
||||
suspend fun useNullableUnit() {
|
||||
nullableUnit()
|
||||
}
|
||||
|
||||
suspend fun useRunRunRunRunRun() {
|
||||
run {
|
||||
run {
|
||||
run {
|
||||
run {
|
||||
run {
|
||||
empty()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,115 +0,0 @@
|
||||
@kotlin.Metadata
|
||||
public final class Generic {
|
||||
public method <init>(): void
|
||||
public final @org.jetbrains.annotations.Nullable method foo(@org.jetbrains.annotations.NotNull p0: COROUTINES_PACKAGE.Continuation): java.lang.Object
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
final class TailSuspendUnitFunKt$callsIntNotTailCall$1 {
|
||||
synthetic field data: java.lang.Object
|
||||
synthetic field exception: java.lang.Throwable
|
||||
inner class TailSuspendUnitFunKt$callsIntNotTailCall$1
|
||||
method <init>(p0: COROUTINES_PACKAGE.Continuation): void
|
||||
public final @org.jetbrains.annotations.Nullable method doResume(@org.jetbrains.annotations.Nullable p0: java.lang.Object, @org.jetbrains.annotations.Nullable p1: java.lang.Throwable): java.lang.Object
|
||||
synthetic final method getLabel(): int
|
||||
synthetic final method setLabel(p0: int): void
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
final class TailSuspendUnitFunKt$lambdaAsParameterNotTailCall$1 {
|
||||
field L$0: java.lang.Object
|
||||
synthetic field data: java.lang.Object
|
||||
synthetic field exception: java.lang.Throwable
|
||||
inner class TailSuspendUnitFunKt$lambdaAsParameterNotTailCall$1
|
||||
method <init>(p0: COROUTINES_PACKAGE.Continuation): void
|
||||
public final @org.jetbrains.annotations.Nullable method doResume(@org.jetbrains.annotations.Nullable p0: java.lang.Object, @org.jetbrains.annotations.Nullable p1: java.lang.Throwable): java.lang.Object
|
||||
synthetic final method getLabel(): int
|
||||
synthetic final method setLabel(p0: int): void
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
final class TailSuspendUnitFunKt$multipleExitPointsNotTailCall$1 {
|
||||
field Z$0: boolean
|
||||
synthetic field data: java.lang.Object
|
||||
synthetic field exception: java.lang.Throwable
|
||||
inner class TailSuspendUnitFunKt$multipleExitPointsNotTailCall$1
|
||||
method <init>(p0: COROUTINES_PACKAGE.Continuation): void
|
||||
public final @org.jetbrains.annotations.Nullable method doResume(@org.jetbrains.annotations.Nullable p0: java.lang.Object, @org.jetbrains.annotations.Nullable p1: java.lang.Throwable): java.lang.Object
|
||||
synthetic final method getLabel(): int
|
||||
synthetic final method setLabel(p0: int): void
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
final class TailSuspendUnitFunKt$multipleExitPointsWhen$2 {
|
||||
inner class TailSuspendUnitFunKt$multipleExitPointsWhen$2
|
||||
method <init>(p0: COROUTINES_PACKAGE.Continuation): void
|
||||
public final @org.jetbrains.annotations.NotNull method create(@org.jetbrains.annotations.NotNull p0: COROUTINES_PACKAGE.Continuation): COROUTINES_PACKAGE.Continuation
|
||||
public final @org.jetbrains.annotations.Nullable method doResume(@org.jetbrains.annotations.Nullable p0: java.lang.Object, @org.jetbrains.annotations.Nullable p1: java.lang.Throwable): java.lang.Object
|
||||
public final method invoke(p0: java.lang.Object): java.lang.Object
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
final class TailSuspendUnitFunKt$notTailCall$1 {
|
||||
synthetic field data: java.lang.Object
|
||||
synthetic field exception: java.lang.Throwable
|
||||
inner class TailSuspendUnitFunKt$notTailCall$1
|
||||
method <init>(p0: COROUTINES_PACKAGE.Continuation): void
|
||||
public final @org.jetbrains.annotations.Nullable method doResume(@org.jetbrains.annotations.Nullable p0: java.lang.Object, @org.jetbrains.annotations.Nullable p1: java.lang.Throwable): java.lang.Object
|
||||
synthetic final method getLabel(): int
|
||||
synthetic final method setLabel(p0: int): void
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
final class TailSuspendUnitFunKt$useGenericIngerType$2 {
|
||||
public final static field INSTANCE: TailSuspendUnitFunKt$useGenericIngerType$2
|
||||
inner class TailSuspendUnitFunKt$useGenericIngerType$2
|
||||
static method <clinit>(): void
|
||||
method <init>(): void
|
||||
public synthetic method invoke(): java.lang.Object
|
||||
public final method invoke(): void
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
final class TailSuspendUnitFunKt$useNullableUnit$1 {
|
||||
synthetic field data: java.lang.Object
|
||||
synthetic field exception: java.lang.Throwable
|
||||
inner class TailSuspendUnitFunKt$useNullableUnit$1
|
||||
method <init>(p0: COROUTINES_PACKAGE.Continuation): void
|
||||
public final @org.jetbrains.annotations.Nullable method doResume(@org.jetbrains.annotations.Nullable p0: java.lang.Object, @org.jetbrains.annotations.Nullable p1: java.lang.Throwable): java.lang.Object
|
||||
synthetic final method getLabel(): int
|
||||
synthetic final method setLabel(p0: int): void
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
public final class TailSuspendUnitFunKt {
|
||||
inner class TailSuspendUnitFunKt$callsIntNotTailCall$1
|
||||
inner class TailSuspendUnitFunKt$lambdaAsParameterNotTailCall$1
|
||||
inner class TailSuspendUnitFunKt$multipleExitPointsNotTailCall$1
|
||||
inner class TailSuspendUnitFunKt$multipleExitPointsWhen$2
|
||||
inner class TailSuspendUnitFunKt$notTailCall$1
|
||||
inner class TailSuspendUnitFunKt$useGenericIngerType$2
|
||||
inner class TailSuspendUnitFunKt$useNullableUnit$1
|
||||
public final static @org.jetbrains.annotations.Nullable method callsIntNotTailCall(@org.jetbrains.annotations.NotNull p0: COROUTINES_PACKAGE.Continuation): java.lang.Object
|
||||
public final static @org.jetbrains.annotations.Nullable method empty(@org.jetbrains.annotations.NotNull p0: COROUTINES_PACKAGE.Continuation): java.lang.Object
|
||||
public final static @org.jetbrains.annotations.Nullable method generic(@org.jetbrains.annotations.NotNull p0: COROUTINES_PACKAGE.Continuation): java.lang.Object
|
||||
public final static @org.jetbrains.annotations.Nullable method genericInferType(@org.jetbrains.annotations.NotNull p0: kotlin.jvm.functions.Function0, @org.jetbrains.annotations.NotNull p1: COROUTINES_PACKAGE.Continuation): java.lang.Object
|
||||
public final static @org.jetbrains.annotations.Nullable method lambdaAsParameter(@org.jetbrains.annotations.NotNull p0: kotlin.jvm.functions.Function1, @org.jetbrains.annotations.NotNull p1: COROUTINES_PACKAGE.Continuation): java.lang.Object
|
||||
public final static @org.jetbrains.annotations.Nullable method lambdaAsParameterNotTailCall(@org.jetbrains.annotations.NotNull p0: kotlin.jvm.functions.Function1, @org.jetbrains.annotations.NotNull p1: COROUTINES_PACKAGE.Continuation): java.lang.Object
|
||||
public final static @org.jetbrains.annotations.Nullable method lambdaAsParameterReturn(@org.jetbrains.annotations.NotNull p0: kotlin.jvm.functions.Function1, @org.jetbrains.annotations.NotNull p1: COROUTINES_PACKAGE.Continuation): java.lang.Object
|
||||
public final static @org.jetbrains.annotations.Nullable method multipleExitPoints(p0: boolean, @org.jetbrains.annotations.NotNull p1: COROUTINES_PACKAGE.Continuation): java.lang.Object
|
||||
public final static @org.jetbrains.annotations.Nullable method multipleExitPointsNotTailCall(p0: boolean, @org.jetbrains.annotations.NotNull p1: COROUTINES_PACKAGE.Continuation): java.lang.Object
|
||||
public final static @org.jetbrains.annotations.Nullable method multipleExitPointsWhen(p0: int, @org.jetbrains.annotations.NotNull p1: COROUTINES_PACKAGE.Continuation): java.lang.Object
|
||||
public final static @org.jetbrains.annotations.Nullable method multipleExitPointsWithOrdinaryInline(p0: boolean, @org.jetbrains.annotations.NotNull p1: COROUTINES_PACKAGE.Continuation): java.lang.Object
|
||||
public final static @org.jetbrains.annotations.Nullable method notTailCall(@org.jetbrains.annotations.NotNull p0: COROUTINES_PACKAGE.Continuation): java.lang.Object
|
||||
public final static @org.jetbrains.annotations.Nullable method nullableUnit(@org.jetbrains.annotations.NotNull p0: COROUTINES_PACKAGE.Continuation): java.lang.Object
|
||||
public final static method ordinary(): int
|
||||
public final static method ordinaryInline(): void
|
||||
public final static @org.jetbrains.annotations.Nullable method returnsInt(@org.jetbrains.annotations.NotNull p0: COROUTINES_PACKAGE.Continuation): java.lang.Object
|
||||
public final static @org.jetbrains.annotations.Nullable method useGenericClass(@org.jetbrains.annotations.NotNull p0: Generic, @org.jetbrains.annotations.NotNull p1: COROUTINES_PACKAGE.Continuation): java.lang.Object
|
||||
public final static @org.jetbrains.annotations.Nullable method useGenericIngerType(@org.jetbrains.annotations.NotNull p0: COROUTINES_PACKAGE.Continuation): java.lang.Object
|
||||
public final static @org.jetbrains.annotations.Nullable method useGenericReturningUnit(@org.jetbrains.annotations.NotNull p0: COROUTINES_PACKAGE.Continuation): java.lang.Object
|
||||
public final static @org.jetbrains.annotations.Nullable method useNullableUnit(@org.jetbrains.annotations.NotNull p0: COROUTINES_PACKAGE.Continuation): java.lang.Object
|
||||
public final static @org.jetbrains.annotations.Nullable method useRunRunRunRunRun(@org.jetbrains.annotations.NotNull p0: COROUTINES_PACKAGE.Continuation): java.lang.Object
|
||||
public final static @org.jetbrains.annotations.Nullable method withReturn(@org.jetbrains.annotations.NotNull p0: COROUTINES_PACKAGE.Continuation): java.lang.Object
|
||||
public final static @org.jetbrains.annotations.Nullable method withoutReturn(@org.jetbrains.annotations.NotNull p0: COROUTINES_PACKAGE.Continuation): java.lang.Object
|
||||
}
|
||||
-112
@@ -1,112 +0,0 @@
|
||||
@kotlin.Metadata
|
||||
public final class Generic {
|
||||
public method <init>(): void
|
||||
public final @org.jetbrains.annotations.Nullable method foo(@org.jetbrains.annotations.NotNull p0: kotlin.coroutines.Continuation): java.lang.Object
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
@kotlin.coroutines.jvm.internal.DebugMetadata
|
||||
final class TailSuspendUnitFunKt$callsIntNotTailCall$1 {
|
||||
field label: int
|
||||
synthetic field result: java.lang.Object
|
||||
inner class TailSuspendUnitFunKt$callsIntNotTailCall$1
|
||||
method <init>(p0: 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
|
||||
@kotlin.coroutines.jvm.internal.DebugMetadata
|
||||
final class TailSuspendUnitFunKt$lambdaAsParameterNotTailCall$1 {
|
||||
field L$0: java.lang.Object
|
||||
field label: int
|
||||
synthetic field result: java.lang.Object
|
||||
inner class TailSuspendUnitFunKt$lambdaAsParameterNotTailCall$1
|
||||
method <init>(p0: 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
|
||||
@kotlin.coroutines.jvm.internal.DebugMetadata
|
||||
final class TailSuspendUnitFunKt$multipleExitPointsNotTailCall$1 {
|
||||
field Z$0: boolean
|
||||
field label: int
|
||||
synthetic field result: java.lang.Object
|
||||
inner class TailSuspendUnitFunKt$multipleExitPointsNotTailCall$1
|
||||
method <init>(p0: kotlin.coroutines.Continuation): void
|
||||
public final @org.jetbrains.annotations.Nullable method invokeSuspend(@org.jetbrains.annotations.NotNull p0: java.lang.Object): java.lang.Object
|
||||
}
|
||||
|
||||
@kotlin.coroutines.jvm.internal.DebugMetadata
|
||||
@kotlin.Metadata
|
||||
final class TailSuspendUnitFunKt$multipleExitPointsWhen$2 {
|
||||
field label: int
|
||||
inner class TailSuspendUnitFunKt$multipleExitPointsWhen$2
|
||||
method <init>(p0: kotlin.coroutines.Continuation): void
|
||||
public final @org.jetbrains.annotations.NotNull method create(@org.jetbrains.annotations.NotNull p0: kotlin.coroutines.Continuation): kotlin.coroutines.Continuation
|
||||
public final method invoke(p0: java.lang.Object): java.lang.Object
|
||||
public final @org.jetbrains.annotations.Nullable method invokeSuspend(@org.jetbrains.annotations.NotNull p0: java.lang.Object): java.lang.Object
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
@kotlin.coroutines.jvm.internal.DebugMetadata
|
||||
final class TailSuspendUnitFunKt$notTailCall$1 {
|
||||
field label: int
|
||||
synthetic field result: java.lang.Object
|
||||
inner class TailSuspendUnitFunKt$notTailCall$1
|
||||
method <init>(p0: 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
|
||||
final class TailSuspendUnitFunKt$useGenericIngerType$2 {
|
||||
public final static field INSTANCE: TailSuspendUnitFunKt$useGenericIngerType$2
|
||||
inner class TailSuspendUnitFunKt$useGenericIngerType$2
|
||||
static method <clinit>(): void
|
||||
method <init>(): void
|
||||
public synthetic method invoke(): java.lang.Object
|
||||
public final method invoke(): void
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
@kotlin.coroutines.jvm.internal.DebugMetadata
|
||||
final class TailSuspendUnitFunKt$useNullableUnit$1 {
|
||||
field label: int
|
||||
synthetic field result: java.lang.Object
|
||||
inner class TailSuspendUnitFunKt$useNullableUnit$1
|
||||
method <init>(p0: 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 TailSuspendUnitFunKt {
|
||||
inner class TailSuspendUnitFunKt$callsIntNotTailCall$1
|
||||
inner class TailSuspendUnitFunKt$lambdaAsParameterNotTailCall$1
|
||||
inner class TailSuspendUnitFunKt$multipleExitPointsNotTailCall$1
|
||||
inner class TailSuspendUnitFunKt$multipleExitPointsWhen$2
|
||||
inner class TailSuspendUnitFunKt$notTailCall$1
|
||||
inner class TailSuspendUnitFunKt$useGenericIngerType$2
|
||||
inner class TailSuspendUnitFunKt$useNullableUnit$1
|
||||
public final static @org.jetbrains.annotations.Nullable method callsIntNotTailCall(@org.jetbrains.annotations.NotNull p0: kotlin.coroutines.Continuation): java.lang.Object
|
||||
public final static @org.jetbrains.annotations.Nullable method empty(@org.jetbrains.annotations.NotNull p0: kotlin.coroutines.Continuation): java.lang.Object
|
||||
public final static @org.jetbrains.annotations.Nullable method generic(@org.jetbrains.annotations.NotNull p0: kotlin.coroutines.Continuation): java.lang.Object
|
||||
public final static @org.jetbrains.annotations.Nullable method genericInferType(@org.jetbrains.annotations.NotNull p0: kotlin.jvm.functions.Function0, @org.jetbrains.annotations.NotNull p1: kotlin.coroutines.Continuation): java.lang.Object
|
||||
public final static @org.jetbrains.annotations.Nullable method lambdaAsParameter(@org.jetbrains.annotations.NotNull p0: kotlin.jvm.functions.Function1, @org.jetbrains.annotations.NotNull p1: kotlin.coroutines.Continuation): java.lang.Object
|
||||
public final static @org.jetbrains.annotations.Nullable method lambdaAsParameterNotTailCall(@org.jetbrains.annotations.NotNull p0: kotlin.jvm.functions.Function1, @org.jetbrains.annotations.NotNull p1: kotlin.coroutines.Continuation): java.lang.Object
|
||||
public final static @org.jetbrains.annotations.Nullable method lambdaAsParameterReturn(@org.jetbrains.annotations.NotNull p0: kotlin.jvm.functions.Function1, @org.jetbrains.annotations.NotNull p1: kotlin.coroutines.Continuation): java.lang.Object
|
||||
public final static @org.jetbrains.annotations.Nullable method multipleExitPoints(p0: boolean, @org.jetbrains.annotations.NotNull p1: kotlin.coroutines.Continuation): java.lang.Object
|
||||
public final static @org.jetbrains.annotations.Nullable method multipleExitPointsNotTailCall(p0: boolean, @org.jetbrains.annotations.NotNull p1: kotlin.coroutines.Continuation): java.lang.Object
|
||||
public final static @org.jetbrains.annotations.Nullable method multipleExitPointsWhen(p0: int, @org.jetbrains.annotations.NotNull p1: kotlin.coroutines.Continuation): java.lang.Object
|
||||
public final static @org.jetbrains.annotations.Nullable method multipleExitPointsWithOrdinaryInline(p0: boolean, @org.jetbrains.annotations.NotNull p1: kotlin.coroutines.Continuation): java.lang.Object
|
||||
public final static @org.jetbrains.annotations.Nullable method notTailCall(@org.jetbrains.annotations.NotNull p0: kotlin.coroutines.Continuation): java.lang.Object
|
||||
public final static @org.jetbrains.annotations.Nullable method nullableUnit(@org.jetbrains.annotations.NotNull p0: kotlin.coroutines.Continuation): java.lang.Object
|
||||
public final static method ordinary(): int
|
||||
public final static method ordinaryInline(): void
|
||||
public final static @org.jetbrains.annotations.Nullable method returnsInt(@org.jetbrains.annotations.NotNull p0: kotlin.coroutines.Continuation): java.lang.Object
|
||||
public final static @org.jetbrains.annotations.Nullable method useGenericClass(@org.jetbrains.annotations.NotNull p0: Generic, @org.jetbrains.annotations.NotNull p1: kotlin.coroutines.Continuation): java.lang.Object
|
||||
public final static @org.jetbrains.annotations.Nullable method useGenericIngerType(@org.jetbrains.annotations.NotNull p0: kotlin.coroutines.Continuation): java.lang.Object
|
||||
public final static @org.jetbrains.annotations.Nullable method useGenericReturningUnit(@org.jetbrains.annotations.NotNull p0: kotlin.coroutines.Continuation): java.lang.Object
|
||||
public final static @org.jetbrains.annotations.Nullable method useNullableUnit(@org.jetbrains.annotations.NotNull p0: kotlin.coroutines.Continuation): java.lang.Object
|
||||
public final static @org.jetbrains.annotations.Nullable method useRunRunRunRunRun(@org.jetbrains.annotations.NotNull p0: kotlin.coroutines.Continuation): java.lang.Object
|
||||
public final static @org.jetbrains.annotations.Nullable method withReturn(@org.jetbrains.annotations.NotNull p0: kotlin.coroutines.Continuation): java.lang.Object
|
||||
public final static @org.jetbrains.annotations.Nullable method withoutReturn(@org.jetbrains.annotations.NotNull p0: kotlin.coroutines.Continuation): java.lang.Object
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
// COMMON_COROUTINES_TEST
|
||||
// WITH_RUNTIME
|
||||
|
||||
suspend fun catchException(): String {
|
||||
try {
|
||||
return suspendWithException()
|
||||
}
|
||||
catch(e: Exception) {
|
||||
return e.message!!
|
||||
}
|
||||
}
|
||||
|
||||
suspend fun suspendWithException(): String = TODO()
|
||||
@@ -1,17 +0,0 @@
|
||||
@kotlin.Metadata
|
||||
final class TryCatchTailCallKt$catchException$1 {
|
||||
synthetic field data: java.lang.Object
|
||||
synthetic field exception: java.lang.Throwable
|
||||
inner class TryCatchTailCallKt$catchException$1
|
||||
method <init>(p0: COROUTINES_PACKAGE.Continuation): void
|
||||
public final @org.jetbrains.annotations.Nullable method doResume(@org.jetbrains.annotations.Nullable p0: java.lang.Object, @org.jetbrains.annotations.Nullable p1: java.lang.Throwable): java.lang.Object
|
||||
synthetic final method getLabel(): int
|
||||
synthetic final method setLabel(p0: int): void
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
public final class TryCatchTailCallKt {
|
||||
inner class TryCatchTailCallKt$catchException$1
|
||||
public final static @org.jetbrains.annotations.Nullable method catchException(@org.jetbrains.annotations.NotNull p0: COROUTINES_PACKAGE.Continuation): java.lang.Object
|
||||
public final static @org.jetbrains.annotations.Nullable method suspendWithException(@org.jetbrains.annotations.NotNull p0: COROUTINES_PACKAGE.Continuation): java.lang.Object
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
@kotlin.Metadata
|
||||
@kotlin.coroutines.jvm.internal.DebugMetadata
|
||||
final class TryCatchTailCallKt$catchException$1 {
|
||||
field label: int
|
||||
synthetic field result: java.lang.Object
|
||||
inner class TryCatchTailCallKt$catchException$1
|
||||
method <init>(p0: 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 TryCatchTailCallKt {
|
||||
inner class TryCatchTailCallKt$catchException$1
|
||||
public final static @org.jetbrains.annotations.Nullable method catchException(@org.jetbrains.annotations.NotNull p0: kotlin.coroutines.Continuation): java.lang.Object
|
||||
public final static @org.jetbrains.annotations.Nullable method suspendWithException(@org.jetbrains.annotations.NotNull p0: kotlin.coroutines.Continuation): java.lang.Object
|
||||
}
|
||||
@@ -1,121 +0,0 @@
|
||||
// COMMON_COROUTINES_TEST
|
||||
// WITH_RUNTIME
|
||||
|
||||
suspend fun empty() {}
|
||||
suspend fun withoutReturn() {
|
||||
empty()
|
||||
}
|
||||
|
||||
suspend fun twoReturns() {
|
||||
return empty()
|
||||
return empty()
|
||||
}
|
||||
|
||||
suspend fun notTailCall() {
|
||||
empty()
|
||||
return empty()
|
||||
empty()
|
||||
}
|
||||
|
||||
suspend fun lambdaAsParameter(c: suspend () -> Unit) {
|
||||
c()
|
||||
}
|
||||
|
||||
suspend fun lambdaAsParameterNotTailCall(c: suspend () -> Unit) {
|
||||
c()
|
||||
return c()
|
||||
c()
|
||||
}
|
||||
|
||||
suspend fun lambdaAsParameterReturn(c: suspend () -> Unit) {
|
||||
return c()
|
||||
c()
|
||||
}
|
||||
|
||||
suspend fun returnsInt() = 42
|
||||
suspend fun callsIntNotTailCall() {
|
||||
returnsInt()
|
||||
return
|
||||
empty()
|
||||
}
|
||||
|
||||
suspend fun multipleExitPoints(b: Boolean) {
|
||||
if (b) empty() else withoutReturn()
|
||||
return
|
||||
empty()
|
||||
}
|
||||
|
||||
suspend fun multipleExitPointsNotTailCall(b: Boolean) {
|
||||
if (b) empty() else returnsInt()
|
||||
return
|
||||
empty()
|
||||
}
|
||||
|
||||
fun ordinary() = 1
|
||||
inline fun ordinaryInline() {
|
||||
ordinary()
|
||||
}
|
||||
|
||||
suspend fun multipleExitPointsWithOrdinaryInline(b: Boolean) {
|
||||
if (b) empty() else ordinaryInline()
|
||||
return
|
||||
empty()
|
||||
}
|
||||
|
||||
suspend fun multipleExitPointsWhen(i: Int) {
|
||||
when (i) {
|
||||
1 -> empty()
|
||||
2 -> twoReturns()
|
||||
3 -> withoutReturn()
|
||||
else -> lambdaAsParameter {}
|
||||
}
|
||||
return
|
||||
empty()
|
||||
}
|
||||
|
||||
suspend fun <T> generic(): T = TODO()
|
||||
suspend fun useGenericReturningUnit() {
|
||||
generic<Unit>()
|
||||
return
|
||||
empty()
|
||||
}
|
||||
|
||||
class Generic<T> {
|
||||
suspend fun foo(): T = TODO()
|
||||
}
|
||||
|
||||
suspend fun useGenericClass(g: Generic<Unit>) {
|
||||
g.foo()
|
||||
return
|
||||
empty()
|
||||
}
|
||||
|
||||
suspend fun <T> genericInferType(c: () -> T): T = TODO()
|
||||
suspend fun useGenericInferType() {
|
||||
genericInferType {}
|
||||
return
|
||||
empty()
|
||||
}
|
||||
|
||||
suspend fun nullableUnit(): Unit? = null
|
||||
suspend fun useNullableUnit() {
|
||||
nullableUnit()
|
||||
return
|
||||
empty()
|
||||
}
|
||||
|
||||
suspend fun useRunRunRunRunRun() {
|
||||
run {
|
||||
run {
|
||||
run {
|
||||
run {
|
||||
run {
|
||||
empty()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return
|
||||
empty()
|
||||
}
|
||||
@@ -1,115 +0,0 @@
|
||||
@kotlin.Metadata
|
||||
public final class Generic {
|
||||
public method <init>(): void
|
||||
public final @org.jetbrains.annotations.Nullable method foo(@org.jetbrains.annotations.NotNull p0: COROUTINES_PACKAGE.Continuation): java.lang.Object
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
final class UnreachableKt$callsIntNotTailCall$1 {
|
||||
synthetic field data: java.lang.Object
|
||||
synthetic field exception: java.lang.Throwable
|
||||
inner class UnreachableKt$callsIntNotTailCall$1
|
||||
method <init>(p0: COROUTINES_PACKAGE.Continuation): void
|
||||
public final @org.jetbrains.annotations.Nullable method doResume(@org.jetbrains.annotations.Nullable p0: java.lang.Object, @org.jetbrains.annotations.Nullable p1: java.lang.Throwable): java.lang.Object
|
||||
synthetic final method getLabel(): int
|
||||
synthetic final method setLabel(p0: int): void
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
final class UnreachableKt$lambdaAsParameterNotTailCall$1 {
|
||||
field L$0: java.lang.Object
|
||||
synthetic field data: java.lang.Object
|
||||
synthetic field exception: java.lang.Throwable
|
||||
inner class UnreachableKt$lambdaAsParameterNotTailCall$1
|
||||
method <init>(p0: COROUTINES_PACKAGE.Continuation): void
|
||||
public final @org.jetbrains.annotations.Nullable method doResume(@org.jetbrains.annotations.Nullable p0: java.lang.Object, @org.jetbrains.annotations.Nullable p1: java.lang.Throwable): java.lang.Object
|
||||
synthetic final method getLabel(): int
|
||||
synthetic final method setLabel(p0: int): void
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
final class UnreachableKt$multipleExitPointsNotTailCall$1 {
|
||||
field Z$0: boolean
|
||||
synthetic field data: java.lang.Object
|
||||
synthetic field exception: java.lang.Throwable
|
||||
inner class UnreachableKt$multipleExitPointsNotTailCall$1
|
||||
method <init>(p0: COROUTINES_PACKAGE.Continuation): void
|
||||
public final @org.jetbrains.annotations.Nullable method doResume(@org.jetbrains.annotations.Nullable p0: java.lang.Object, @org.jetbrains.annotations.Nullable p1: java.lang.Throwable): java.lang.Object
|
||||
synthetic final method getLabel(): int
|
||||
synthetic final method setLabel(p0: int): void
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
final class UnreachableKt$multipleExitPointsWhen$2 {
|
||||
inner class UnreachableKt$multipleExitPointsWhen$2
|
||||
method <init>(p0: COROUTINES_PACKAGE.Continuation): void
|
||||
public final @org.jetbrains.annotations.NotNull method create(@org.jetbrains.annotations.NotNull p0: COROUTINES_PACKAGE.Continuation): COROUTINES_PACKAGE.Continuation
|
||||
public final @org.jetbrains.annotations.Nullable method doResume(@org.jetbrains.annotations.Nullable p0: java.lang.Object, @org.jetbrains.annotations.Nullable p1: java.lang.Throwable): java.lang.Object
|
||||
public final method invoke(p0: java.lang.Object): java.lang.Object
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
final class UnreachableKt$notTailCall$1 {
|
||||
synthetic field data: java.lang.Object
|
||||
synthetic field exception: java.lang.Throwable
|
||||
inner class UnreachableKt$notTailCall$1
|
||||
method <init>(p0: COROUTINES_PACKAGE.Continuation): void
|
||||
public final @org.jetbrains.annotations.Nullable method doResume(@org.jetbrains.annotations.Nullable p0: java.lang.Object, @org.jetbrains.annotations.Nullable p1: java.lang.Throwable): java.lang.Object
|
||||
synthetic final method getLabel(): int
|
||||
synthetic final method setLabel(p0: int): void
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
final class UnreachableKt$useGenericInferType$2 {
|
||||
public final static field INSTANCE: UnreachableKt$useGenericInferType$2
|
||||
inner class UnreachableKt$useGenericInferType$2
|
||||
static method <clinit>(): void
|
||||
method <init>(): void
|
||||
public synthetic method invoke(): java.lang.Object
|
||||
public final method invoke(): void
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
final class UnreachableKt$useNullableUnit$1 {
|
||||
synthetic field data: java.lang.Object
|
||||
synthetic field exception: java.lang.Throwable
|
||||
inner class UnreachableKt$useNullableUnit$1
|
||||
method <init>(p0: COROUTINES_PACKAGE.Continuation): void
|
||||
public final @org.jetbrains.annotations.Nullable method doResume(@org.jetbrains.annotations.Nullable p0: java.lang.Object, @org.jetbrains.annotations.Nullable p1: java.lang.Throwable): java.lang.Object
|
||||
synthetic final method getLabel(): int
|
||||
synthetic final method setLabel(p0: int): void
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
public final class UnreachableKt {
|
||||
inner class UnreachableKt$callsIntNotTailCall$1
|
||||
inner class UnreachableKt$lambdaAsParameterNotTailCall$1
|
||||
inner class UnreachableKt$multipleExitPointsNotTailCall$1
|
||||
inner class UnreachableKt$multipleExitPointsWhen$2
|
||||
inner class UnreachableKt$notTailCall$1
|
||||
inner class UnreachableKt$useGenericInferType$2
|
||||
inner class UnreachableKt$useNullableUnit$1
|
||||
public final static @org.jetbrains.annotations.Nullable method callsIntNotTailCall(@org.jetbrains.annotations.NotNull p0: COROUTINES_PACKAGE.Continuation): java.lang.Object
|
||||
public final static @org.jetbrains.annotations.Nullable method empty(@org.jetbrains.annotations.NotNull p0: COROUTINES_PACKAGE.Continuation): java.lang.Object
|
||||
public final static @org.jetbrains.annotations.Nullable method generic(@org.jetbrains.annotations.NotNull p0: COROUTINES_PACKAGE.Continuation): java.lang.Object
|
||||
public final static @org.jetbrains.annotations.Nullable method genericInferType(@org.jetbrains.annotations.NotNull p0: kotlin.jvm.functions.Function0, @org.jetbrains.annotations.NotNull p1: COROUTINES_PACKAGE.Continuation): java.lang.Object
|
||||
public final static @org.jetbrains.annotations.Nullable method lambdaAsParameter(@org.jetbrains.annotations.NotNull p0: kotlin.jvm.functions.Function1, @org.jetbrains.annotations.NotNull p1: COROUTINES_PACKAGE.Continuation): java.lang.Object
|
||||
public final static @org.jetbrains.annotations.Nullable method lambdaAsParameterNotTailCall(@org.jetbrains.annotations.NotNull p0: kotlin.jvm.functions.Function1, @org.jetbrains.annotations.NotNull p1: COROUTINES_PACKAGE.Continuation): java.lang.Object
|
||||
public final static @org.jetbrains.annotations.Nullable method lambdaAsParameterReturn(@org.jetbrains.annotations.NotNull p0: kotlin.jvm.functions.Function1, @org.jetbrains.annotations.NotNull p1: COROUTINES_PACKAGE.Continuation): java.lang.Object
|
||||
public final static @org.jetbrains.annotations.Nullable method multipleExitPoints(p0: boolean, @org.jetbrains.annotations.NotNull p1: COROUTINES_PACKAGE.Continuation): java.lang.Object
|
||||
public final static @org.jetbrains.annotations.Nullable method multipleExitPointsNotTailCall(p0: boolean, @org.jetbrains.annotations.NotNull p1: COROUTINES_PACKAGE.Continuation): java.lang.Object
|
||||
public final static @org.jetbrains.annotations.Nullable method multipleExitPointsWhen(p0: int, @org.jetbrains.annotations.NotNull p1: COROUTINES_PACKAGE.Continuation): java.lang.Object
|
||||
public final static @org.jetbrains.annotations.Nullable method multipleExitPointsWithOrdinaryInline(p0: boolean, @org.jetbrains.annotations.NotNull p1: COROUTINES_PACKAGE.Continuation): java.lang.Object
|
||||
public final static @org.jetbrains.annotations.Nullable method notTailCall(@org.jetbrains.annotations.NotNull p0: COROUTINES_PACKAGE.Continuation): java.lang.Object
|
||||
public final static @org.jetbrains.annotations.Nullable method nullableUnit(@org.jetbrains.annotations.NotNull p0: COROUTINES_PACKAGE.Continuation): java.lang.Object
|
||||
public final static method ordinary(): int
|
||||
public final static method ordinaryInline(): void
|
||||
public final static @org.jetbrains.annotations.Nullable method returnsInt(@org.jetbrains.annotations.NotNull p0: COROUTINES_PACKAGE.Continuation): java.lang.Object
|
||||
public final static @org.jetbrains.annotations.Nullable method twoReturns(@org.jetbrains.annotations.NotNull p0: COROUTINES_PACKAGE.Continuation): java.lang.Object
|
||||
public final static @org.jetbrains.annotations.Nullable method useGenericClass(@org.jetbrains.annotations.NotNull p0: Generic, @org.jetbrains.annotations.NotNull p1: COROUTINES_PACKAGE.Continuation): java.lang.Object
|
||||
public final static @org.jetbrains.annotations.Nullable method useGenericInferType(@org.jetbrains.annotations.NotNull p0: COROUTINES_PACKAGE.Continuation): java.lang.Object
|
||||
public final static @org.jetbrains.annotations.Nullable method useGenericReturningUnit(@org.jetbrains.annotations.NotNull p0: COROUTINES_PACKAGE.Continuation): java.lang.Object
|
||||
public final static @org.jetbrains.annotations.Nullable method useNullableUnit(@org.jetbrains.annotations.NotNull p0: COROUTINES_PACKAGE.Continuation): java.lang.Object
|
||||
public final static @org.jetbrains.annotations.Nullable method useRunRunRunRunRun(@org.jetbrains.annotations.NotNull p0: COROUTINES_PACKAGE.Continuation): java.lang.Object
|
||||
public final static @org.jetbrains.annotations.Nullable method withoutReturn(@org.jetbrains.annotations.NotNull p0: COROUTINES_PACKAGE.Continuation): java.lang.Object
|
||||
}
|
||||
@@ -1,112 +0,0 @@
|
||||
@kotlin.Metadata
|
||||
public final class Generic {
|
||||
public method <init>(): void
|
||||
public final @org.jetbrains.annotations.Nullable method foo(@org.jetbrains.annotations.NotNull p0: kotlin.coroutines.Continuation): java.lang.Object
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
@kotlin.coroutines.jvm.internal.DebugMetadata
|
||||
final class UnreachableKt$callsIntNotTailCall$1 {
|
||||
field label: int
|
||||
synthetic field result: java.lang.Object
|
||||
inner class UnreachableKt$callsIntNotTailCall$1
|
||||
method <init>(p0: 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
|
||||
@kotlin.coroutines.jvm.internal.DebugMetadata
|
||||
final class UnreachableKt$lambdaAsParameterNotTailCall$1 {
|
||||
field L$0: java.lang.Object
|
||||
field label: int
|
||||
synthetic field result: java.lang.Object
|
||||
inner class UnreachableKt$lambdaAsParameterNotTailCall$1
|
||||
method <init>(p0: 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
|
||||
@kotlin.coroutines.jvm.internal.DebugMetadata
|
||||
final class UnreachableKt$multipleExitPointsNotTailCall$1 {
|
||||
field Z$0: boolean
|
||||
field label: int
|
||||
synthetic field result: java.lang.Object
|
||||
inner class UnreachableKt$multipleExitPointsNotTailCall$1
|
||||
method <init>(p0: kotlin.coroutines.Continuation): void
|
||||
public final @org.jetbrains.annotations.Nullable method invokeSuspend(@org.jetbrains.annotations.NotNull p0: java.lang.Object): java.lang.Object
|
||||
}
|
||||
|
||||
@kotlin.coroutines.jvm.internal.DebugMetadata
|
||||
@kotlin.Metadata
|
||||
final class UnreachableKt$multipleExitPointsWhen$2 {
|
||||
field label: int
|
||||
inner class UnreachableKt$multipleExitPointsWhen$2
|
||||
method <init>(p0: kotlin.coroutines.Continuation): void
|
||||
public final @org.jetbrains.annotations.NotNull method create(@org.jetbrains.annotations.NotNull p0: kotlin.coroutines.Continuation): kotlin.coroutines.Continuation
|
||||
public final method invoke(p0: java.lang.Object): java.lang.Object
|
||||
public final @org.jetbrains.annotations.Nullable method invokeSuspend(@org.jetbrains.annotations.NotNull p0: java.lang.Object): java.lang.Object
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
@kotlin.coroutines.jvm.internal.DebugMetadata
|
||||
final class UnreachableKt$notTailCall$1 {
|
||||
field label: int
|
||||
synthetic field result: java.lang.Object
|
||||
inner class UnreachableKt$notTailCall$1
|
||||
method <init>(p0: 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
|
||||
final class UnreachableKt$useGenericInferType$2 {
|
||||
public final static field INSTANCE: UnreachableKt$useGenericInferType$2
|
||||
inner class UnreachableKt$useGenericInferType$2
|
||||
static method <clinit>(): void
|
||||
method <init>(): void
|
||||
public synthetic method invoke(): java.lang.Object
|
||||
public final method invoke(): void
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
@kotlin.coroutines.jvm.internal.DebugMetadata
|
||||
final class UnreachableKt$useNullableUnit$1 {
|
||||
field label: int
|
||||
synthetic field result: java.lang.Object
|
||||
inner class UnreachableKt$useNullableUnit$1
|
||||
method <init>(p0: 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 UnreachableKt {
|
||||
inner class UnreachableKt$callsIntNotTailCall$1
|
||||
inner class UnreachableKt$lambdaAsParameterNotTailCall$1
|
||||
inner class UnreachableKt$multipleExitPointsNotTailCall$1
|
||||
inner class UnreachableKt$multipleExitPointsWhen$2
|
||||
inner class UnreachableKt$notTailCall$1
|
||||
inner class UnreachableKt$useGenericInferType$2
|
||||
inner class UnreachableKt$useNullableUnit$1
|
||||
public final static @org.jetbrains.annotations.Nullable method callsIntNotTailCall(@org.jetbrains.annotations.NotNull p0: kotlin.coroutines.Continuation): java.lang.Object
|
||||
public final static @org.jetbrains.annotations.Nullable method empty(@org.jetbrains.annotations.NotNull p0: kotlin.coroutines.Continuation): java.lang.Object
|
||||
public final static @org.jetbrains.annotations.Nullable method generic(@org.jetbrains.annotations.NotNull p0: kotlin.coroutines.Continuation): java.lang.Object
|
||||
public final static @org.jetbrains.annotations.Nullable method genericInferType(@org.jetbrains.annotations.NotNull p0: kotlin.jvm.functions.Function0, @org.jetbrains.annotations.NotNull p1: kotlin.coroutines.Continuation): java.lang.Object
|
||||
public final static @org.jetbrains.annotations.Nullable method lambdaAsParameter(@org.jetbrains.annotations.NotNull p0: kotlin.jvm.functions.Function1, @org.jetbrains.annotations.NotNull p1: kotlin.coroutines.Continuation): java.lang.Object
|
||||
public final static @org.jetbrains.annotations.Nullable method lambdaAsParameterNotTailCall(@org.jetbrains.annotations.NotNull p0: kotlin.jvm.functions.Function1, @org.jetbrains.annotations.NotNull p1: kotlin.coroutines.Continuation): java.lang.Object
|
||||
public final static @org.jetbrains.annotations.Nullable method lambdaAsParameterReturn(@org.jetbrains.annotations.NotNull p0: kotlin.jvm.functions.Function1, @org.jetbrains.annotations.NotNull p1: kotlin.coroutines.Continuation): java.lang.Object
|
||||
public final static @org.jetbrains.annotations.Nullable method multipleExitPoints(p0: boolean, @org.jetbrains.annotations.NotNull p1: kotlin.coroutines.Continuation): java.lang.Object
|
||||
public final static @org.jetbrains.annotations.Nullable method multipleExitPointsNotTailCall(p0: boolean, @org.jetbrains.annotations.NotNull p1: kotlin.coroutines.Continuation): java.lang.Object
|
||||
public final static @org.jetbrains.annotations.Nullable method multipleExitPointsWhen(p0: int, @org.jetbrains.annotations.NotNull p1: kotlin.coroutines.Continuation): java.lang.Object
|
||||
public final static @org.jetbrains.annotations.Nullable method multipleExitPointsWithOrdinaryInline(p0: boolean, @org.jetbrains.annotations.NotNull p1: kotlin.coroutines.Continuation): java.lang.Object
|
||||
public final static @org.jetbrains.annotations.Nullable method notTailCall(@org.jetbrains.annotations.NotNull p0: kotlin.coroutines.Continuation): java.lang.Object
|
||||
public final static @org.jetbrains.annotations.Nullable method nullableUnit(@org.jetbrains.annotations.NotNull p0: kotlin.coroutines.Continuation): java.lang.Object
|
||||
public final static method ordinary(): int
|
||||
public final static method ordinaryInline(): void
|
||||
public final static @org.jetbrains.annotations.Nullable method returnsInt(@org.jetbrains.annotations.NotNull p0: kotlin.coroutines.Continuation): java.lang.Object
|
||||
public final static @org.jetbrains.annotations.Nullable method twoReturns(@org.jetbrains.annotations.NotNull p0: kotlin.coroutines.Continuation): java.lang.Object
|
||||
public final static @org.jetbrains.annotations.Nullable method useGenericClass(@org.jetbrains.annotations.NotNull p0: Generic, @org.jetbrains.annotations.NotNull p1: kotlin.coroutines.Continuation): java.lang.Object
|
||||
public final static @org.jetbrains.annotations.Nullable method useGenericInferType(@org.jetbrains.annotations.NotNull p0: kotlin.coroutines.Continuation): java.lang.Object
|
||||
public final static @org.jetbrains.annotations.Nullable method useGenericReturningUnit(@org.jetbrains.annotations.NotNull p0: kotlin.coroutines.Continuation): java.lang.Object
|
||||
public final static @org.jetbrains.annotations.Nullable method useNullableUnit(@org.jetbrains.annotations.NotNull p0: kotlin.coroutines.Continuation): java.lang.Object
|
||||
public final static @org.jetbrains.annotations.Nullable method useRunRunRunRunRun(@org.jetbrains.annotations.NotNull p0: kotlin.coroutines.Continuation): java.lang.Object
|
||||
public final static @org.jetbrains.annotations.Nullable method withoutReturn(@org.jetbrains.annotations.NotNull p0: kotlin.coroutines.Continuation): java.lang.Object
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
sealed class X {
|
||||
class A : X()
|
||||
class B : X()
|
||||
}
|
||||
|
||||
suspend fun process(a: X.A) {}
|
||||
suspend fun process(b: X.B) {}
|
||||
|
||||
suspend fun process(x: X) = when (x) {
|
||||
is X.A -> process(x)
|
||||
is X.B -> process(x)
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
@kotlin.Metadata
|
||||
public final class WhenUnitKt {
|
||||
public final static @org.jetbrains.annotations.Nullable method process(@org.jetbrains.annotations.NotNull p0: X$A, @org.jetbrains.annotations.Nullable p1: java.lang.Object): java.lang.Object
|
||||
public final static @org.jetbrains.annotations.Nullable method process(@org.jetbrains.annotations.NotNull p0: X$B, @org.jetbrains.annotations.Nullable p1: java.lang.Object): java.lang.Object
|
||||
public final static @org.jetbrains.annotations.Nullable method process(@org.jetbrains.annotations.NotNull p0: X, @org.jetbrains.annotations.Nullable p1: java.lang.Object): java.lang.Object
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
public final class X$A {
|
||||
inner class X$A
|
||||
public method <init>(): void
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
public final class X$B {
|
||||
inner class X$B
|
||||
public method <init>(): void
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
public abstract class X {
|
||||
inner class X$A
|
||||
inner class X$B
|
||||
private method <init>(): void
|
||||
public synthetic method <init>(p0: kotlin.jvm.internal.DefaultConstructorMarker): void
|
||||
}
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
|
||||
* Copyright 2010-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
|
||||
* that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
|
||||
* Copyright 2010-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
|
||||
* that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
|
||||
* Copyright 2010-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
|
||||
* that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
|
||||
* Copyright 2010-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
|
||||
* that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
@@ -7,7 +7,7 @@ package org.jetbrains.kotlin
|
||||
|
||||
import org.jetbrains.kotlin.resolve.DescriptorUtils
|
||||
|
||||
fun createTextForHelpers(isReleaseCoroutines: Boolean, checkStateMachine: Boolean): String {
|
||||
fun createTextForHelpers(isReleaseCoroutines: Boolean, checkStateMachine: Boolean, checkTailCallOptimization: Boolean): String {
|
||||
val coroutinesPackage =
|
||||
if (isReleaseCoroutines)
|
||||
DescriptorUtils.COROUTINES_PACKAGE_FQ_NAME_RELEASE.asString()
|
||||
@@ -123,9 +123,45 @@ fun createTextForHelpers(isReleaseCoroutines: Boolean, checkStateMachine: Boolea
|
||||
}
|
||||
""".trimIndent()
|
||||
|
||||
// TODO: Find a way to check for tail-call optimization on JS and Native
|
||||
val checkTailCallOptimizationString =
|
||||
"""
|
||||
class TailCallOptimizationCheckerClass {
|
||||
private val stackTrace = arrayListOf<StackTraceElement?>()
|
||||
|
||||
suspend fun saveStackTrace() = suspendCoroutineUninterceptedOrReturn<Unit> {
|
||||
saveStackTrace(it)
|
||||
}
|
||||
|
||||
fun saveStackTrace(c: Continuation<*>) {
|
||||
if (c !is CoroutineStackFrame) error("Continuation " + c + " is not subtype of CoroutineStackFrame")
|
||||
stackTrace.clear()
|
||||
var csf: CoroutineStackFrame? = c
|
||||
while (csf != null) {
|
||||
stackTrace.add(csf.getStackTraceElement())
|
||||
csf = csf.callerFrame
|
||||
}
|
||||
}
|
||||
|
||||
fun checkNoStateMachineIn(method: String) {
|
||||
stackTrace.find { it?.methodName == method }?.let { error("tail-call optimization miss: method at " + it + " has state-machine " +
|
||||
stackTrace.joinToString(separator = "\n")) }
|
||||
}
|
||||
|
||||
fun checkStateMachineIn(method: String) {
|
||||
stackTrace.find { it?.methodName == method } ?: error("tail-call optimization hit: method " + method + " has not state-machine " +
|
||||
stackTrace.joinToString(separator = "\n"))
|
||||
}
|
||||
}
|
||||
|
||||
val TailCallOptimizationChecker = TailCallOptimizationCheckerClass()
|
||||
""".trimIndent()
|
||||
|
||||
return """
|
||||
|package helpers
|
||||
|import $coroutinesPackage.*
|
||||
|import $coroutinesPackage.intrinsics.*
|
||||
|${if (checkTailCallOptimization) "import $coroutinesPackage.jvm.internal.*" else ""}
|
||||
|
|
||||
|fun <T> handleResultContinuation(x: (T) -> Unit): Continuation<T> = object: Continuation<T> {
|
||||
| override val context = EmptyCoroutineContext
|
||||
@@ -149,5 +185,6 @@ fun createTextForHelpers(isReleaseCoroutines: Boolean, checkStateMachine: Boolea
|
||||
|}
|
||||
|
|
||||
|${if (checkStateMachine) checkStateMachineString else ""}
|
||||
|${if (checkTailCallOptimization) checkTailCallOptimizationString else ""}
|
||||
""".trimMargin()
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
|
||||
* Copyright 2010-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
|
||||
* that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
@@ -807,12 +807,15 @@ public class KotlinTestUtils {
|
||||
!isDirectiveDefined(expectedText, "!LANGUAGE: -ReleaseCoroutines");
|
||||
|
||||
boolean checkStateMachine = isDirectiveDefined(expectedText, "CHECK_STATE_MACHINE");
|
||||
boolean checkTailCallOptimization = isDirectiveDefined(expectedText, "CHECK_TAIL_CALL_OPTIMIZATION");
|
||||
|
||||
testFiles.add(factory.createFile(supportModule,
|
||||
"CoroutineUtil.kt",
|
||||
CoroutineTestUtilKt.createTextForHelpers(isReleaseCoroutines, checkStateMachine),
|
||||
directives
|
||||
));
|
||||
testFiles.add(
|
||||
factory.createFile(
|
||||
supportModule,
|
||||
"CoroutineUtil.kt",
|
||||
CoroutineTestUtilKt.createTextForHelpers(isReleaseCoroutines, checkStateMachine, checkTailCallOptimization),
|
||||
directives
|
||||
));
|
||||
}
|
||||
|
||||
return testFiles;
|
||||
|
||||
@@ -792,12 +792,15 @@ public class KotlinTestUtils {
|
||||
!isDirectiveDefined(expectedText, "!LANGUAGE: -ReleaseCoroutines");
|
||||
|
||||
boolean checkStateMachine = isDirectiveDefined(expectedText, "CHECK_STATE_MACHINE");
|
||||
boolean checkTailCallOptimization = isDirectiveDefined(expectedText, "CHECK_TAIL_CALL_OPTIMIZATION");
|
||||
|
||||
testFiles.add(factory.createFile(supportModule,
|
||||
"CoroutineUtil.kt",
|
||||
CoroutineTestUtilKt.createTextForHelpers(isReleaseCoroutines, checkStateMachine),
|
||||
directives
|
||||
));
|
||||
testFiles.add(
|
||||
factory.createFile(
|
||||
supportModule,
|
||||
"CoroutineUtil.kt",
|
||||
CoroutineTestUtilKt.createTextForHelpers(isReleaseCoroutines, checkStateMachine, checkTailCallOptimization),
|
||||
directives
|
||||
));
|
||||
}
|
||||
|
||||
return testFiles;
|
||||
|
||||
+38
-43
@@ -5774,6 +5774,16 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/emptyClosure.kt", "kotlin.coroutines");
|
||||
}
|
||||
|
||||
@TestMetadata("epam.kt")
|
||||
public void testEpam_1_2() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/epam.kt", "kotlin.coroutines.experimental");
|
||||
}
|
||||
|
||||
@TestMetadata("epam.kt")
|
||||
public void testEpam_1_3() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/epam.kt", "kotlin.coroutines");
|
||||
}
|
||||
|
||||
@TestMetadata("falseUnitCoercion.kt")
|
||||
public void testFalseUnitCoercion_1_2() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/falseUnitCoercion.kt", "kotlin.coroutines.experimental");
|
||||
@@ -8063,13 +8073,8 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
||||
}
|
||||
|
||||
@TestMetadata("also.kt")
|
||||
public void testAlso_1_2() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/also.kt", "kotlin.coroutines.experimental");
|
||||
}
|
||||
|
||||
@TestMetadata("also.kt")
|
||||
public void testAlso_1_3() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/also.kt", "kotlin.coroutines");
|
||||
public void testAlso() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/coroutines/tailCallOptimizations/also.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("crossinline.kt")
|
||||
@@ -8082,24 +8087,9 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/crossinline.kt", "kotlin.coroutines");
|
||||
}
|
||||
|
||||
@TestMetadata("epam.kt")
|
||||
public void testEpam_1_2() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/epam.kt", "kotlin.coroutines.experimental");
|
||||
}
|
||||
|
||||
@TestMetadata("epam.kt")
|
||||
public void testEpam_1_3() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/epam.kt", "kotlin.coroutines");
|
||||
}
|
||||
|
||||
@TestMetadata("inlineWithStateMachine.kt")
|
||||
public void testInlineWithStateMachine_1_2() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/inlineWithStateMachine.kt", "kotlin.coroutines.experimental");
|
||||
}
|
||||
|
||||
@TestMetadata("inlineWithStateMachine.kt")
|
||||
public void testInlineWithStateMachine_1_3() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/inlineWithStateMachine.kt", "kotlin.coroutines");
|
||||
public void testInlineWithStateMachine() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/coroutines/tailCallOptimizations/inlineWithStateMachine.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("inlineWithoutStateMachine.kt")
|
||||
@@ -8123,13 +8113,28 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
||||
}
|
||||
|
||||
@TestMetadata("simple.kt")
|
||||
public void testSimple_1_2() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/simple.kt", "kotlin.coroutines.experimental");
|
||||
public void testSimple() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/coroutines/tailCallOptimizations/simple.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("simple.kt")
|
||||
public void testSimple_1_3() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/simple.kt", "kotlin.coroutines");
|
||||
@TestMetadata("tailCallIfReturnUnit.kt")
|
||||
public void testTailCallIfReturnUnit() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/coroutines/tailCallOptimizations/tailCallIfReturnUnit.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("tailCallIntrinsics.kt")
|
||||
public void testTailCallIntrinsics() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/coroutines/tailCallOptimizations/tailCallIntrinsics.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("tailSuspendUnitFun.kt")
|
||||
public void testTailSuspendUnitFun() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/coroutines/tailCallOptimizations/tailSuspendUnitFun.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("tryCatchTailCall.kt")
|
||||
public void testTryCatchTailCall() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/coroutines/tailCallOptimizations/tryCatchTailCall.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("tryCatch.kt")
|
||||
@@ -8143,23 +8148,13 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
||||
}
|
||||
|
||||
@TestMetadata("unreachable.kt")
|
||||
public void testUnreachable_1_2() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/unreachable.kt", "kotlin.coroutines.experimental");
|
||||
}
|
||||
|
||||
@TestMetadata("unreachable.kt")
|
||||
public void testUnreachable_1_3() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/unreachable.kt", "kotlin.coroutines");
|
||||
public void testUnreachable() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/coroutines/tailCallOptimizations/unreachable.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("whenUnit.kt")
|
||||
public void testWhenUnit_1_2() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/whenUnit.kt", "kotlin.coroutines.experimental");
|
||||
}
|
||||
|
||||
@TestMetadata("whenUnit.kt")
|
||||
public void testWhenUnit_1_3() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/whenUnit.kt", "kotlin.coroutines");
|
||||
public void testWhenUnit() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/coroutines/tailCallOptimizations/whenUnit.kt");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
-72
@@ -481,76 +481,4 @@ public class BytecodeListingTestGenerated extends AbstractBytecodeListingTest {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/codegen/bytecodeListing/tailcall")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class Tailcall extends AbstractBytecodeListingTest {
|
||||
private void runTest(String testDataFilePath) throws Exception {
|
||||
KotlinTestUtils.runTest(this::doTest, TargetBackend.ANY, testDataFilePath);
|
||||
}
|
||||
|
||||
private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception {
|
||||
KotlinTestUtils.runTest(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.ANY, testDataFilePath);
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInTailcall() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/bytecodeListing/tailcall"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true);
|
||||
}
|
||||
|
||||
@TestMetadata("tailCallIfReturnUnit.kt")
|
||||
public void testTailCallIfReturnUnit_1_2() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/bytecodeListing/tailcall/tailCallIfReturnUnit.kt", "kotlin.coroutines.experimental");
|
||||
}
|
||||
|
||||
@TestMetadata("tailCallIfReturnUnit.kt")
|
||||
public void testTailCallIfReturnUnit_1_3() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/bytecodeListing/tailcall/tailCallIfReturnUnit.kt", "kotlin.coroutines");
|
||||
}
|
||||
|
||||
@TestMetadata("tailCallIntrinsics.kt")
|
||||
public void testTailCallIntrinsics_1_2() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/bytecodeListing/tailcall/tailCallIntrinsics.kt", "kotlin.coroutines.experimental");
|
||||
}
|
||||
|
||||
@TestMetadata("tailCallIntrinsics.kt")
|
||||
public void testTailCallIntrinsics_1_3() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/bytecodeListing/tailcall/tailCallIntrinsics.kt", "kotlin.coroutines");
|
||||
}
|
||||
|
||||
@TestMetadata("tailSuspendUnitFun.kt")
|
||||
public void testTailSuspendUnitFun_1_2() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/bytecodeListing/tailcall/tailSuspendUnitFun.kt", "kotlin.coroutines.experimental");
|
||||
}
|
||||
|
||||
@TestMetadata("tailSuspendUnitFun.kt")
|
||||
public void testTailSuspendUnitFun_1_3() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/bytecodeListing/tailcall/tailSuspendUnitFun.kt", "kotlin.coroutines");
|
||||
}
|
||||
|
||||
@TestMetadata("tryCatchTailCall.kt")
|
||||
public void testTryCatchTailCall_1_2() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/bytecodeListing/tailcall/tryCatchTailCall.kt", "kotlin.coroutines.experimental");
|
||||
}
|
||||
|
||||
@TestMetadata("tryCatchTailCall.kt")
|
||||
public void testTryCatchTailCall_1_3() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/bytecodeListing/tailcall/tryCatchTailCall.kt", "kotlin.coroutines");
|
||||
}
|
||||
|
||||
@TestMetadata("unreachable.kt")
|
||||
public void testUnreachable_1_2() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/bytecodeListing/tailcall/unreachable.kt", "kotlin.coroutines.experimental");
|
||||
}
|
||||
|
||||
@TestMetadata("unreachable.kt")
|
||||
public void testUnreachable_1_3() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/bytecodeListing/tailcall/unreachable.kt", "kotlin.coroutines");
|
||||
}
|
||||
|
||||
@TestMetadata("whenUnit.kt")
|
||||
public void testWhenUnit() throws Exception {
|
||||
runTest("compiler/testData/codegen/bytecodeListing/tailcall/whenUnit.kt");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+38
-43
@@ -5774,6 +5774,16 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/emptyClosure.kt", "kotlin.coroutines");
|
||||
}
|
||||
|
||||
@TestMetadata("epam.kt")
|
||||
public void testEpam_1_2() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/epam.kt", "kotlin.coroutines.experimental");
|
||||
}
|
||||
|
||||
@TestMetadata("epam.kt")
|
||||
public void testEpam_1_3() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/epam.kt", "kotlin.coroutines");
|
||||
}
|
||||
|
||||
@TestMetadata("falseUnitCoercion.kt")
|
||||
public void testFalseUnitCoercion_1_2() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/falseUnitCoercion.kt", "kotlin.coroutines.experimental");
|
||||
@@ -8063,13 +8073,8 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
||||
}
|
||||
|
||||
@TestMetadata("also.kt")
|
||||
public void testAlso_1_2() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/also.kt", "kotlin.coroutines.experimental");
|
||||
}
|
||||
|
||||
@TestMetadata("also.kt")
|
||||
public void testAlso_1_3() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/also.kt", "kotlin.coroutines");
|
||||
public void testAlso() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/coroutines/tailCallOptimizations/also.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("crossinline.kt")
|
||||
@@ -8082,24 +8087,9 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/crossinline.kt", "kotlin.coroutines");
|
||||
}
|
||||
|
||||
@TestMetadata("epam.kt")
|
||||
public void testEpam_1_2() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/epam.kt", "kotlin.coroutines.experimental");
|
||||
}
|
||||
|
||||
@TestMetadata("epam.kt")
|
||||
public void testEpam_1_3() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/epam.kt", "kotlin.coroutines");
|
||||
}
|
||||
|
||||
@TestMetadata("inlineWithStateMachine.kt")
|
||||
public void testInlineWithStateMachine_1_2() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/inlineWithStateMachine.kt", "kotlin.coroutines.experimental");
|
||||
}
|
||||
|
||||
@TestMetadata("inlineWithStateMachine.kt")
|
||||
public void testInlineWithStateMachine_1_3() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/inlineWithStateMachine.kt", "kotlin.coroutines");
|
||||
public void testInlineWithStateMachine() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/coroutines/tailCallOptimizations/inlineWithStateMachine.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("inlineWithoutStateMachine.kt")
|
||||
@@ -8123,13 +8113,28 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
||||
}
|
||||
|
||||
@TestMetadata("simple.kt")
|
||||
public void testSimple_1_2() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/simple.kt", "kotlin.coroutines.experimental");
|
||||
public void testSimple() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/coroutines/tailCallOptimizations/simple.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("simple.kt")
|
||||
public void testSimple_1_3() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/simple.kt", "kotlin.coroutines");
|
||||
@TestMetadata("tailCallIfReturnUnit.kt")
|
||||
public void testTailCallIfReturnUnit() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/coroutines/tailCallOptimizations/tailCallIfReturnUnit.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("tailCallIntrinsics.kt")
|
||||
public void testTailCallIntrinsics() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/coroutines/tailCallOptimizations/tailCallIntrinsics.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("tailSuspendUnitFun.kt")
|
||||
public void testTailSuspendUnitFun() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/coroutines/tailCallOptimizations/tailSuspendUnitFun.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("tryCatchTailCall.kt")
|
||||
public void testTryCatchTailCall() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/coroutines/tailCallOptimizations/tryCatchTailCall.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("tryCatch.kt")
|
||||
@@ -8143,23 +8148,13 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
||||
}
|
||||
|
||||
@TestMetadata("unreachable.kt")
|
||||
public void testUnreachable_1_2() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/unreachable.kt", "kotlin.coroutines.experimental");
|
||||
}
|
||||
|
||||
@TestMetadata("unreachable.kt")
|
||||
public void testUnreachable_1_3() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/unreachable.kt", "kotlin.coroutines");
|
||||
public void testUnreachable() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/coroutines/tailCallOptimizations/unreachable.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("whenUnit.kt")
|
||||
public void testWhenUnit_1_2() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/whenUnit.kt", "kotlin.coroutines.experimental");
|
||||
}
|
||||
|
||||
@TestMetadata("whenUnit.kt")
|
||||
public void testWhenUnit_1_3() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/whenUnit.kt", "kotlin.coroutines");
|
||||
public void testWhenUnit() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/coroutines/tailCallOptimizations/whenUnit.kt");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+38
-43
@@ -5774,6 +5774,16 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/emptyClosure.kt", "kotlin.coroutines");
|
||||
}
|
||||
|
||||
@TestMetadata("epam.kt")
|
||||
public void testEpam_1_2() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/epam.kt", "kotlin.coroutines.experimental");
|
||||
}
|
||||
|
||||
@TestMetadata("epam.kt")
|
||||
public void testEpam_1_3() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/epam.kt", "kotlin.coroutines");
|
||||
}
|
||||
|
||||
@TestMetadata("falseUnitCoercion.kt")
|
||||
public void testFalseUnitCoercion_1_2() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/falseUnitCoercion.kt", "kotlin.coroutines.experimental");
|
||||
@@ -8063,13 +8073,8 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
||||
}
|
||||
|
||||
@TestMetadata("also.kt")
|
||||
public void testAlso_1_2() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/also.kt", "kotlin.coroutines.experimental");
|
||||
}
|
||||
|
||||
@TestMetadata("also.kt")
|
||||
public void testAlso_1_3() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/also.kt", "kotlin.coroutines");
|
||||
public void testAlso() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/coroutines/tailCallOptimizations/also.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("crossinline.kt")
|
||||
@@ -8082,24 +8087,9 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/crossinline.kt", "kotlin.coroutines");
|
||||
}
|
||||
|
||||
@TestMetadata("epam.kt")
|
||||
public void testEpam_1_2() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/epam.kt", "kotlin.coroutines.experimental");
|
||||
}
|
||||
|
||||
@TestMetadata("epam.kt")
|
||||
public void testEpam_1_3() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/epam.kt", "kotlin.coroutines");
|
||||
}
|
||||
|
||||
@TestMetadata("inlineWithStateMachine.kt")
|
||||
public void testInlineWithStateMachine_1_2() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/inlineWithStateMachine.kt", "kotlin.coroutines.experimental");
|
||||
}
|
||||
|
||||
@TestMetadata("inlineWithStateMachine.kt")
|
||||
public void testInlineWithStateMachine_1_3() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/inlineWithStateMachine.kt", "kotlin.coroutines");
|
||||
public void testInlineWithStateMachine() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/coroutines/tailCallOptimizations/inlineWithStateMachine.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("inlineWithoutStateMachine.kt")
|
||||
@@ -8123,13 +8113,28 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
||||
}
|
||||
|
||||
@TestMetadata("simple.kt")
|
||||
public void testSimple_1_2() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/simple.kt", "kotlin.coroutines.experimental");
|
||||
public void testSimple() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/coroutines/tailCallOptimizations/simple.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("simple.kt")
|
||||
public void testSimple_1_3() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/simple.kt", "kotlin.coroutines");
|
||||
@TestMetadata("tailCallIfReturnUnit.kt")
|
||||
public void testTailCallIfReturnUnit() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/coroutines/tailCallOptimizations/tailCallIfReturnUnit.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("tailCallIntrinsics.kt")
|
||||
public void testTailCallIntrinsics() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/coroutines/tailCallOptimizations/tailCallIntrinsics.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("tailSuspendUnitFun.kt")
|
||||
public void testTailSuspendUnitFun() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/coroutines/tailCallOptimizations/tailSuspendUnitFun.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("tryCatchTailCall.kt")
|
||||
public void testTryCatchTailCall() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/coroutines/tailCallOptimizations/tryCatchTailCall.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("tryCatch.kt")
|
||||
@@ -8143,23 +8148,13 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
||||
}
|
||||
|
||||
@TestMetadata("unreachable.kt")
|
||||
public void testUnreachable_1_2() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/unreachable.kt", "kotlin.coroutines.experimental");
|
||||
}
|
||||
|
||||
@TestMetadata("unreachable.kt")
|
||||
public void testUnreachable_1_3() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/unreachable.kt", "kotlin.coroutines");
|
||||
public void testUnreachable() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/coroutines/tailCallOptimizations/unreachable.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("whenUnit.kt")
|
||||
public void testWhenUnit_1_2() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/whenUnit.kt", "kotlin.coroutines.experimental");
|
||||
}
|
||||
|
||||
@TestMetadata("whenUnit.kt")
|
||||
public void testWhenUnit_1_3() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/whenUnit.kt", "kotlin.coroutines");
|
||||
public void testWhenUnit() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/coroutines/tailCallOptimizations/whenUnit.kt");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Generated
+5
-30
@@ -4804,6 +4804,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/emptyClosure.kt", "kotlin.coroutines");
|
||||
}
|
||||
|
||||
@TestMetadata("epam.kt")
|
||||
public void testEpam_1_3() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/epam.kt", "kotlin.coroutines");
|
||||
}
|
||||
|
||||
@TestMetadata("falseUnitCoercion.kt")
|
||||
public void testFalseUnitCoercion_1_3() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/falseUnitCoercion.kt", "kotlin.coroutines");
|
||||
@@ -6092,26 +6097,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/tailCallOptimizations"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS_IR, true);
|
||||
}
|
||||
|
||||
@TestMetadata("also.kt")
|
||||
public void testAlso_1_3() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/also.kt", "kotlin.coroutines");
|
||||
}
|
||||
|
||||
@TestMetadata("crossinline.kt")
|
||||
public void testCrossinline_1_3() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/crossinline.kt", "kotlin.coroutines");
|
||||
}
|
||||
|
||||
@TestMetadata("epam.kt")
|
||||
public void testEpam_1_3() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/epam.kt", "kotlin.coroutines");
|
||||
}
|
||||
|
||||
@TestMetadata("inlineWithStateMachine.kt")
|
||||
public void testInlineWithStateMachine_1_3() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/inlineWithStateMachine.kt", "kotlin.coroutines");
|
||||
}
|
||||
|
||||
@TestMetadata("inlineWithoutStateMachine.kt")
|
||||
public void testInlineWithoutStateMachine_1_3() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/inlineWithoutStateMachine.kt", "kotlin.coroutines");
|
||||
@@ -6122,25 +6112,10 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/innerObjectRetransformation.kt", "kotlin.coroutines");
|
||||
}
|
||||
|
||||
@TestMetadata("simple.kt")
|
||||
public void testSimple_1_3() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/simple.kt", "kotlin.coroutines");
|
||||
}
|
||||
|
||||
@TestMetadata("tryCatch.kt")
|
||||
public void testTryCatch_1_3() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/tryCatch.kt", "kotlin.coroutines");
|
||||
}
|
||||
|
||||
@TestMetadata("unreachable.kt")
|
||||
public void testUnreachable_1_3() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/unreachable.kt", "kotlin.coroutines");
|
||||
}
|
||||
|
||||
@TestMetadata("whenUnit.kt")
|
||||
public void testWhenUnit_1_3() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/whenUnit.kt", "kotlin.coroutines");
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/codegen/box/coroutines/tailOperations")
|
||||
|
||||
+10
-60
@@ -4914,6 +4914,16 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/emptyClosure.kt", "kotlin.coroutines");
|
||||
}
|
||||
|
||||
@TestMetadata("epam.kt")
|
||||
public void testEpam_1_2() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/epam.kt", "kotlin.coroutines.experimental");
|
||||
}
|
||||
|
||||
@TestMetadata("epam.kt")
|
||||
public void testEpam_1_3() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/epam.kt", "kotlin.coroutines");
|
||||
}
|
||||
|
||||
@TestMetadata("falseUnitCoercion.kt")
|
||||
public void testFalseUnitCoercion_1_2() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/falseUnitCoercion.kt", "kotlin.coroutines.experimental");
|
||||
@@ -7087,16 +7097,6 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/tailCallOptimizations"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS, true);
|
||||
}
|
||||
|
||||
@TestMetadata("also.kt")
|
||||
public void testAlso_1_2() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/also.kt", "kotlin.coroutines.experimental");
|
||||
}
|
||||
|
||||
@TestMetadata("also.kt")
|
||||
public void testAlso_1_3() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/also.kt", "kotlin.coroutines");
|
||||
}
|
||||
|
||||
@TestMetadata("crossinline.kt")
|
||||
public void testCrossinline_1_2() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/crossinline.kt", "kotlin.coroutines.experimental");
|
||||
@@ -7107,26 +7107,6 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/crossinline.kt", "kotlin.coroutines");
|
||||
}
|
||||
|
||||
@TestMetadata("epam.kt")
|
||||
public void testEpam_1_2() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/epam.kt", "kotlin.coroutines.experimental");
|
||||
}
|
||||
|
||||
@TestMetadata("epam.kt")
|
||||
public void testEpam_1_3() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/epam.kt", "kotlin.coroutines");
|
||||
}
|
||||
|
||||
@TestMetadata("inlineWithStateMachine.kt")
|
||||
public void testInlineWithStateMachine_1_2() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/inlineWithStateMachine.kt", "kotlin.coroutines.experimental");
|
||||
}
|
||||
|
||||
@TestMetadata("inlineWithStateMachine.kt")
|
||||
public void testInlineWithStateMachine_1_3() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/inlineWithStateMachine.kt", "kotlin.coroutines");
|
||||
}
|
||||
|
||||
@TestMetadata("inlineWithoutStateMachine.kt")
|
||||
public void testInlineWithoutStateMachine_1_2() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/inlineWithoutStateMachine.kt", "kotlin.coroutines.experimental");
|
||||
@@ -7147,16 +7127,6 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/innerObjectRetransformation.kt", "kotlin.coroutines");
|
||||
}
|
||||
|
||||
@TestMetadata("simple.kt")
|
||||
public void testSimple_1_2() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/simple.kt", "kotlin.coroutines.experimental");
|
||||
}
|
||||
|
||||
@TestMetadata("simple.kt")
|
||||
public void testSimple_1_3() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/simple.kt", "kotlin.coroutines");
|
||||
}
|
||||
|
||||
@TestMetadata("tryCatch.kt")
|
||||
public void testTryCatch_1_2() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/tryCatch.kt", "kotlin.coroutines.experimental");
|
||||
@@ -7166,26 +7136,6 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
|
||||
public void testTryCatch_1_3() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/tryCatch.kt", "kotlin.coroutines");
|
||||
}
|
||||
|
||||
@TestMetadata("unreachable.kt")
|
||||
public void testUnreachable_1_2() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/unreachable.kt", "kotlin.coroutines.experimental");
|
||||
}
|
||||
|
||||
@TestMetadata("unreachable.kt")
|
||||
public void testUnreachable_1_3() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/unreachable.kt", "kotlin.coroutines");
|
||||
}
|
||||
|
||||
@TestMetadata("whenUnit.kt")
|
||||
public void testWhenUnit_1_2() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/whenUnit.kt", "kotlin.coroutines.experimental");
|
||||
}
|
||||
|
||||
@TestMetadata("whenUnit.kt")
|
||||
public void testWhenUnit_1_3() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/whenUnit.kt", "kotlin.coroutines");
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/codegen/box/coroutines/tailOperations")
|
||||
|
||||
Reference in New Issue
Block a user