Rename AsmTypeConstants -> AsmTypes
This commit is contained in:
@@ -58,8 +58,7 @@ import java.util.Set;
|
||||
|
||||
import static org.jetbrains.jet.codegen.JvmCodegenUtil.isInterface;
|
||||
import static org.jetbrains.jet.lang.resolve.DescriptorUtils.*;
|
||||
import static org.jetbrains.jet.lang.resolve.java.AsmTypeConstants.JAVA_STRING_TYPE;
|
||||
import static org.jetbrains.jet.lang.resolve.java.AsmTypeConstants.getType;
|
||||
import static org.jetbrains.jet.lang.resolve.java.AsmTypes.*;
|
||||
import static org.jetbrains.jet.lang.resolve.java.JvmAnnotationNames.ABI_VERSION_FIELD_NAME;
|
||||
import static org.jetbrains.jet.lang.resolve.java.JvmAnnotationNames.KotlinSyntheticClass;
|
||||
import static org.jetbrains.jet.lang.resolve.java.mapping.PrimitiveTypesUtil.asmTypeForPrimitive;
|
||||
@@ -361,16 +360,16 @@ public class AsmUtil {
|
||||
private static Type stringValueOfType(Type type) {
|
||||
int sort = type.getSort();
|
||||
return sort == Type.OBJECT || sort == Type.ARRAY
|
||||
? AsmTypeConstants.OBJECT_TYPE
|
||||
? OBJECT_TYPE
|
||||
: sort == Type.BYTE || sort == Type.SHORT ? Type.INT_TYPE : type;
|
||||
}
|
||||
|
||||
private static Type stringBuilderAppendType(Type type) {
|
||||
switch (type.getSort()) {
|
||||
case Type.OBJECT:
|
||||
return STRING_BUILDER_OBJECT_APPEND_ARG_TYPES.contains(type) ? type : AsmTypeConstants.OBJECT_TYPE;
|
||||
return STRING_BUILDER_OBJECT_APPEND_ARG_TYPES.contains(type) ? type : OBJECT_TYPE;
|
||||
case Type.ARRAY:
|
||||
return AsmTypeConstants.OBJECT_TYPE;
|
||||
return OBJECT_TYPE;
|
||||
case Type.BYTE:
|
||||
case Type.SHORT:
|
||||
return Type.INT_TYPE;
|
||||
|
||||
@@ -56,7 +56,6 @@ import org.jetbrains.jet.lang.resolve.calls.util.CallMaker;
|
||||
import org.jetbrains.jet.lang.resolve.calls.util.FakeCallableDescriptorForObject;
|
||||
import org.jetbrains.jet.lang.resolve.constants.CompileTimeConstant;
|
||||
import org.jetbrains.jet.lang.resolve.constants.IntegerValueTypeConstant;
|
||||
import org.jetbrains.jet.lang.resolve.java.AsmTypeConstants;
|
||||
import org.jetbrains.jet.lang.resolve.java.JvmAbi;
|
||||
import org.jetbrains.jet.lang.resolve.java.PackageClassUtils;
|
||||
import org.jetbrains.jet.lang.resolve.java.descriptor.JavaClassDescriptor;
|
||||
@@ -90,7 +89,7 @@ import static org.jetbrains.jet.lang.resolve.BindingContextUtils.getNotNull;
|
||||
import static org.jetbrains.jet.lang.resolve.BindingContextUtils.isVarCapturedInClosure;
|
||||
import static org.jetbrains.jet.lang.resolve.calls.callUtil.CallUtilPackage.getResolvedCall;
|
||||
import static org.jetbrains.jet.lang.resolve.calls.callUtil.CallUtilPackage.getResolvedCallWithAssert;
|
||||
import static org.jetbrains.jet.lang.resolve.java.AsmTypeConstants.*;
|
||||
import static org.jetbrains.jet.lang.resolve.java.AsmTypes.*;
|
||||
import static org.jetbrains.jet.lang.resolve.java.JvmAnnotationNames.KotlinSyntheticClass;
|
||||
import static org.jetbrains.jet.lang.resolve.java.diagnostics.DiagnosticsPackage.OtherOrigin;
|
||||
import static org.jetbrains.jet.lang.resolve.java.diagnostics.DiagnosticsPackage.TraitImpl;
|
||||
@@ -1315,7 +1314,7 @@ public class ExpressionCodegen extends JetVisitor<StackValue, StackValue> implem
|
||||
return StackValue.constant(constantValue.toString(), type);
|
||||
}
|
||||
else {
|
||||
return StackValue.operation(AsmTypeConstants.JAVA_STRING_TYPE, new Function1<InstructionAdapter, Unit>() {
|
||||
return StackValue.operation(JAVA_STRING_TYPE, new Function1<InstructionAdapter, Unit>() {
|
||||
@Override
|
||||
public Unit invoke(InstructionAdapter v) {
|
||||
genStringBuilderConstructor(v);
|
||||
|
||||
@@ -55,7 +55,10 @@ import org.jetbrains.jet.lang.resolve.name.FqName;
|
||||
import org.jetbrains.jet.lang.types.Approximation;
|
||||
import org.jetbrains.jet.lang.types.TypesPackage;
|
||||
import org.jetbrains.jet.lang.types.lang.KotlinBuiltIns;
|
||||
import org.jetbrains.org.objectweb.asm.*;
|
||||
import org.jetbrains.org.objectweb.asm.AnnotationVisitor;
|
||||
import org.jetbrains.org.objectweb.asm.Label;
|
||||
import org.jetbrains.org.objectweb.asm.MethodVisitor;
|
||||
import org.jetbrains.org.objectweb.asm.Type;
|
||||
import org.jetbrains.org.objectweb.asm.commons.InstructionAdapter;
|
||||
import org.jetbrains.org.objectweb.asm.commons.Method;
|
||||
import org.jetbrains.org.objectweb.asm.util.TraceMethodVisitor;
|
||||
@@ -71,7 +74,7 @@ import static org.jetbrains.jet.lang.descriptors.CallableMemberDescriptor.Kind.D
|
||||
import static org.jetbrains.jet.lang.resolve.DescriptorToSourceUtils.callableDescriptorToDeclaration;
|
||||
import static org.jetbrains.jet.lang.resolve.DescriptorUtils.isFunctionLiteral;
|
||||
import static org.jetbrains.jet.lang.resolve.DescriptorUtils.isTrait;
|
||||
import static org.jetbrains.jet.lang.resolve.java.AsmTypeConstants.OBJECT_TYPE;
|
||||
import static org.jetbrains.jet.lang.resolve.java.AsmTypes.OBJECT_TYPE;
|
||||
import static org.jetbrains.jet.lang.resolve.java.JvmAnnotationNames.OLD_JET_VALUE_PARAMETER_ANNOTATION;
|
||||
import static org.jetbrains.jet.lang.resolve.java.diagnostics.DiagnosticsPackage.OtherOrigin;
|
||||
import static org.jetbrains.jet.lang.resolve.java.diagnostics.DiagnosticsPackage.Synthetic;
|
||||
|
||||
@@ -48,7 +48,6 @@ import org.jetbrains.jet.lang.resolve.calls.model.DefaultValueArgument;
|
||||
import org.jetbrains.jet.lang.resolve.calls.model.ExpressionValueArgument;
|
||||
import org.jetbrains.jet.lang.resolve.calls.model.ResolvedCall;
|
||||
import org.jetbrains.jet.lang.resolve.calls.model.VarargValueArgument;
|
||||
import org.jetbrains.jet.lang.resolve.java.AsmTypeConstants;
|
||||
import org.jetbrains.jet.lang.resolve.java.JvmAbi;
|
||||
import org.jetbrains.jet.lang.resolve.java.JvmAnnotationNames;
|
||||
import org.jetbrains.jet.lang.resolve.java.descriptor.JavaCallableMemberDescriptor;
|
||||
@@ -75,7 +74,7 @@ import static org.jetbrains.jet.descriptors.serialization.NameSerializationUtil.
|
||||
import static org.jetbrains.jet.lang.resolve.DescriptorToSourceUtils.classDescriptorToDeclaration;
|
||||
import static org.jetbrains.jet.lang.resolve.DescriptorToSourceUtils.descriptorToDeclaration;
|
||||
import static org.jetbrains.jet.lang.resolve.DescriptorUtils.*;
|
||||
import static org.jetbrains.jet.lang.resolve.java.AsmTypeConstants.*;
|
||||
import static org.jetbrains.jet.lang.resolve.java.AsmTypes.*;
|
||||
import static org.jetbrains.jet.lang.resolve.java.JvmAnnotationNames.KotlinSyntheticClass;
|
||||
import static org.jetbrains.jet.lang.resolve.java.diagnostics.DiagnosticsPackage.*;
|
||||
import static org.jetbrains.jet.lang.resolve.java.diagnostics.JvmDeclarationOrigin.NO_ORIGIN;
|
||||
@@ -361,7 +360,7 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen {
|
||||
}
|
||||
|
||||
protected void getSuperClass() {
|
||||
superClassAsmType = AsmTypeConstants.OBJECT_TYPE;
|
||||
superClassAsmType = OBJECT_TYPE;
|
||||
superClassType = null;
|
||||
|
||||
List<JetDelegationSpecifier> delegationSpecifiers = myClass.getDelegationSpecifiers();
|
||||
@@ -548,16 +547,16 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen {
|
||||
Label ne = new Label();
|
||||
|
||||
iv.load(0, OBJECT_TYPE);
|
||||
iv.load(1, AsmTypeConstants.OBJECT_TYPE);
|
||||
iv.load(1, OBJECT_TYPE);
|
||||
iv.ifacmpeq(eq);
|
||||
|
||||
iv.load(1, AsmTypeConstants.OBJECT_TYPE);
|
||||
iv.load(1, OBJECT_TYPE);
|
||||
iv.instanceOf(classAsmType);
|
||||
iv.ifeq(ne);
|
||||
|
||||
iv.load(1, AsmTypeConstants.OBJECT_TYPE);
|
||||
iv.load(1, OBJECT_TYPE);
|
||||
iv.checkcast(classAsmType);
|
||||
iv.store(2, AsmTypeConstants.OBJECT_TYPE);
|
||||
iv.store(2, OBJECT_TYPE);
|
||||
|
||||
for (PropertyDescriptor propertyDescriptor : properties) {
|
||||
Type asmType = typeMapper.mapType(propertyDescriptor);
|
||||
|
||||
@@ -47,13 +47,15 @@ import org.jetbrains.org.objectweb.asm.Type;
|
||||
import org.jetbrains.org.objectweb.asm.commons.InstructionAdapter;
|
||||
import org.jetbrains.org.objectweb.asm.commons.Method;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import static org.jetbrains.jet.codegen.AsmUtil.isPrimitive;
|
||||
import static org.jetbrains.jet.lang.descriptors.CallableMemberDescriptor.Kind.SYNTHESIZED;
|
||||
import static org.jetbrains.jet.lang.descriptors.SourceElement.NO_SOURCE;
|
||||
import static org.jetbrains.jet.lang.resolve.BindingContext.VARIABLE;
|
||||
import static org.jetbrains.jet.lang.resolve.java.AsmTypeConstants.*;
|
||||
import static org.jetbrains.jet.lang.resolve.java.AsmTypes.*;
|
||||
import static org.jetbrains.jet.lang.resolve.java.diagnostics.DiagnosticsPackage.OtherOrigin;
|
||||
import static org.jetbrains.jet.lang.resolve.java.diagnostics.DiagnosticsPackage.TraitImpl;
|
||||
import static org.jetbrains.jet.lang.resolve.java.diagnostics.JvmDeclarationOrigin.NO_ORIGIN;
|
||||
|
||||
@@ -67,8 +67,8 @@ import java.util.*;
|
||||
import static org.jetbrains.jet.codegen.AsmUtil.asmDescByFqNameWithoutInnerClasses;
|
||||
import static org.jetbrains.jet.codegen.AsmUtil.method;
|
||||
import static org.jetbrains.jet.descriptors.serialization.NameSerializationUtil.createNameResolver;
|
||||
import static org.jetbrains.jet.lang.resolve.java.AsmTypeConstants.K_PACKAGE_IMPL_TYPE;
|
||||
import static org.jetbrains.jet.lang.resolve.java.AsmTypeConstants.getType;
|
||||
import static org.jetbrains.jet.lang.resolve.java.AsmTypes.K_PACKAGE_IMPL_TYPE;
|
||||
import static org.jetbrains.jet.lang.resolve.java.AsmTypes.getType;
|
||||
import static org.jetbrains.jet.lang.resolve.java.PackageClassUtils.getPackageClassFqName;
|
||||
import static org.jetbrains.jet.lang.resolve.java.diagnostics.DiagnosticsPackage.*;
|
||||
import static org.jetbrains.jet.lang.resolve.java.diagnostics.JvmDeclarationOrigin.NO_ORIGIN;
|
||||
|
||||
@@ -51,7 +51,7 @@ import static org.jetbrains.jet.codegen.JvmCodegenUtil.isInterface;
|
||||
import static org.jetbrains.jet.codegen.JvmSerializationBindings.*;
|
||||
import static org.jetbrains.jet.lang.resolve.DescriptorUtils.isClassObject;
|
||||
import static org.jetbrains.jet.lang.resolve.DescriptorUtils.isTrait;
|
||||
import static org.jetbrains.jet.lang.resolve.java.AsmTypeConstants.PROPERTY_METADATA_TYPE;
|
||||
import static org.jetbrains.jet.lang.resolve.java.AsmTypes.PROPERTY_METADATA_TYPE;
|
||||
import static org.jetbrains.jet.lang.resolve.java.diagnostics.DiagnosticsPackage.OtherOrigin;
|
||||
import static org.jetbrains.org.objectweb.asm.Opcodes.*;
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ import org.jetbrains.org.objectweb.asm.commons.InstructionAdapter;
|
||||
import java.util.Collections;
|
||||
|
||||
import static org.jetbrains.jet.codegen.AsmUtil.*;
|
||||
import static org.jetbrains.jet.lang.resolve.java.AsmTypeConstants.OBJECT_TYPE;
|
||||
import static org.jetbrains.jet.lang.resolve.java.AsmTypes.OBJECT_TYPE;
|
||||
import static org.jetbrains.jet.lang.resolve.java.JvmAnnotationNames.KotlinSyntheticClass;
|
||||
import static org.jetbrains.jet.lang.resolve.java.diagnostics.DiagnosticsPackage.OtherOrigin;
|
||||
import static org.jetbrains.org.objectweb.asm.Opcodes.*;
|
||||
|
||||
@@ -41,7 +41,7 @@ import java.util.List;
|
||||
import static org.jetbrains.jet.codegen.AsmUtil.method;
|
||||
import static org.jetbrains.jet.codegen.binding.CodegenBinding.CLASS_FOR_SCRIPT;
|
||||
import static org.jetbrains.jet.codegen.binding.CodegenBinding.asmTypeForScriptDescriptor;
|
||||
import static org.jetbrains.jet.lang.resolve.java.AsmTypeConstants.*;
|
||||
import static org.jetbrains.jet.lang.resolve.java.AsmTypes.*;
|
||||
import static org.jetbrains.jet.lang.resolve.java.diagnostics.DiagnosticsPackage.OtherOrigin;
|
||||
import static org.jetbrains.jet.lang.resolve.java.diagnostics.JvmDeclarationOrigin.NO_ORIGIN;
|
||||
import static org.jetbrains.org.objectweb.asm.Opcodes.*;
|
||||
|
||||
@@ -46,7 +46,7 @@ import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import static org.jetbrains.jet.codegen.AsmUtil.*;
|
||||
import static org.jetbrains.jet.lang.resolve.java.AsmTypeConstants.*;
|
||||
import static org.jetbrains.jet.lang.resolve.java.AsmTypes.*;
|
||||
import static org.jetbrains.org.objectweb.asm.Opcodes.*;
|
||||
|
||||
public abstract class StackValue {
|
||||
|
||||
@@ -23,7 +23,7 @@ import org.jetbrains.jet.codegen.StackValue;
|
||||
import org.jetbrains.jet.codegen.binding.MutableClosure;
|
||||
import org.jetbrains.jet.lang.descriptors.ConstructorDescriptor;
|
||||
|
||||
import static org.jetbrains.jet.lang.resolve.java.AsmTypeConstants.OBJECT_TYPE;
|
||||
import static org.jetbrains.jet.lang.resolve.java.AsmTypes.OBJECT_TYPE;
|
||||
|
||||
public class ConstructorContext extends MethodContext {
|
||||
private static final StackValue LOCAL_1 = StackValue.local(1, OBJECT_TYPE);
|
||||
|
||||
@@ -33,7 +33,7 @@ import org.jetbrains.jet.lang.psi.*;
|
||||
import org.jetbrains.jet.lang.resolve.DescriptorToSourceUtils;
|
||||
import org.jetbrains.jet.lang.resolve.DescriptorUtils;
|
||||
import org.jetbrains.jet.lang.resolve.calls.model.ResolvedCall;
|
||||
import org.jetbrains.jet.lang.resolve.java.AsmTypeConstants;
|
||||
import org.jetbrains.jet.lang.resolve.java.AsmTypes;
|
||||
import org.jetbrains.jet.lang.resolve.java.jvmSignature.JvmMethodParameterKind;
|
||||
import org.jetbrains.jet.lang.resolve.java.jvmSignature.JvmMethodParameterSignature;
|
||||
import org.jetbrains.jet.lang.resolve.java.jvmSignature.JvmMethodSignature;
|
||||
@@ -51,7 +51,10 @@ import org.jetbrains.org.objectweb.asm.tree.MethodNode;
|
||||
import org.jetbrains.org.objectweb.asm.tree.TryCatchBlockNode;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.ListIterator;
|
||||
import java.util.Map;
|
||||
|
||||
import static org.jetbrains.jet.codegen.AsmUtil.getMethodAsmFlags;
|
||||
import static org.jetbrains.jet.codegen.AsmUtil.isPrimitive;
|
||||
@@ -418,7 +421,7 @@ public class InlineCodegen extends CallGenerator {
|
||||
List<JvmMethodParameterSignature> valueParameters = jvmSignature.getValueParameters();
|
||||
|
||||
if (!isStaticMethod(functionDescriptor, context)) {
|
||||
invocationParamBuilder.addNextParameter(AsmTypeConstants.OBJECT_TYPE, false, null);
|
||||
invocationParamBuilder.addNextParameter(AsmTypes.OBJECT_TYPE, false, null);
|
||||
}
|
||||
|
||||
for (JvmMethodParameterSignature param : valueParameters) {
|
||||
|
||||
@@ -36,7 +36,7 @@ import org.jetbrains.jet.lang.descriptors.*;
|
||||
import org.jetbrains.jet.lang.psi.JetFile;
|
||||
import org.jetbrains.jet.lang.resolve.DescriptorToSourceUtils;
|
||||
import org.jetbrains.jet.lang.resolve.DescriptorUtils;
|
||||
import org.jetbrains.jet.lang.resolve.java.AsmTypeConstants;
|
||||
import org.jetbrains.jet.lang.resolve.java.AsmTypes;
|
||||
import org.jetbrains.jet.lang.resolve.java.JvmAbi;
|
||||
import org.jetbrains.jet.lang.resolve.java.PackageClassUtils;
|
||||
import org.jetbrains.jet.lang.resolve.kotlin.DeserializedResolverUtils;
|
||||
@@ -51,7 +51,6 @@ import org.jetbrains.org.objectweb.asm.util.Textifier;
|
||||
import org.jetbrains.org.objectweb.asm.util.TraceMethodVisitor;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.PrintWriter;
|
||||
import java.io.StringWriter;
|
||||
import java.util.Arrays;
|
||||
@@ -312,7 +311,7 @@ public class InlineCodegenUtil {
|
||||
case Opcodes.DRETURN: return Type.DOUBLE_TYPE;
|
||||
case Opcodes.FRETURN: return Type.FLOAT_TYPE;
|
||||
case Opcodes.LRETURN: return Type.LONG_TYPE;
|
||||
default: return AsmTypeConstants.OBJECT_TYPE;
|
||||
default: return AsmTypes.OBJECT_TYPE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ import org.jetbrains.jet.lang.descriptors.ValueParameterDescriptor;
|
||||
import org.jetbrains.jet.lang.psi.JetFunctionLiteral;
|
||||
import org.jetbrains.jet.lang.psi.JetFunctionLiteralExpression;
|
||||
import org.jetbrains.jet.lang.resolve.BindingContext;
|
||||
import org.jetbrains.jet.lang.resolve.java.AsmTypeConstants;
|
||||
import org.jetbrains.jet.lang.resolve.java.AsmTypes;
|
||||
import org.jetbrains.org.objectweb.asm.Type;
|
||||
import org.jetbrains.org.objectweb.asm.tree.FieldInsnNode;
|
||||
import org.jetbrains.org.objectweb.asm.tree.MethodNode;
|
||||
@@ -151,7 +151,7 @@ public class LambdaInfo implements CapturedParamOwner, LabelOwner {
|
||||
public Parameters addAllParameters(FieldRemapper remapper) {
|
||||
ParametersBuilder builder = ParametersBuilder.newBuilder();
|
||||
//add skipped this cause inlined lambda doesn't have it
|
||||
builder.addThis(AsmTypeConstants.OBJECT_TYPE, true).setLambda(this);
|
||||
builder.addThis(AsmTypes.OBJECT_TYPE, true).setLambda(this);
|
||||
|
||||
List<ValueParameterDescriptor> valueParameters = getFunctionDescriptor().getValueParameters();
|
||||
for (ValueParameterDescriptor parameter : valueParameters) {
|
||||
|
||||
@@ -18,12 +18,12 @@ package org.jetbrains.jet.codegen.inline;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.jet.codegen.StackValue;
|
||||
import org.jetbrains.jet.lang.resolve.java.AsmTypes;
|
||||
import org.jetbrains.org.objectweb.asm.Label;
|
||||
import org.jetbrains.org.objectweb.asm.MethodVisitor;
|
||||
import org.jetbrains.org.objectweb.asm.Opcodes;
|
||||
import org.jetbrains.org.objectweb.asm.commons.InstructionAdapter;
|
||||
import org.jetbrains.jet.codegen.StackValue;
|
||||
import org.jetbrains.jet.lang.resolve.java.AsmTypeConstants;
|
||||
|
||||
import static org.jetbrains.jet.codegen.inline.LocalVarRemapper.RemapStatus.*;
|
||||
|
||||
@@ -48,7 +48,7 @@ public class LocalVarRemapper {
|
||||
int index = 0;
|
||||
for (ParameterInfo info : params) {
|
||||
if (!info.isSkippedOrRemapped()) {
|
||||
remapValues[index] = StackValue.local(realSize, AsmTypeConstants.OBJECT_TYPE);
|
||||
remapValues[index] = StackValue.local(realSize, AsmTypes.OBJECT_TYPE);
|
||||
realSize += info.getType().getSize();
|
||||
} else {
|
||||
remapValues[index] = info.isRemapped() ? info.getRemapValue() : null;
|
||||
@@ -77,7 +77,7 @@ public class LocalVarRemapper {
|
||||
remappedIndex = actualParamsSize - params.totalSize() + index; //captured params not used directly in this inlined method, they used in closure
|
||||
}
|
||||
|
||||
return new RemapInfo(StackValue.local(remappedIndex + additionalShift, AsmTypeConstants.OBJECT_TYPE), null, SHIFT);
|
||||
return new RemapInfo(StackValue.local(remappedIndex + additionalShift, AsmTypes.OBJECT_TYPE), null, SHIFT);
|
||||
}
|
||||
|
||||
public RemapInfo remap(int index) {
|
||||
|
||||
@@ -18,13 +18,13 @@ package org.jetbrains.jet.codegen.inline;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.org.objectweb.asm.Type;
|
||||
import org.jetbrains.jet.codegen.StackValue;
|
||||
import org.jetbrains.jet.lang.resolve.java.AsmTypeConstants;
|
||||
import org.jetbrains.jet.lang.resolve.java.AsmTypes;
|
||||
import org.jetbrains.org.objectweb.asm.Type;
|
||||
|
||||
class ParameterInfo {
|
||||
|
||||
public static final ParameterInfo STUB = new ParameterInfo(AsmTypeConstants.OBJECT_TYPE, true, -1, -1);
|
||||
public static final ParameterInfo STUB = new ParameterInfo(AsmTypes.OBJECT_TYPE, true, -1, -1);
|
||||
|
||||
protected final int index;
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import static org.jetbrains.jet.codegen.AsmUtil.asmDescByFqNameWithoutInnerClasses;
|
||||
import static org.jetbrains.jet.lang.resolve.java.AsmTypeConstants.getType;
|
||||
import static org.jetbrains.jet.lang.resolve.java.AsmTypes.getType;
|
||||
import static org.jetbrains.jet.lang.resolve.java.mapping.PrimitiveTypesUtil.asmTypeForPrimitive;
|
||||
import static org.jetbrains.jet.lang.types.lang.KotlinBuiltIns.BUILT_INS_PACKAGE_FQ_NAME;
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ import org.jetbrains.org.objectweb.asm.commons.InstructionAdapter;
|
||||
import java.util.List;
|
||||
|
||||
import static org.jetbrains.jet.lang.resolve.calls.callUtil.CallUtilPackage.getResolvedCallWithAssert;
|
||||
import static org.jetbrains.jet.lang.resolve.java.AsmTypeConstants.OBJECT_TYPE;
|
||||
import static org.jetbrains.jet.lang.resolve.java.AsmTypes.OBJECT_TYPE;
|
||||
|
||||
public class Clone extends IntrinsicMethod {
|
||||
@NotNull
|
||||
|
||||
@@ -21,7 +21,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.jet.codegen.ExpressionCodegen;
|
||||
import org.jetbrains.jet.codegen.StackValue;
|
||||
import org.jetbrains.jet.lang.psi.JetExpression;
|
||||
import org.jetbrains.jet.lang.resolve.java.AsmTypeConstants;
|
||||
import org.jetbrains.jet.lang.resolve.java.AsmTypes;
|
||||
import org.jetbrains.org.objectweb.asm.Type;
|
||||
import org.jetbrains.org.objectweb.asm.commons.InstructionAdapter;
|
||||
|
||||
@@ -29,7 +29,7 @@ import java.util.List;
|
||||
|
||||
import static org.jetbrains.jet.codegen.AsmUtil.genInvokeAppendMethod;
|
||||
import static org.jetbrains.jet.codegen.AsmUtil.genStringBuilderConstructor;
|
||||
import static org.jetbrains.jet.lang.resolve.java.AsmTypeConstants.JAVA_STRING_TYPE;
|
||||
import static org.jetbrains.jet.lang.resolve.java.AsmTypes.JAVA_STRING_TYPE;
|
||||
|
||||
public class Concat extends IntrinsicMethod {
|
||||
@NotNull
|
||||
@@ -50,7 +50,7 @@ public class Concat extends IntrinsicMethod {
|
||||
}
|
||||
else {
|
||||
// LHS.plus(RHS)
|
||||
receiver.put(AsmTypeConstants.OBJECT_TYPE, v);
|
||||
receiver.put(AsmTypes.OBJECT_TYPE, v);
|
||||
genStringBuilderConstructor(v);
|
||||
v.swap();
|
||||
genInvokeAppendMethod(v, returnType);
|
||||
|
||||
@@ -19,16 +19,16 @@ package org.jetbrains.jet.codegen.intrinsics;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.jet.lang.types.JetType;
|
||||
import org.jetbrains.org.objectweb.asm.Type;
|
||||
import org.jetbrains.org.objectweb.asm.commons.InstructionAdapter;
|
||||
import org.jetbrains.jet.codegen.ExpressionCodegen;
|
||||
import org.jetbrains.jet.codegen.StackValue;
|
||||
import org.jetbrains.jet.lang.psi.JetExpression;
|
||||
import org.jetbrains.jet.lang.types.JetType;
|
||||
import org.jetbrains.org.objectweb.asm.Type;
|
||||
import org.jetbrains.org.objectweb.asm.commons.InstructionAdapter;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static org.jetbrains.jet.lang.resolve.java.AsmTypeConstants.getType;
|
||||
import static org.jetbrains.jet.lang.resolve.java.AsmTypes.getType;
|
||||
|
||||
public class CopyToArray extends IntrinsicMethod {
|
||||
@NotNull
|
||||
|
||||
@@ -18,7 +18,6 @@ package org.jetbrains.jet.codegen.intrinsics
|
||||
|
||||
import com.intellij.psi.PsiElement
|
||||
import org.jetbrains.org.objectweb.asm.Type
|
||||
import org.jetbrains.org.objectweb.asm.commons.InstructionAdapter
|
||||
import org.jetbrains.jet.codegen.ExpressionCodegen
|
||||
import org.jetbrains.jet.codegen.StackValue
|
||||
import org.jetbrains.jet.lang.psi.JetCallExpression
|
||||
@@ -26,14 +25,16 @@ import org.jetbrains.jet.lang.psi.JetExpression
|
||||
import org.jetbrains.jet.lexer.JetTokens
|
||||
|
||||
import org.jetbrains.jet.codegen.AsmUtil.genEqualsForExpressionsOnStack
|
||||
import org.jetbrains.jet.lang.resolve.java.AsmTypeConstants.OBJECT_TYPE
|
||||
import org.jetbrains.jet.lang.resolve.java.AsmTypes.OBJECT_TYPE
|
||||
|
||||
public class Equals : LazyIntrinsicMethod() {
|
||||
override fun generateImpl(codegen: ExpressionCodegen,
|
||||
returnType: Type,
|
||||
element: PsiElement?,
|
||||
arguments: List<JetExpression>,
|
||||
receiver: StackValue): StackValue {
|
||||
override fun generateImpl(
|
||||
codegen: ExpressionCodegen,
|
||||
returnType: Type,
|
||||
element: PsiElement?,
|
||||
arguments: List<JetExpression>,
|
||||
receiver: StackValue
|
||||
): StackValue {
|
||||
val leftExpr: StackValue
|
||||
val rightExpr: JetExpression
|
||||
if (element is JetCallExpression) {
|
||||
|
||||
@@ -22,17 +22,18 @@ import org.jetbrains.org.objectweb.asm.Type
|
||||
import org.jetbrains.jet.codegen.ExpressionCodegen
|
||||
import org.jetbrains.jet.codegen.StackValue
|
||||
import org.jetbrains.jet.lang.psi.JetExpression
|
||||
import org.jetbrains.jet.lang.resolve.java.AsmTypeConstants
|
||||
import org.jetbrains.jet.lang.resolve.java.AsmTypes
|
||||
|
||||
public class HashCode : LazyIntrinsicMethod() {
|
||||
override fun generateImpl(codegen: ExpressionCodegen,
|
||||
returnType: Type,
|
||||
element: PsiElement?,
|
||||
arguments: List<JetExpression>,
|
||||
receiver: StackValue): StackValue {
|
||||
|
||||
override fun generateImpl(
|
||||
codegen: ExpressionCodegen,
|
||||
returnType: Type,
|
||||
element: PsiElement?,
|
||||
arguments: List<JetExpression>,
|
||||
receiver: StackValue
|
||||
): StackValue {
|
||||
return StackValue.operation(Type.INT_TYPE) {
|
||||
receiver.put(AsmTypeConstants.OBJECT_TYPE, it)
|
||||
receiver.put(AsmTypes.OBJECT_TYPE, it)
|
||||
it.visitMethodInsn(Opcodes.INVOKEVIRTUAL, "java/lang/Object", "hashCode", "()I", false)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ import org.jetbrains.org.objectweb.asm.Type;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static org.jetbrains.jet.lang.resolve.java.AsmTypeConstants.OBJECT_TYPE;
|
||||
import static org.jetbrains.jet.lang.resolve.java.AsmTypes.OBJECT_TYPE;
|
||||
|
||||
public class IdentityEquals extends LazyIntrinsicMethod {
|
||||
@NotNull
|
||||
|
||||
@@ -21,7 +21,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.jet.codegen.ExpressionCodegen;
|
||||
import org.jetbrains.jet.codegen.StackValue;
|
||||
import org.jetbrains.jet.lang.psi.JetExpression;
|
||||
import org.jetbrains.jet.lang.resolve.java.AsmTypeConstants;
|
||||
import org.jetbrains.jet.lang.resolve.java.AsmTypes;
|
||||
import org.jetbrains.org.objectweb.asm.Type;
|
||||
import org.jetbrains.org.objectweb.asm.commons.InstructionAdapter;
|
||||
|
||||
@@ -68,7 +68,7 @@ public class IteratorNext extends IntrinsicMethod {
|
||||
else {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
receiver.put(AsmTypeConstants.OBJECT_TYPE, v);
|
||||
receiver.put(AsmTypes.OBJECT_TYPE, v);
|
||||
v.invokevirtual(BUILT_INS_PACKAGE_FQ_NAME + "/" + name + "Iterator", "next" + name, "()" + returnType.getDescriptor(), false);
|
||||
return returnType;
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ import org.jetbrains.org.objectweb.asm.commons.InstructionAdapter;
|
||||
import java.util.List;
|
||||
|
||||
import static org.jetbrains.jet.codegen.AsmUtil.putJavaLangClassInstance;
|
||||
import static org.jetbrains.jet.lang.resolve.java.AsmTypeConstants.getType;
|
||||
import static org.jetbrains.jet.lang.resolve.java.AsmTypes.getType;
|
||||
|
||||
public class JavaClassFunction extends IntrinsicMethod {
|
||||
@NotNull
|
||||
|
||||
@@ -30,7 +30,7 @@ import java.util.List;
|
||||
|
||||
import static org.jetbrains.jet.codegen.AsmUtil.boxType;
|
||||
import static org.jetbrains.jet.codegen.AsmUtil.isPrimitive;
|
||||
import static org.jetbrains.jet.lang.resolve.java.AsmTypeConstants.getType;
|
||||
import static org.jetbrains.jet.lang.resolve.java.AsmTypes.getType;
|
||||
|
||||
public class JavaClassProperty extends IntrinsicMethod {
|
||||
@NotNull
|
||||
|
||||
@@ -34,7 +34,7 @@ import org.jetbrains.org.objectweb.asm.commons.InstructionAdapter;
|
||||
import java.util.List;
|
||||
|
||||
import static org.jetbrains.jet.lang.resolve.calls.callUtil.CallUtilPackage.getResolvedCallWithAssert;
|
||||
import static org.jetbrains.jet.lang.resolve.java.AsmTypeConstants.OBJECT_TYPE;
|
||||
import static org.jetbrains.jet.lang.resolve.java.AsmTypes.OBJECT_TYPE;
|
||||
|
||||
public class MonitorInstruction extends IntrinsicMethod {
|
||||
|
||||
|
||||
@@ -22,8 +22,8 @@ import org.jetbrains.jet.codegen.StackValue
|
||||
import org.jetbrains.jet.lang.psi.JetExpression
|
||||
import org.jetbrains.org.objectweb.asm.Type
|
||||
|
||||
import org.jetbrains.jet.lang.resolve.java.AsmTypeConstants.JAVA_STRING_TYPE
|
||||
import org.jetbrains.jet.lang.resolve.java.AsmTypeConstants.OBJECT_TYPE
|
||||
import org.jetbrains.jet.lang.resolve.java.AsmTypes.JAVA_STRING_TYPE
|
||||
import org.jetbrains.jet.lang.resolve.java.AsmTypes.OBJECT_TYPE
|
||||
|
||||
public class StringPlus : LazyIntrinsicMethod() {
|
||||
override fun generateImpl(
|
||||
|
||||
@@ -32,14 +32,16 @@ import org.jetbrains.jet.lang.descriptors.annotations.Annotated;
|
||||
import org.jetbrains.jet.lang.descriptors.annotations.AnnotationDescriptor;
|
||||
import org.jetbrains.jet.lang.descriptors.impl.AnonymousFunctionDescriptor;
|
||||
import org.jetbrains.jet.lang.psi.JetFile;
|
||||
import org.jetbrains.jet.lang.resolve.*;
|
||||
import org.jetbrains.jet.lang.resolve.BindingContext;
|
||||
import org.jetbrains.jet.lang.resolve.DescriptorToSourceUtils;
|
||||
import org.jetbrains.jet.lang.resolve.DescriptorUtils;
|
||||
import org.jetbrains.jet.lang.resolve.annotations.AnnotationsPackage;
|
||||
import org.jetbrains.jet.lang.resolve.calls.model.DefaultValueArgument;
|
||||
import org.jetbrains.jet.lang.resolve.calls.model.ResolvedCall;
|
||||
import org.jetbrains.jet.lang.resolve.calls.model.ResolvedValueArgument;
|
||||
import org.jetbrains.jet.lang.resolve.constants.CompileTimeConstant;
|
||||
import org.jetbrains.jet.lang.resolve.constants.StringValue;
|
||||
import org.jetbrains.jet.lang.resolve.java.AsmTypeConstants;
|
||||
import org.jetbrains.jet.lang.resolve.java.AsmTypes;
|
||||
import org.jetbrains.jet.lang.resolve.java.JvmAbi;
|
||||
import org.jetbrains.jet.lang.resolve.java.PackageClassUtils;
|
||||
import org.jetbrains.jet.lang.resolve.java.jvmSignature.JvmMethodParameterKind;
|
||||
@@ -441,7 +443,7 @@ public class JetTypeMapper {
|
||||
if (signatureVisitor != null) {
|
||||
if (jetType.getArguments().isEmpty()) {
|
||||
if (arrayParameter && howThisTypeIsUsed == Variance.IN_VARIANCE) {
|
||||
asmType = AsmTypeConstants.OBJECT_TYPE;
|
||||
asmType = AsmTypes.OBJECT_TYPE;
|
||||
}
|
||||
signatureVisitor.writeAsmType(asmType);
|
||||
}
|
||||
|
||||
+1
-1
@@ -30,7 +30,7 @@ import org.jetbrains.org.objectweb.asm.commons.InstructionAdapter;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static org.jetbrains.jet.lang.resolve.java.AsmTypeConstants.OBJECT_TYPE;
|
||||
import static org.jetbrains.jet.lang.resolve.java.AsmTypes.OBJECT_TYPE;
|
||||
import static org.jetbrains.org.objectweb.asm.Opcodes.*;
|
||||
|
||||
public class MappingClassesForWhenByEnumCodegen {
|
||||
|
||||
+5
-8
@@ -22,19 +22,16 @@ import org.jetbrains.org.objectweb.asm.Type;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import static org.jetbrains.jet.lang.types.lang.KotlinBuiltIns.BUILT_INS_PACKAGE_FQ_NAME;
|
||||
|
||||
public class AsmTypeConstants {
|
||||
public class AsmTypes {
|
||||
private static final Map<Class<?>, Type> TYPES_MAP = new HashMap<Class<?>, Type>();
|
||||
|
||||
public static final Type OBJECT_TYPE = getType(Object.class);
|
||||
public static final Type JAVA_STRING_TYPE = getType(String.class);
|
||||
public static final Type JAVA_THROWABLE_TYPE = getType(Throwable.class);
|
||||
|
||||
public static final Type UNIT_TYPE = Type.getObjectType(BUILT_INS_PACKAGE_FQ_NAME + "/Unit");
|
||||
public static final Type FUNCTION1_TYPE = Type.getObjectType(BUILT_INS_PACKAGE_FQ_NAME + "/Function1");
|
||||
public static final Type PROPERTY_METADATA_TYPE = Type.getObjectType(BUILT_INS_PACKAGE_FQ_NAME + "/PropertyMetadata");
|
||||
public static final Type PROPERTY_METADATA_IMPL_TYPE = Type.getObjectType(BUILT_INS_PACKAGE_FQ_NAME + "/PropertyMetadataImpl");
|
||||
public static final Type UNIT_TYPE = Type.getObjectType("kotlin/Unit");
|
||||
public static final Type PROPERTY_METADATA_TYPE = Type.getObjectType("kotlin/PropertyMetadata");
|
||||
public static final Type PROPERTY_METADATA_IMPL_TYPE = Type.getObjectType("kotlin/PropertyMetadataImpl");
|
||||
|
||||
public static final Type K_MEMBER_PROPERTY_TYPE = Type.getObjectType("kotlin/reflect/KMemberProperty");
|
||||
public static final Type K_MUTABLE_MEMBER_PROPERTY_TYPE = Type.getObjectType("kotlin/reflect/KMutableMemberProperty");
|
||||
@@ -65,6 +62,6 @@ public class AsmTypeConstants {
|
||||
return type;
|
||||
}
|
||||
|
||||
private AsmTypeConstants() {
|
||||
private AsmTypes() {
|
||||
}
|
||||
}
|
||||
+3
-3
@@ -18,15 +18,15 @@ package org.jetbrains.jet.lang.resolve.java.mapping;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.org.objectweb.asm.Type;
|
||||
import org.jetbrains.jet.lang.descriptors.ClassDescriptor;
|
||||
import org.jetbrains.jet.lang.resolve.DescriptorUtils;
|
||||
import org.jetbrains.jet.lang.resolve.java.AsmTypeConstants;
|
||||
import org.jetbrains.jet.lang.resolve.java.AsmTypes;
|
||||
import org.jetbrains.jet.lang.resolve.java.JvmClassName;
|
||||
import org.jetbrains.jet.lang.resolve.java.JvmPrimitiveType;
|
||||
import org.jetbrains.jet.lang.resolve.name.FqName;
|
||||
import org.jetbrains.jet.lang.types.lang.KotlinBuiltIns;
|
||||
import org.jetbrains.jet.lang.types.lang.PrimitiveType;
|
||||
import org.jetbrains.org.objectweb.asm.Type;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
@@ -97,7 +97,7 @@ public class KotlinToJavaTypesMap extends JavaToKotlinClassMapBuilder {
|
||||
protected void register(@NotNull Class<?> javaClass, @NotNull ClassDescriptor kotlinDescriptor, @NotNull Direction direction) {
|
||||
if (direction == Direction.BOTH || direction == Direction.KOTLIN_TO_JAVA) {
|
||||
FqName fqName = DescriptorUtils.getFqNameSafe(kotlinDescriptor);
|
||||
register(fqName, AsmTypeConstants.getType(javaClass));
|
||||
register(fqName, AsmTypes.getType(javaClass));
|
||||
registerFqName(fqName, new FqName(javaClass.getCanonicalName()));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user