Construct reflection objects via static factory methods

JVM back-end now generates invocations of these methods instead of
KClass/K*Property/... constructors for two reasons:

1. It occupies less space in the bytecode
2. We can (to some degree) alter the implementation of the factory methods
   without changing the ABI compatibility version
This commit is contained in:
Alexander Udalov
2014-06-09 16:31:30 +04:00
parent e7f19c531a
commit c17f515d06
7 changed files with 87 additions and 32 deletions
@@ -47,6 +47,8 @@ public class AsmTypeConstants {
public static final Type K_EXTENSION_PROPERTY_IMPL_TYPE = reflectInternal("KExtensionPropertyImpl");
public static final Type K_MUTABLE_EXTENSION_PROPERTY_IMPL_TYPE = reflectInternal("KMutableExtensionPropertyImpl");
public static final String REFLECTION_INTERNAL_PACKAGE = reflectInternal("InternalPackage").getInternalName();
public static final Type OBJECT_REF_TYPE = Type.getObjectType("kotlin/jvm/internal/Ref$ObjectRef");
@NotNull