JVM_IR: optimize property accesses in inline lambdas and private funs
This commit is contained in:
@@ -33,9 +33,22 @@ class Example
|
||||
b3 = 1
|
||||
b4 = 1
|
||||
b5 = 1
|
||||
foo { a1 = 1 }
|
||||
bar()
|
||||
}
|
||||
|
||||
private inline fun bar() { a1 = 1 }
|
||||
}
|
||||
|
||||
inline fun foo(x: () -> Unit) = x()
|
||||
|
||||
// Every property should be accessed directly in this example because they all are final class properties with default accessors
|
||||
// 0 INVOKESPECIAL Example\.set
|
||||
|
||||
// JVM_TEMPLATES
|
||||
// ...except the access in `private inline fun`.
|
||||
// 2 INVOKEVIRTUAL Example\.set
|
||||
|
||||
// JVM_IR_TEMPLATES
|
||||
// ...including the access in `private inline fun` which we know is only called from `init`.
|
||||
// 0 INVOKEVIRTUAL Example\.set
|
||||
|
||||
Reference in New Issue
Block a user