Don't create KClass and KPackage instances in <clinit>

This proved to be a fragile technique, which probably doesn't even improve
performance in most cases but has lots of unexpected problems: unconditional
initialization of reflection classes, increasing the size of the bytecode, bugs
with <clinit> in annotations on JVM 6, inability to support conversion of a
class from Kotlin to Java without recompiling clients which use it
reflectively, etc.
This commit is contained in:
Alexander Udalov
2015-10-06 21:55:49 +03:00
parent fe737886cd
commit a4732b442d
24 changed files with 51 additions and 161 deletions
@@ -22,8 +22,6 @@
@kotlin.jvm.internal.KotlinLocalClass @kotlin.jvm.internal.KotlinClass LiteralsKt$foo$3 {
inner class LiteralsKt$foo$3
public synthetic field $kotlinClass: kotlin.reflect.KClass
method <clinit>(): void
method <init>(): void
}
@@ -45,15 +43,11 @@
}
@kotlin.jvm.internal.KotlinClass My {
public synthetic field $kotlinClass: kotlin.reflect.KClass
method <clinit>(): void
public method <init>(): void
}
@java.lang.Deprecated @kotlin.jvm.internal.KotlinPackage _DefaultPackage {
public synthetic field $kotlinPackage: kotlin.reflect.KPackage
public synthetic field $moduleName: java.lang.String
method <clinit>(): void
public @kotlin.jvm.internal.KotlinDelegatedMethod method bar(@org.jetbrains.annotations.NotNull p0: kotlin.jvm.functions.Function0): int
public @kotlin.jvm.internal.KotlinDelegatedMethod @org.jetbrains.annotations.NotNull method foo(p0: int): My
}
}