JVM IR: initialize enum entries without invokedynamic
#KT-57316 Fixed
This commit is contained in:
committed by
Space Team
parent
9c2c11f7e9
commit
562b27db4e
@@ -3,5 +3,10 @@ enum class Foo {
|
||||
open fun result() = "Fail"
|
||||
}
|
||||
|
||||
// JVM_TEMPLATES
|
||||
// There are two CHECKCASTs, one in Foo.valueOf and one in Foo.values
|
||||
// 2 CHECKCAST
|
||||
|
||||
// JVM_IR_TEMPLATES
|
||||
// For JVM IR, there's an additional checkcast of `$ENTRIES` to `[Ljava/lang/Enum;` in the static initializer.
|
||||
// 3 CHECKCAST
|
||||
|
||||
@@ -5,7 +5,7 @@ enum class MyEnum {
|
||||
E
|
||||
}
|
||||
|
||||
// 1 INVOKEDYNAMIC
|
||||
// 0 INVOKEDYNAMIC
|
||||
// 1 kotlin.enums.EnumEntries<MyEnum> getEntries\(\)
|
||||
// 1 private final static synthetic Lkotlin/enums/EnumEntries; \$ENTRIES
|
||||
// 1 public static getEntries\(\)Lkotlin/enums/EnumEntries;
|
||||
|
||||
Reference in New Issue
Block a user