Merge two consequent records in LVT

Otherwise, atomicfu will be unable to transform atomic variable usages.
This commit is contained in:
Ilmir Usmanov
2020-10-08 20:14:13 +02:00
parent 91b8e32d43
commit 375d92cf67
12 changed files with 68 additions and 7 deletions
@@ -0,0 +1,25 @@
import kotlin.coroutines.intrinsics.*
class AtomicInt(val value: Int)
fun atomic(i: Int) = AtomicInt(i)
class MyBlockingAdapter() {
private val state = atomic(0)
private val a = 77
suspend fun foo() {
val a = suspendBar()
}
private inline fun AtomicInt.extensionFun() {
if (a == 77) throw IllegalStateException("AAAAAAAAAAAA")
value
}
private suspend inline fun suspendBar() {
state.extensionFun()
suspendCoroutineUninterceptedOrReturn<Any?> { ucont ->
COROUTINE_SUSPENDED
}
}
}
// 1 LOCALVARIABLE \$this\$extensionFun\$iv\$iv LAtomicInt;
@@ -42,8 +42,8 @@ fun box(): String {
}
// 1 LOCALVARIABLE i Ljava/lang/String; L.* 3
// From liveness point of view, 's' is dead between 'println' and 's == "OK"', thus the range is split
// 2 LOCALVARIABLE s Ljava/lang/String; L.* 3
// We merge LVT records for two consequent branches.
// 1 LOCALVARIABLE s Ljava/lang/String; L.* 3
// 1 PUTFIELD VarValueConflictsWithTableSameSortKt\$box\$1.L\$0 : Ljava/lang/Object;
/* 1 load in the catch (e: Throwable) { throw e } block which is implicitly wrapped around try/finally */
// 1 ALOAD 3\s+ATHROW