replace JavaClassDescriptor with MutableClassDescriptorLite
This commit is contained in:
@@ -14,7 +14,6 @@ import org.jetbrains.jet.lang.psi.*;
|
||||
import org.jetbrains.jet.lang.resolve.BindingContext;
|
||||
import org.jetbrains.jet.lang.resolve.calls.*;
|
||||
import org.jetbrains.jet.lang.resolve.constants.CompileTimeConstant;
|
||||
import org.jetbrains.jet.lang.resolve.java.JavaClassDescriptor;
|
||||
import org.jetbrains.jet.lang.resolve.java.JavaNamespaceDescriptor;
|
||||
import org.jetbrains.jet.lang.resolve.java.JvmAbi;
|
||||
import org.jetbrains.jet.lang.resolve.java.JvmStdlibNames;
|
||||
@@ -1043,15 +1042,11 @@ public class ExpressionCodegen extends JetVisitor<StackValue, StackValue> {
|
||||
}
|
||||
else {
|
||||
owner = typeMapper.getOwner(functionDescriptor, OwnerKind.IMPLEMENTATION);
|
||||
if(containingDeclaration instanceof JavaClassDescriptor) {
|
||||
isInterface = CodegenUtil.isInterface(containingDeclaration);
|
||||
if (containingDeclaration instanceof ClassDescriptor && ((ClassDescriptor) containingDeclaration).getKind() == ClassKind.TRAIT) {
|
||||
isInterface = true;
|
||||
}
|
||||
else {
|
||||
if(containingDeclaration instanceof ClassDescriptor && ((ClassDescriptor) containingDeclaration).getKind() == ClassKind.TRAIT)
|
||||
isInterface = true;
|
||||
else {
|
||||
isInterface = false;
|
||||
}
|
||||
isInterface = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1097,23 +1092,30 @@ public class ExpressionCodegen extends JetVisitor<StackValue, StackValue> {
|
||||
}
|
||||
}
|
||||
}
|
||||
if(!(containingDeclaration instanceof JavaNamespaceDescriptor) && !(containingDeclaration instanceof JavaClassDescriptor))
|
||||
if(!(containingDeclaration instanceof JavaNamespaceDescriptor))
|
||||
getter = typeMapper.mapGetterSignature(propertyDescriptor, OwnerKind.IMPLEMENTATION).getJvmMethodSignature().getAsmMethod();
|
||||
else
|
||||
getter = null;
|
||||
|
||||
if (propertyDescriptor.getGetter() == null) {
|
||||
getter = null;
|
||||
}
|
||||
}
|
||||
//noinspection ConstantConditions
|
||||
if (isInsideClass && (propertyDescriptor.getSetter() == null || propertyDescriptor.getSetter().isDefault())) {
|
||||
setter = null;
|
||||
}
|
||||
else {
|
||||
if(!(containingDeclaration instanceof JavaNamespaceDescriptor) && !(containingDeclaration instanceof JavaClassDescriptor)) {
|
||||
if(!(containingDeclaration instanceof JavaNamespaceDescriptor)) {
|
||||
JvmPropertyAccessorSignature jvmMethodSignature = typeMapper.mapSetterSignature(propertyDescriptor, OwnerKind.IMPLEMENTATION);
|
||||
setter = jvmMethodSignature != null ? jvmMethodSignature.getJvmMethodSignature().getAsmMethod() : null;
|
||||
} else {
|
||||
setter = null;
|
||||
}
|
||||
|
||||
if (propertyDescriptor.getSetter() == null) {
|
||||
setter = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,6 @@ import org.jetbrains.jet.lang.descriptors.NamespaceDescriptor;
|
||||
import org.jetbrains.jet.lang.descriptors.PropertyDescriptor;
|
||||
import org.jetbrains.jet.lang.psi.*;
|
||||
import org.jetbrains.jet.lang.resolve.BindingContext;
|
||||
import org.jetbrains.jet.lang.resolve.java.JavaClassDescriptor;
|
||||
import org.jetbrains.jet.lang.resolve.java.JvmAbi;
|
||||
import org.jetbrains.jet.lang.resolve.java.JvmStdlibNames;
|
||||
import org.jetbrains.jet.lang.types.JetStandardClasses;
|
||||
@@ -152,7 +151,7 @@ public class NamespaceCodegen {
|
||||
}
|
||||
|
||||
DeclarationDescriptor declarationDescriptor = jetType.getConstructor().getDeclarationDescriptor();
|
||||
if(!jetType.equals(root) && jetType.getArguments().size() == 0 && !(declarationDescriptor instanceof JavaClassDescriptor) && !JetStandardClasses.getAny().equals(declarationDescriptor)) {
|
||||
if(!jetType.equals(root) && jetType.getArguments().size() == 0 && !JetStandardClasses.getAny().equals(declarationDescriptor)) {
|
||||
// TODO: we need some better checks here
|
||||
v.getstatic(typeMapper.mapType(jetType, OwnerKind.IMPLEMENTATION).getInternalName(), JvmAbi.TYPE_INFO_FIELD, "Ljet/TypeInfo;");
|
||||
return;
|
||||
|
||||
@@ -744,7 +744,9 @@ public abstract class StackValue {
|
||||
|
||||
static class Property extends StackValue {
|
||||
private final String name;
|
||||
@Nullable
|
||||
private final Method getter;
|
||||
@Nullable
|
||||
private final Method setter;
|
||||
public final String owner;
|
||||
private final boolean isStatic;
|
||||
|
||||
Reference in New Issue
Block a user