KT-14258 Optimize accesses to properties defined into companion
- Use direct access to property defined into companion object when it is possible rather than always use an accessor to access the property. - Use direct access will speedup runtime performance. - Avoid to generate useless accessors for companion properties. Fix of https://youtrack.jetbrains.com/issue/KT-14258
This commit is contained in:
committed by
Alexander Udalov
parent
fd244be9ca
commit
d0ed0c4049
+5
-1
@@ -9,9 +9,13 @@ class Foo {
|
||||
}
|
||||
|
||||
fun foo() {
|
||||
// Access to the property use getstatic on the backed field
|
||||
LOCAL_PRIVATE
|
||||
// Access to the property requires an invokestatic
|
||||
OUTER_PRIVATE
|
||||
}
|
||||
}
|
||||
|
||||
// 2 INVOKESTATIC
|
||||
// 1 INVOKESTATIC
|
||||
// 1 PUTSTATIC
|
||||
// 2 GETSTATIC
|
||||
Reference in New Issue
Block a user