JVM_IR: do not explicitly initialize Refs to default values

This commit is contained in:
pyos
2020-03-03 10:06:58 +01:00
committed by Dmitry Petrov
parent 13b04e63be
commit 037b442e86
6 changed files with 10 additions and 15 deletions
@@ -1,5 +1,5 @@
fun test() {
var x = 0
var x = 1
run {
val obj = object {
fun foo() { ++x }
@@ -1,7 +1,7 @@
fun runNoInline(f: () -> Unit) = f()
fun test() {
var x = 0
var x = 1
runNoInline { ++x }
}
@@ -1,7 +1,7 @@
fun runNoInline(f: () -> Unit) = f()
fun test() {
var x = 0
var x = 1
run {
run {
runNoInline {
@@ -1,6 +1,3 @@
// IGNORE_BACKEND: JVM_IR
// TODO KT-36648 Captured variables not optimized in JVM_IR
fun box(): String {
run {
run {
@@ -24,8 +21,7 @@ fun box(): String {
// 4 ILOAD 6
// 4 ISTORE 6
// Temporary variable slots for 'x2++' + store to fake index:
// 0 ILOAD 1
// Temporary variable for 'x2++' + store to fake variable marking the outer `run`:
// 2 ISTORE 1
// 0 NEW
@@ -7,10 +7,4 @@ fun test(): Char {
}
// 1 LOCALVARIABLE c Ljava/lang/Object;
// JVM_TEMPLATES
// 2 ASTORE 0
// JVM_IR_TEMPLATES
// 3 ASTORE 0
// *two* of them are after the start of c's live range
// 2 ASTORE 0