Delete kotlin.jvm.internal.KObject

It was supposed to be used in reflection but the benefits do not outweigh the
cost of KT-6951

 #KT-3223 Fixed
 #KT-6951 Fixed
This commit is contained in:
Alexander Udalov
2015-03-12 14:05:42 +03:00
parent e5d5b49ce2
commit 8af6ca5279
29 changed files with 34 additions and 122 deletions
@@ -23,13 +23,13 @@ import com.intellij.util.ArrayUtil;
import kotlin.*;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.kotlin.codegen.extensions.ExpressionCodegenExtension;
import org.jetbrains.kotlin.backend.common.CodegenUtil;
import org.jetbrains.kotlin.backend.common.CodegenUtilKt;
import org.jetbrains.kotlin.backend.common.DataClassMethodGenerator;
import org.jetbrains.kotlin.builtins.KotlinBuiltIns;
import org.jetbrains.kotlin.codegen.binding.MutableClosure;
import org.jetbrains.kotlin.codegen.context.*;
import org.jetbrains.kotlin.codegen.extensions.ExpressionCodegenExtension;
import org.jetbrains.kotlin.codegen.signature.BothSignatureWriter;
import org.jetbrains.kotlin.codegen.state.GenerationState;
import org.jetbrains.kotlin.codegen.state.JetTypeMapper;
@@ -282,34 +282,16 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen {
sw.writeSuperclassEnd();
List<JetType> interfaceSupertypes = Lists.newArrayList();
boolean explicitKObject = false;
for (JetDelegationSpecifier specifier : myClass.getDelegationSpecifiers()) {
JetType superType = bindingContext.get(BindingContext.TYPE, specifier.getTypeReference());
assert superType != null : "No supertype for class: " + myClass.getText();
ClassifierDescriptor classifierDescriptor = superType.getConstructor().getDeclarationDescriptor();
if (classifierDescriptor instanceof ClassDescriptor) {
ClassDescriptor superClassDescriptor = (ClassDescriptor) classifierDescriptor;
if (isInterface(superClassDescriptor)) {
interfaceSupertypes.add(superType);
if (JvmAbi.K_OBJECT.equalsTo(DescriptorUtils.getFqName(superClassDescriptor))) {
explicitKObject = true;
}
}
if (isInterface(superType.getConstructor().getDeclarationDescriptor())) {
interfaceSupertypes.add(superType);
}
}
LinkedHashSet<String> superInterfaces = new LinkedHashSet<String>();
if (!explicitKObject && !isInterface(descriptor)) {
Type kObject = asmTypeByFqNameWithoutInnerClasses(JvmAbi.K_OBJECT);
sw.writeInterface();
sw.writeClassBegin(kObject);
sw.writeClassEnd();
sw.writeInterfaceEnd();
superInterfaces.add(kObject.getInternalName());
}
for (JetType supertype : interfaceSupertypes) {
sw.writeInterface();
Type jvmName = typeMapper.mapSupertype(supertype, sw);
@@ -318,8 +300,7 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen {
}
return new JvmClassSignature(classAsmType.getInternalName(), superClassAsmType.getInternalName(),
new ArrayList<String>(superInterfaces),
sw.makeJavaGenericSignature());
new ArrayList<String>(superInterfaces), sw.makeJavaGenericSignature());
}
protected void getSuperClass() {