JVM IR: Make inlining in $default stubs compatible with the JVM BE

The JVM BE inlines calls to the underlying function in a $default stub
verbatim, e.g., without renaming LVT entries or regenerating anonymous
objects. This commit introduces the same behavior in the JVM IR BE.

Fixes KT-36769.
This commit is contained in:
Steven Schäfer
2020-09-14 18:14:20 +02:00
committed by max-kammerer
parent bef0437edb
commit 5e27d9b089
10 changed files with 66 additions and 56 deletions
@@ -1,4 +1,4 @@
// IGNORE_BACKEND: JVM_IR
// FILE: test.kt
inline fun foo(stringMaker: () -> String = { "OK" }): String {
return stringMaker()
@@ -17,19 +17,6 @@ fun box(): String {
return "OK"
}
// The IR Backend does the following:
// test.kt:15
// test.kt:3
// test.kt:4
// test.kt:3
// test.kt:3 <---
// test.kt:16
// test.kt:7
// test.kt:11
// test.kt:8
// test.kt:7 <---
// test.kt:17
// LINENUMBERS
// test.kt:15 box
// test.kt:3 box