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
@@ -1,10 +1,8 @@
@kotlin.jvm.internal.KotlinClass Example {
public synthetic field $kotlinClass: kotlin.reflect.KClass
private synthetic @org.jetbrains.annotations.NotNull field prop: java.lang.String
private field prop2: int
private synthetic field useSite: int
private field useSite2: int
method <clinit>(): void
public @org.jetbrains.annotations.NotNull method getProp(): java.lang.String
public synthetic method getProp2(): int
public synthetic method setProp2(p0: int): void