Instance field generation in objects
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
public class B {
|
||||
public static int a = A.INSTANCE$.getC();
|
||||
public static int b = A.INSTANCE$.foo();
|
||||
}
|
||||
Vendored
+10
@@ -0,0 +1,10 @@
|
||||
import B
|
||||
|
||||
object A {
|
||||
val c = 1
|
||||
fun foo() = 4
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
return if (B.a == 1 && B.b == 4) "OK" else "${B.a} ${B.b}"
|
||||
}
|
||||
@@ -17,6 +17,6 @@ fun test() {
|
||||
(::local)()
|
||||
}
|
||||
|
||||
// 3 GETSTATIC ConstClosureOptimizationKt\$test\$1\.INSTANCE\$
|
||||
// 1 GETSTATIC ConstClosureOptimizationKt\$test\$2\.INSTANCE\$
|
||||
// 1 GETSTATIC ConstClosureOptimizationKt\$test\$3\.INSTANCE\$
|
||||
// 3 GETSTATIC ConstClosureOptimizationKt\$test\$1\.INSTANCE
|
||||
// 1 GETSTATIC ConstClosureOptimizationKt\$test\$2\.INSTANCE
|
||||
// 1 GETSTATIC ConstClosureOptimizationKt\$test\$3\.INSTANCE
|
||||
|
||||
@@ -16,4 +16,4 @@ class B {
|
||||
3 others are for getCONST_VAL
|
||||
*/
|
||||
|
||||
// 5 DEPRECATED
|
||||
// 6 DEPRECATED
|
||||
@@ -4,4 +4,4 @@ class A {
|
||||
}
|
||||
}
|
||||
// A and companion object constructor call
|
||||
// 3 ALOAD 0
|
||||
// 4 ALOAD 0
|
||||
+1
-1
@@ -4,5 +4,5 @@ class A {
|
||||
}
|
||||
}
|
||||
// A and companion object constructor call
|
||||
// 3 ALOAD 0
|
||||
// 4 ALOAD 0
|
||||
// 1 synthetic access\$getR
|
||||
|
||||
@@ -2,5 +2,5 @@ object A {
|
||||
val r: Int = 1
|
||||
}
|
||||
// Field initialized in constant pool
|
||||
// A super constructor call and INSTANCE$ put
|
||||
// 2 ALOAD 0
|
||||
// A super constructor call, INSTANCE and INSTANCE$ put
|
||||
// 3 ALOAD 0
|
||||
Reference in New Issue
Block a user