getting rid of JetObject.getOuterObject
This commit is contained in:
@@ -590,14 +590,6 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen {
|
||||
iv.load(0, classType);
|
||||
iv.load(frameMap.getOuterThisIndex(), type);
|
||||
iv.putfield(classname, fieldName, interfaceDesc);
|
||||
|
||||
Type outerType = typeMapper.mapType(outerDescriptor.getDefaultType());
|
||||
MethodVisitor outer = v.newMethod(myClass, ACC_PUBLIC, JvmStdlibNames.JET_OBJECT_GET_OUTER_OBJECT_METHOD, "()Ljet/JetObject;", null, null);
|
||||
outer.visitCode();
|
||||
outer.visitVarInsn(ALOAD, 0);
|
||||
outer.visitFieldInsn(GETFIELD, classname, "this$0", outerType.getDescriptor());
|
||||
outer.visitInsn(ARETURN);
|
||||
FunctionCodegen.endVisit(outer, JvmStdlibNames.JET_OBJECT_GET_OUTER_OBJECT_METHOD, myClass);
|
||||
}
|
||||
|
||||
if(closure != null) {
|
||||
@@ -937,19 +929,6 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen {
|
||||
return myClass instanceof JetClass ? ((JetClass) myClass).getClassObject() : null;
|
||||
}
|
||||
|
||||
private void staticTypeInfoField() {
|
||||
v.newField(myClass, ACC_PUBLIC | ACC_FINAL | ACC_STATIC, "$staticTypeInfo", "Ljet/TypeInfo;", null, null);
|
||||
staticInitializerChunks.add(new CodeChunk() {
|
||||
@Override
|
||||
public void generate(InstructionAdapter v) {
|
||||
v.aconst(typeMapper.mapType(descriptor.getDefaultType(), OwnerKind.IMPLEMENTATION));
|
||||
v.iconst(0);
|
||||
v.invokestatic("jet/TypeInfo", JvmStdlibNames.JET_OBJECT_GET_TYPEINFO_METHOD, "(Ljava/lang/Class;Z)Ljet/TypeInfo;");
|
||||
v.putstatic(typeMapper.mapType(descriptor.getDefaultType(), kind).getInternalName(), "$staticTypeInfo", "Ljet/TypeInfo;");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return pairs of descriptors. First is member of this that should be implemented by delegating to trait,
|
||||
|
||||
@@ -18,7 +18,6 @@ package org.jetbrains.jet.codegen;
|
||||
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.util.PsiTreeUtil;
|
||||
import jet.JetObject;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.jet.lang.descriptors.*;
|
||||
@@ -42,7 +41,6 @@ import static org.objectweb.asm.Opcodes.*;
|
||||
public class JetTypeMapper {
|
||||
public static final Type TYPE_OBJECT = Type.getObjectType("java/lang/Object");
|
||||
public static final Type TYPE_THROWABLE = Type.getObjectType("java/lang/Throwable");
|
||||
public static final Type TYPE_JET_OBJECT = Type.getType(JetObject.class);
|
||||
public static final Type TYPE_NOTHING = Type.getObjectType("jet/Nothing");
|
||||
public static final Type JL_NUMBER_TYPE = Type.getObjectType("java/lang/Number");
|
||||
public static final Type JL_STRING_BUILDER = Type.getObjectType("java/lang/StringBuilder");
|
||||
|
||||
-13
@@ -1364,19 +1364,6 @@ public class JavaDescriptorResolver {
|
||||
if (ownerClassName.equals("java.lang.Object")) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (method.getName().equals(JvmStdlibNames.JET_OBJECT_GET_TYPEINFO_METHOD) && method.getParameters().size() == 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (method.getName().equals(JvmStdlibNames.JET_OBJECT_GET_OUTER_OBJECT_METHOD) && method.getParameters().size() == 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// TODO: check signature
|
||||
if (method.getName().equals(JvmAbi.SET_TYPE_INFO_METHOD)) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
ClassOrNamespaceDescriptor classDescriptor;
|
||||
|
||||
-4
@@ -116,10 +116,6 @@ class JavaDescriptorResolverHelper {
|
||||
// TODO: some java properties too
|
||||
if (method.getJetMethod().kind() == JvmStdlibNames.JET_METHOD_KIND_PROPERTY) {
|
||||
|
||||
if (method.getName().equals(JvmStdlibNames.JET_OBJECT_GET_TYPEINFO_METHOD)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
int i = 0;
|
||||
|
||||
TypeSource receiverType;
|
||||
|
||||
@@ -25,8 +25,6 @@ public class JvmAbi {
|
||||
public static final String GETTER_PREFIX = "get";
|
||||
public static final String SETTER_PREFIX = "set";
|
||||
public static final String PACKAGE_CLASS = "namespace";
|
||||
public static final String SET_TYPE_INFO_METHOD = "$setTypeInfo";
|
||||
public static final String TYPE_INFO_FIELD = "$typeInfo";
|
||||
|
||||
public static final JvmClassName JETBRAINS_NOT_NULL_ANNOTATION = new JvmClassName("org.jetbrains.annotations.NotNull");
|
||||
}
|
||||
|
||||
@@ -65,10 +65,6 @@ public class JvmStdlibNames {
|
||||
|
||||
public static final JvmClassName JET_OBJECT = new JvmClassName("jet.JetObject");
|
||||
|
||||
public static final String JET_OBJECT_GET_TYPEINFO_METHOD = "getTypeInfo";
|
||||
public static final String JET_OBJECT_GET_OUTER_OBJECT_METHOD = "getOuterObject";
|
||||
|
||||
|
||||
private JvmStdlibNames() {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
package org.jetbrains.jet.codegen;
|
||||
|
||||
import jet.JetObject;
|
||||
import jet.TypeCastException;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
Reference in New Issue
Block a user