Replace CHECKCAST kotlin/Unit with ARETURN for tail call optimization

Sometimes instead of {POP, GETSTATIC Unit.INSTANCE, ARETURN} sequence
the codegen emits {CHECKCAST Unit, ARETURN} sequence, which breaks tail
call optimization. By replacing CHECKCAST with ARETURN we eliminate
this issue.

 #KT-19790: Fixed
This commit is contained in:
Ilmir Usmanov
2018-03-27 19:59:17 +03:00
parent 7b2de2de5e
commit eb81c205c7
18 changed files with 223 additions and 58 deletions
@@ -0,0 +1,17 @@
@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: 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 TryCatchTailCallKt {
inner class TryCatchTailCallKt$catchException$1
public final static @org.jetbrains.annotations.Nullable method catchException(@org.jetbrains.annotations.Nullable p0: java.lang.Object): java.lang.Object
public final static @org.jetbrains.annotations.Nullable method suspendWithException(@org.jetbrains.annotations.Nullable p0: java.lang.Object): java.lang.Object
}