JVM_IR: move const initialization handling to lowering
Had to edit some bytecodeText tests to account for the fact that JVM_IR no longer generates explicit initializations for ConstantValue fields, but NoConstantValueAttributeForNonConstVals is not the default yet.
This commit is contained in:
@@ -10,7 +10,6 @@ class My {
|
||||
}
|
||||
|
||||
// 1 GETSTATIC My.my
|
||||
// 1 PUTSTATIC My.my
|
||||
// 0 INVOKESTATIC My\$Companion.access\$getMy\$p
|
||||
// 0 INVOKESTATIC My.access\$getMy\$cp
|
||||
// 0 INVOKESPECIAL My\$Companion.getMy
|
||||
+2
-3
@@ -1,5 +1,4 @@
|
||||
// Generates ICONST_1
|
||||
val a = 1
|
||||
val a = 2
|
||||
|
||||
fun main() {
|
||||
// Generates IF_ICMPNE
|
||||
@@ -34,7 +33,7 @@ fun main() {
|
||||
}
|
||||
|
||||
//0 ICONST_0
|
||||
//1 ICONST_1
|
||||
//0 ICONST_1
|
||||
//2 IF_ICMPNE
|
||||
//1 IF_ICMPLE
|
||||
//1 IF_ICMPLT
|
||||
|
||||
+2
-3
@@ -1,5 +1,4 @@
|
||||
// Generates ICONST_1
|
||||
val a = 1
|
||||
val a = 2
|
||||
|
||||
fun main() {
|
||||
// Generates IF_ICMPEQ and GOTO
|
||||
@@ -46,7 +45,7 @@ fun main() {
|
||||
}
|
||||
|
||||
//0 ICONST_0
|
||||
//1 ICONST_1
|
||||
//0 ICONST_1
|
||||
//2 IF_ICMPEQ
|
||||
//1 IF_ICMPLE
|
||||
//1 IF_ICMPLT
|
||||
|
||||
+2
-3
@@ -1,5 +1,4 @@
|
||||
// Generates ICONST_1
|
||||
val a = 1
|
||||
val a = 2
|
||||
|
||||
fun main() {
|
||||
// Generates IF_ICMPEQ and GOTO
|
||||
@@ -34,7 +33,7 @@ fun main() {
|
||||
}
|
||||
|
||||
//0 ICONST_0
|
||||
//1 ICONST_1
|
||||
//0 ICONST_1
|
||||
//2 IF_ICMPEQ
|
||||
//1 IF_ICMPLE
|
||||
//1 IF_ICMPLT
|
||||
|
||||
+2
-3
@@ -1,5 +1,4 @@
|
||||
// Generates ICONST_1
|
||||
val a = 1
|
||||
val a = 2
|
||||
|
||||
fun main() {
|
||||
// Generates IFNE
|
||||
@@ -34,7 +33,7 @@ fun main() {
|
||||
}
|
||||
|
||||
//0 ICONST_0
|
||||
//1 ICONST_1
|
||||
//0 ICONST_1
|
||||
//2 IFNE
|
||||
//1 IFLE
|
||||
//1 IFLT
|
||||
|
||||
+2
-3
@@ -1,5 +1,4 @@
|
||||
// Generates ICONST_1
|
||||
val a = 1
|
||||
val a = 2
|
||||
|
||||
fun main() {
|
||||
// Generates IFEQ and GOTO
|
||||
@@ -46,7 +45,7 @@ fun main() {
|
||||
}
|
||||
|
||||
//0 ICONST_0
|
||||
//1 ICONST_1
|
||||
//0 ICONST_1
|
||||
//2 IFEQ
|
||||
//1 IFLE
|
||||
//1 IFLT
|
||||
|
||||
+2
-3
@@ -1,5 +1,4 @@
|
||||
// Generates ICONST_1
|
||||
val a = 1
|
||||
val a = 2
|
||||
|
||||
fun main() {
|
||||
// Generates IFEQ and GOTO
|
||||
@@ -34,7 +33,7 @@ fun main() {
|
||||
}
|
||||
|
||||
//0 ICONST_0
|
||||
//1 ICONST_1
|
||||
//0 ICONST_1
|
||||
//2 IFEQ
|
||||
//1 IFLE
|
||||
//1 IFLT
|
||||
|
||||
+2
-3
@@ -1,5 +1,4 @@
|
||||
// Generates ICONST_1
|
||||
val a = 1
|
||||
val a = 2
|
||||
|
||||
fun main() {
|
||||
// Generates IF_ICMPEQ
|
||||
@@ -29,7 +28,7 @@ fun main() {
|
||||
}
|
||||
|
||||
//0 ICONST_0
|
||||
//1 ICONST_1
|
||||
//0 ICONST_1
|
||||
//1 IF_ICMPEQ
|
||||
//1 IF_ICMPLE
|
||||
//1 IF_ICMPLT
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
// Generates ICONST_1
|
||||
val a = 1
|
||||
val a = 2
|
||||
|
||||
fun main() {
|
||||
// Generates IF_ICMPNE and GOTO
|
||||
@@ -39,7 +38,7 @@ fun main() {
|
||||
}
|
||||
|
||||
//0 ICONST_0
|
||||
//1 ICONST_1
|
||||
//0 ICONST_1
|
||||
//1 IF_ICMPNE
|
||||
//1 IF_ICMPLE
|
||||
//1 IF_ICMPLT
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
// Generates ICONST_1
|
||||
val a = 1
|
||||
val a = 2
|
||||
|
||||
fun main() {
|
||||
// Generates IF_ICMPNE and GOTO
|
||||
@@ -29,7 +28,7 @@ fun main() {
|
||||
}
|
||||
|
||||
//0 ICONST_0
|
||||
//1 ICONST_1
|
||||
//0 ICONST_1
|
||||
//1 IF_ICMPNE
|
||||
//1 IF_ICMPLE
|
||||
//1 IF_ICMPLT
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
// Generates ICONST_1
|
||||
val a = 1
|
||||
val a = 2
|
||||
|
||||
fun main() {
|
||||
// Generates IFEQ
|
||||
@@ -29,7 +28,7 @@ fun main() {
|
||||
}
|
||||
|
||||
//0 ICONST_0
|
||||
//1 ICONST_1
|
||||
//0 ICONST_1
|
||||
//1 IFEQ
|
||||
//1 IFLE
|
||||
//1 IFLT
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
// Generates ICONST_1
|
||||
val a = 1
|
||||
val a = 0
|
||||
|
||||
fun main() {
|
||||
// Generates IFNE and GOTO
|
||||
@@ -39,7 +38,7 @@ fun main() {
|
||||
}
|
||||
|
||||
//0 ICONST_0
|
||||
//1 ICONST_1
|
||||
//0 ICONST_1
|
||||
//1 IFNE
|
||||
//1 IFLE
|
||||
//1 IFLT
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
// Generates ICONST_1
|
||||
val a = 1
|
||||
val a = 2
|
||||
|
||||
fun main() {
|
||||
// Generates IFNE and GOTO
|
||||
@@ -29,7 +28,7 @@ fun main() {
|
||||
}
|
||||
|
||||
//0 ICONST_0
|
||||
//1 ICONST_1
|
||||
//0 ICONST_1
|
||||
//1 IFNE
|
||||
//1 IFLE
|
||||
//1 IFLT
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// !LANGUAGE: +NoConstantValueAttributeForNonConstVals
|
||||
val a = 1.0 + 10
|
||||
val b = 2 + 10.0
|
||||
val c = 3.0F + 10
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
val s = "1" + "2" + 3 + 4L + 5.0 + 6F + '7'
|
||||
val c = "${"1"}2${3}${4L}${5.0}${6F}${'7'}"
|
||||
fun s() = "1" + "2" + 3 + 4L + 5.0 + 6F + '7'
|
||||
fun c() = "${"1"}2${3}${4L}${5.0}${6F}${'7'}"
|
||||
|
||||
// 0 NEW java/lang/StringBuilder
|
||||
// 2 LDC "12345.06.07"
|
||||
@@ -5,8 +5,8 @@ const val double = 5.0
|
||||
const val float = 6F
|
||||
const val char = '7'
|
||||
|
||||
val s = "1" + string + int + long + double + float + char
|
||||
val c = "1$string$int$long$double$float$char"
|
||||
fun s() = "1" + string + int + long + double + float + char
|
||||
fun c() = "1$string$int$long$double$float$char"
|
||||
|
||||
// 0 NEW java/lang/StringBuilder
|
||||
// 2 LDC "12345.06.07"
|
||||
Reference in New Issue
Block a user