Minor, delete useless utilities
This commit is contained in:
@@ -1552,9 +1552,7 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen {
|
||||
iv.load(((ConstructorFrameMap)codegen.myFrameMap).getOuterThisIndex(), OBJECT_TYPE);
|
||||
}
|
||||
|
||||
if (myClass instanceof JetObjectDeclaration &&
|
||||
superCall instanceof JetDelegatorToSuperCall &&
|
||||
((JetObjectDeclaration) myClass).isObjectLiteral()) {
|
||||
if (isAnonymousObject(descriptor) && superCall instanceof JetDelegatorToSuperCall) {
|
||||
int nextVar = findFirstSuperArgument(method);
|
||||
for (Type t : superCallable.getSignature().getAsmMethod().getArgumentTypes()) {
|
||||
iv.load(nextVar, t);
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
package org.jetbrains.jet.codegen.binding;
|
||||
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.asm4.Type;
|
||||
@@ -40,7 +39,6 @@ import java.util.*;
|
||||
|
||||
import static org.jetbrains.jet.codegen.CodegenUtil.isInterface;
|
||||
import static org.jetbrains.jet.lang.resolve.BindingContext.*;
|
||||
import static org.jetbrains.jet.lang.resolve.BindingContextUtils.descriptorToDeclaration;
|
||||
import static org.jetbrains.jet.lang.resolve.DescriptorUtils.isEnumClass;
|
||||
|
||||
public class CodegenBinding {
|
||||
@@ -264,22 +262,6 @@ public class CodegenBinding {
|
||||
return sortedAnswer;
|
||||
}
|
||||
|
||||
public static boolean isObjectLiteral(BindingContext bindingContext, ClassDescriptor declaration) {
|
||||
PsiElement psiElement = descriptorToDeclaration(bindingContext, declaration);
|
||||
if (psiElement instanceof JetObjectDeclaration && ((JetObjectDeclaration) psiElement).isObjectLiteral()) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean isObjectDeclaration(BindingContext bindingContext, ClassDescriptor declaration) {
|
||||
PsiElement psiElement = descriptorToDeclaration(bindingContext, declaration);
|
||||
if (psiElement instanceof JetObjectDeclaration && !((JetObjectDeclaration) psiElement).isObjectLiteral()) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean isLocalNamedFun(DeclarationDescriptor fd) {
|
||||
if (fd instanceof FunctionDescriptor) {
|
||||
FunctionDescriptor descriptor = (FunctionDescriptor) fd;
|
||||
|
||||
@@ -57,6 +57,7 @@ import static org.jetbrains.jet.codegen.AsmUtil.getTraitImplThisParameterType;
|
||||
import static org.jetbrains.jet.codegen.CodegenUtil.*;
|
||||
import static org.jetbrains.jet.codegen.FunctionTypesUtil.getFunctionTraitClassName;
|
||||
import static org.jetbrains.jet.codegen.binding.CodegenBinding.*;
|
||||
import static org.jetbrains.jet.lang.resolve.DescriptorUtils.isAnonymousObject;
|
||||
import static org.jetbrains.jet.lang.resolve.java.descriptor.JavaPackageFragmentDescriptor.Kind.CLASS_STATICS;
|
||||
|
||||
public class JetTypeMapper extends BindingTraceAware {
|
||||
@@ -818,16 +819,13 @@ public class JetTypeMapper extends BindingTraceAware {
|
||||
DeclarationDescriptor superDescriptor = bindingContext
|
||||
.get(BindingContext.REFERENCE_TARGET, superCall.getCalleeExpression().getConstructorReferenceExpression());
|
||||
|
||||
if (superDescriptor instanceof ConstructorDescriptor) {
|
||||
ConstructorDescriptor superConstructor = (ConstructorDescriptor) superDescriptor;
|
||||
|
||||
if (isObjectLiteral(bindingContext, descriptor.getContainingDeclaration())) {
|
||||
List<JvmMethodParameterSignature> types = mapConstructorSignature(superConstructor).getKotlinParameterTypes();
|
||||
for (JvmMethodParameterSignature type : types) {
|
||||
signatureWriter.writeParameterType(JvmMethodParameterKind.SUPER_CALL_PARAM);
|
||||
signatureWriter.writeAsmType(type.getAsmType());
|
||||
signatureWriter.writeParameterTypeEnd();
|
||||
}
|
||||
if (superDescriptor instanceof ConstructorDescriptor && isAnonymousObject(descriptor.getContainingDeclaration())) {
|
||||
List<JvmMethodParameterSignature> types =
|
||||
mapConstructorSignature((ConstructorDescriptor) superDescriptor).getKotlinParameterTypes();
|
||||
for (JvmMethodParameterSignature type : types) {
|
||||
signatureWriter.writeParameterType(JvmMethodParameterKind.SUPER_CALL_PARAM);
|
||||
signatureWriter.writeAsmType(type.getAsmType());
|
||||
signatureWriter.writeParameterTypeEnd();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user