[JVM_IR]: Improve stepping for when.

Additionally, use the line number of the class for default interface
dispatch methods.
This commit is contained in:
Mads Ager
2020-06-30 16:51:39 +02:00
committed by max-kammerer
parent 1009a240f2
commit 7f2efabe6a
17 changed files with 742 additions and 123 deletions
+121
View File
@@ -0,0 +1,121 @@
// FILE: test.kt
fun foo(x: Int) {
when
(x)
{
21 -> foo(42)
42 -> foo(63)
else -> 1
}
val t = when
(x)
{
21 -> foo(42)
42 -> foo(63)
else -> 2
}
}
fun box() {
foo(21)
}
// JVM_IR uses the line number of the when for the table switch and therefore,
// it stops on the subject line first, then on the when line (line 4 and 12), and
// then goes to the right branch.
// LINENUMBERS
// test.kt:22 box
// test.kt:5 foo
// LINENUMBERS JVM_IR
// test.kt:4 foo
// LINENUMBERS
// test.kt:7 foo
// test.kt:5 foo
// LINENUMBERS JVM_IR
// test.kt:4 foo
// LINENUMBERS
// test.kt:8 foo
// test.kt:5 foo
// LINENUMBERS JVM_IR
// test.kt:4 foo
// LINENUMBERS
// test.kt:9 foo
// test.kt:13 foo
// LINENUMBERS JVM_IR
// test.kt:12 foo
// LINENUMBERS
// test.kt:17 foo
// test.kt:12 foo
// test.kt:19 foo
// test.kt:8 foo
// test.kt:13 foo
// LINENUMBERS JVM_IR
// test.kt:12 foo
// LINENUMBERS
// test.kt:16 foo
// test.kt:5 foo
// LINENUMBERS JVM_IR
// test.kt:4 foo
// LINENUMBERS
// test.kt:9 foo
// test.kt:13 foo
// LINENUMBERS JVM_IR
// test.kt:12 foo
// LINENUMBERS
// test.kt:17 foo
// test.kt:12 foo
// test.kt:19 foo
// test.kt:16 foo
// test.kt:12 foo
// test.kt:19 foo
// test.kt:7 foo
// test.kt:13 foo
// LINENUMBERS JVM_IR
// test.kt:12 foo
// LINENUMBERS
// test.kt:15 foo
// test.kt:5 foo
// LINENUMBERS JVM_IR
// test.kt:4 foo
// LINENUMBERS
// test.kt:8 foo
// test.kt:5 foo
// LINENUMBERS JVM_IR
// test.kt:4 foo
// LINENUMBERS
// test.kt:9 foo
// test.kt:13 foo
// LINENUMBERS JVM_IR
// test.kt:12 foo
// LINENUMBERS
// test.kt:17 foo
// test.kt:12 foo
// test.kt:19 foo
// test.kt:8 foo
// test.kt:13 foo
// LINENUMBERS JVM_IR
// test.kt:12 foo
// LINENUMBERS
// test.kt:16 foo
// test.kt:5 foo
// LINENUMBERS JVM_IR
// test.kt:4 foo
// LINENUMBERS
// test.kt:9 foo
// test.kt:13 foo
// LINENUMBERS JVM_IR
// test.kt:12 foo
// LINENUMBERS
// test.kt:17 foo
// test.kt:12 foo
// test.kt:19 foo
// test.kt:16 foo
// test.kt:12 foo
// test.kt:19 foo
// test.kt:15 foo
// test.kt:12 foo
// test.kt:19 foo
// test.kt:23 box