Keep $continuation in LVT

in case of suspend functions and `this` is case of lambdas, since they
are used in async stack trace generation.
Update tests.
 #KT-40661 Open
This commit is contained in:
Ilmir Usmanov
2020-07-28 12:49:38 +02:00
parent db40808186
commit 4fb5f8603a
23 changed files with 128 additions and 104 deletions
@@ -3,7 +3,9 @@ data class A(val x: String, val y: String)
suspend fun foo(a: A, block: suspend (Int, A, String) -> String): String = block(1, a, "#")
suspend fun test() = foo(A("O", "K")) { i_param, (x_param, y_param), v_param -> i_param.toString() + x_param + y_param + v_param }
suspend fun test() = foo(A("O", "K")) { i_param, (x_param, y_param), v_param ->
i_param.toString() + x_param + y_param + v_param
}
// Parameters (including anonymous destructuring parameters) are moved to fields in the Continuation class for the suspend lambda class.
// However, in non-IR, the fields are first stored in local variables, and they are not read directly (even for destructuring components).
@@ -13,7 +15,6 @@ suspend fun test() = foo(A("O", "K")) { i_param, (x_param, y_param), v_param ->
// JVM_TEMPLATES
// VARIABLE : NAME=i_param TYPE=I INDEX=2
// VARIABLE : NAME=$dstr$x_param$y_param TYPE=LA; INDEX=3
// VARIABLE : NAME=v_param TYPE=Ljava/lang/String; INDEX=4
// VARIABLE : NAME=x_param TYPE=Ljava/lang/String; INDEX=5
// VARIABLE : NAME=y_param TYPE=Ljava/lang/String; INDEX=6