[JVM_IR] Generate line numbers and nops for init blocks.

This seems to be what JVM does and it allows you to set a
breakpoint on the init line.
This commit is contained in:
Mads Ager
2020-05-28 14:27:38 +02:00
committed by max-kammerer
parent 85e2392fef
commit dc34d355bc
6 changed files with 97 additions and 6 deletions
+14 -4
View File
@@ -51,10 +51,8 @@ fun box() {
Zoo()
}
// IGNORE_BACKEND: JVM_IR
// The JVM_IR does not generate code that will break on the line
// containing the `init`, nor the exit from the `init`. It only
// contains lines for the contents of the init blocks.
// JVM_IR has an extra step back to the line of the class
// declaration for the return in the constructor.
// LINENUMBERS
// test.kt:48 box
@@ -64,6 +62,9 @@ fun box() {
// test.kt:45 x
// test.kt:7 <init>
// test.kt:8 <init>
// LINENUMBERS JVM_IR
// test.kt:3 <init>
// LINENUMBERS
// test.kt:48 box
// test.kt:49 box
// test.kt:11 <init>
@@ -73,6 +74,9 @@ fun box() {
// test.kt:16 <init>
// test.kt:17 <init>
// test.kt:18 <init>
// LINENUMBERS JVM_IR
// test.kt:11 <init>
// LINENUMBERS
// test.kt:49 box
// test.kt:50 box
// test.kt:21 <init>
@@ -85,6 +89,9 @@ fun box() {
// test.kt:28 <init>
// test.kt:29 <init>
// test.kt:30 <init>
// LINENUMBERS JVM_IR
// test.kt:21 <init>
// LINENUMBERS
// test.kt:50 box
// test.kt:51 box
// test.kt:33 <init>
@@ -94,5 +101,8 @@ fun box() {
// test.kt:39 <init>
// test.kt:40 <init>
// test.kt:42 <init>
// LINENUMBERS JVM_IR
// test.kt:33 <init>
// LINENUMBERS
// test.kt:51 box
// test.kt:52 box