diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/CallableMethod.java b/compiler/backend/src/org/jetbrains/jet/codegen/CallableMethod.java index 1d45811a1dd..871eca51559 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/CallableMethod.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/CallableMethod.java @@ -27,6 +27,8 @@ import org.jetbrains.jet.lang.resolve.java.JvmClassName; import java.util.List; +import static org.jetbrains.asm4.Opcodes.*; + /** * @author yole * @author alex.tkacman @@ -112,13 +114,13 @@ public class CallableMethod implements Callable { v.iconst(mask); String desc = getSignature().getAsmMethod().getDescriptor().replace(")", "I)"); if ("".equals(getSignature().getAsmMethod().getName())) { - v.visitMethodInsn(Opcodes.INVOKESPECIAL, defaultImplOwner.getInternalName(), "", desc); + v.visitMethodInsn(INVOKESPECIAL, defaultImplOwner.getInternalName(), "", desc); } else { - if (getInvokeOpcode() != Opcodes.INVOKESTATIC) { + if (getInvokeOpcode() != INVOKESTATIC) { desc = desc.replace("(", "(" + defaultImplParam.getDescriptor()); } - v.visitMethodInsn(Opcodes.INVOKESTATIC, defaultImplOwner.getInternalName(), + v.visitMethodInsn(INVOKESTATIC, defaultImplOwner.getInternalName(), getSignature().getAsmMethod().getName() + JvmAbi.DEFAULT_PARAMS_IMPL_SUFFIX, desc); } } diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/ClassBodyCodegen.java b/compiler/backend/src/org/jetbrains/jet/codegen/ClassBodyCodegen.java index 4aaf60a7ae9..b663f308c3c 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/ClassBodyCodegen.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/ClassBodyCodegen.java @@ -126,7 +126,7 @@ public abstract class ClassBodyCodegen { private void generateStaticInitializer() { if (staticInitializerChunks.size() > 0) { - final MethodVisitor mv = v.newMethod(null, ACC_PUBLIC | Opcodes.ACC_STATIC, "", "()V", null, null); + final MethodVisitor mv = v.newMethod(null, ACC_PUBLIC | ACC_STATIC, "", "()V", null, null); if (state.getClassBuilderMode() == ClassBuilderMode.FULL) { mv.visitCode(); @@ -136,7 +136,7 @@ public abstract class ClassBodyCodegen { chunk.generate(v); } - mv.visitInsn(Opcodes.RETURN); + mv.visitInsn(RETURN); FunctionCodegen.endVisit(v, "static initializer", myClass); } } diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/ExpressionCodegen.java b/compiler/backend/src/org/jetbrains/jet/codegen/ExpressionCodegen.java index 47e27aa72bc..9b49fbe122a 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/ExpressionCodegen.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/ExpressionCodegen.java @@ -55,6 +55,7 @@ import org.jetbrains.jet.lexer.JetTokens; import java.util.*; +import static org.jetbrains.asm4.Opcodes.*; import static org.jetbrains.jet.codegen.JetTypeMapper.*; import static org.jetbrains.jet.codegen.context.CodegenBinding.*; import static org.jetbrains.jet.lang.resolve.BindingContext.*; @@ -1244,7 +1245,7 @@ public class ExpressionCodegen extends JetVisitor implem v.areturn(returnType); } else { - v.visitInsn(Opcodes.RETURN); + v.visitInsn(RETURN); } return StackValue.none(); } @@ -1405,7 +1406,7 @@ public class ExpressionCodegen extends JetVisitor implem if (value instanceof StackValue.FieldForSharedVar) { StackValue.FieldForSharedVar fieldForSharedVar = (StackValue.FieldForSharedVar) value; Type sharedType = StackValue.sharedTypeForType(value.type); - v.visitFieldInsn(Opcodes.GETFIELD, fieldForSharedVar.owner.getInternalName(), fieldForSharedVar.name, + v.visitFieldInsn(GETFIELD, fieldForSharedVar.owner.getInternalName(), fieldForSharedVar.name, sharedType.getDescriptor()); } @@ -1558,9 +1559,9 @@ public class ExpressionCodegen extends JetVisitor implem if (isInsideClass || isStatic || propertyDescriptor.getGetter() == null) { owner = ownerParam = typeMapper.getOwner(propertyDescriptor, contextKind()); isInterface = overridesTrait; - invokeOpcode = isStatic ? Opcodes.INVOKESTATIC : - overridesTrait ? Opcodes.INVOKEINTERFACE - : Opcodes.INVOKEVIRTUAL; + invokeOpcode = isStatic ? INVOKESTATIC : + overridesTrait ? INVOKEINTERFACE + : INVOKEVIRTUAL; } else { isInterface = CodegenUtil.isInterface(containingDeclaration) || overridesTrait; @@ -3520,7 +3521,7 @@ The "returned" value of try expression with no finally is either the last expres throw new UnsupportedOperationException("tuple too large"); } if (entries.size() == 0) { - v.visitFieldInsn(Opcodes.GETSTATIC, "jet/Tuple0", "INSTANCE", "Ljet/Tuple0;"); + v.visitFieldInsn(GETSTATIC, "jet/Tuple0", "INSTANCE", "Ljet/Tuple0;"); return StackValue.onStack(JET_TUPLE0_TYPE); } diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/JetTypeMapper.java b/compiler/backend/src/org/jetbrains/jet/codegen/JetTypeMapper.java index 9b70cfab928..e15c19fe073 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/JetTypeMapper.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/JetTypeMapper.java @@ -559,8 +559,8 @@ public class JetTypeMapper { ownerForDefaultParam.getInternalName() + (originalIsInterface ? JvmAbi.TRAIT_IMPL_SUFFIX : "")); invokeOpcode = isInterface - ? (superCall ? Opcodes.INVOKESTATIC : Opcodes.INVOKEINTERFACE) - : (isAccessor ? Opcodes.INVOKESTATIC : (superCall ? Opcodes.INVOKESPECIAL : Opcodes.INVOKEVIRTUAL)); + ? (superCall ? INVOKESTATIC : INVOKEINTERFACE) + : (isAccessor ? INVOKESTATIC : (superCall ? INVOKESPECIAL : INVOKEVIRTUAL)); if (isInterface && superCall) { descriptor = mapSignature(functionDescriptor, false, OwnerKind.TRAIT_IMPL); owner = JvmClassName.byInternalName(owner.getInternalName() + JvmAbi.TRAIT_IMPL_SUFFIX); diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/PropertyCodegen.java b/compiler/backend/src/org/jetbrains/jet/codegen/PropertyCodegen.java index 61dd493dc4c..759558da57a 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/PropertyCodegen.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/PropertyCodegen.java @@ -40,6 +40,7 @@ import org.jetbrains.jet.lang.types.lang.JetStandardLibrary; import java.util.BitSet; +import static org.jetbrains.asm4.Opcodes.*; import static org.jetbrains.jet.lang.resolve.BindingContextUtils.*; /** @@ -73,9 +74,9 @@ public class PropertyCodegen { generateSetter(p, propertyDescriptor); } else if (kind instanceof OwnerKind.DelegateKind) { - generateDefaultGetter(propertyDescriptor, Opcodes.ACC_PUBLIC, p); + generateDefaultGetter(propertyDescriptor, ACC_PUBLIC, p); if (propertyDescriptor.isVar()) { - generateDefaultSetter(propertyDescriptor, Opcodes.ACC_PUBLIC, p); + generateDefaultSetter(propertyDescriptor, ACC_PUBLIC, p); } } } @@ -98,16 +99,16 @@ public class PropertyCodegen { } int modifiers; if (kind == OwnerKind.NAMESPACE) { - modifiers = Opcodes.ACC_STATIC; + modifiers = ACC_STATIC; } else { - modifiers = Opcodes.ACC_PRIVATE; + modifiers = ACC_PRIVATE; } if (!propertyDescriptor.isVar()) { - modifiers |= Opcodes.ACC_FINAL; + modifiers |= ACC_FINAL; } if (JetStandardLibrary.getInstance().isVolatile(propertyDescriptor)) { - modifiers |= Opcodes.ACC_VOLATILE; + modifiers |= ACC_VOLATILE; } Type type = state.getInjector().getJetTypeMapper().mapType(propertyDescriptor.getType(), MapTypeMode.VALUE); FieldVisitor fieldVisitor = v.newField(p, modifiers, propertyDescriptor.getName().getName(), type.getDescriptor(), null, value); @@ -163,8 +164,8 @@ public class PropertyCodegen { assert propertyDescriptor != null; int flags = JetTypeMapper.getAccessModifiers(propertyDescriptor, 0) | (propertyDescriptor.getModality() == Modality.ABSTRACT - ? Opcodes.ACC_ABSTRACT - : (propertyDescriptor.getModality() == Modality.FINAL ? Opcodes.ACC_FINAL : 0)); + ? ACC_ABSTRACT + : (propertyDescriptor.getModality() == Modality.FINAL ? ACC_FINAL : 0)); generateDefaultGetter(propertyDescriptor, flags, p); } @@ -178,17 +179,17 @@ public class PropertyCodegen { } if (kind == OwnerKind.NAMESPACE) { - flags |= Opcodes.ACC_STATIC; + flags |= ACC_STATIC; } PsiElement psiElement = descriptorToDeclaration(state.getBindingContext(), propertyDescriptor.getContainingDeclaration()); boolean isTrait = psiElement instanceof JetClass && ((JetClass) psiElement).isTrait(); if (isTrait && !(kind instanceof OwnerKind.DelegateKind)) { - flags |= Opcodes.ACC_ABSTRACT; + flags |= ACC_ABSTRACT; } if (propertyDescriptor.getModality() == Modality.FINAL) { - flags |= Opcodes.ACC_FINAL; + flags |= ACC_FINAL; } JvmPropertyAccessorSignature signature = state.getInjector().getJetTypeMapper().mapGetterSignature(propertyDescriptor, kind); @@ -232,7 +233,7 @@ public class PropertyCodegen { } else { iv.visitFieldInsn( - kind == OwnerKind.NAMESPACE ? Opcodes.GETSTATIC : Opcodes.GETFIELD, + kind == OwnerKind.NAMESPACE ? GETSTATIC : GETFIELD, state.getInjector().getJetTypeMapper().getOwner(propertyDescriptor, kind).getInternalName(), propertyDescriptor.getName().getName(), type.getDescriptor()); @@ -270,7 +271,7 @@ public class PropertyCodegen { int modifiers = JetTypeMapper.getAccessModifiers(propertyDescriptor, 0); PropertySetterDescriptor setter = propertyDescriptor.getSetter(); int flags = setter == null ? modifiers : JetTypeMapper.getAccessModifiers(setter, modifiers); - flags |= (propertyDescriptor.getModality() == Modality.ABSTRACT ? Opcodes.ACC_ABSTRACT : 0); + flags |= (propertyDescriptor.getModality() == Modality.ABSTRACT ? ACC_ABSTRACT : 0); generateDefaultSetter(propertyDescriptor, flags, p); } @@ -284,17 +285,17 @@ public class PropertyCodegen { } if (kind == OwnerKind.NAMESPACE) { - flags |= Opcodes.ACC_STATIC; + flags |= ACC_STATIC; } PsiElement psiElement = descriptorToDeclaration(state.getBindingContext(), propertyDescriptor.getContainingDeclaration()); boolean isTrait = psiElement instanceof JetClass && ((JetClass) psiElement).isTrait(); if (isTrait && !(kind instanceof OwnerKind.DelegateKind)) { - flags |= Opcodes.ACC_ABSTRACT; + flags |= ACC_ABSTRACT; } if (propertyDescriptor.getModality() == Modality.FINAL) { - flags |= Opcodes.ACC_FINAL; + flags |= ACC_FINAL; } JvmPropertyAccessorSignature signature = state.getInjector().getJetTypeMapper().mapSetterSignature(propertyDescriptor, kind); @@ -339,13 +340,13 @@ public class PropertyCodegen { } else { iv.load(paramCode, type); - iv.visitFieldInsn(kind == OwnerKind.NAMESPACE ? Opcodes.PUTSTATIC : Opcodes.PUTFIELD, + iv.visitFieldInsn(kind == OwnerKind.NAMESPACE ? PUTSTATIC : PUTFIELD, state.getInjector().getJetTypeMapper().getOwner(propertyDescriptor, kind).getInternalName(), propertyDescriptor.getName().getName(), type.getDescriptor()); } - iv.visitInsn(Opcodes.RETURN); + iv.visitInsn(RETURN); } } FunctionCodegen.endVisit(mv, "setter", origin); diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/ScriptCodegen.java b/compiler/backend/src/org/jetbrains/jet/codegen/ScriptCodegen.java index 876f460a470..0ba69154cf5 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/ScriptCodegen.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/ScriptCodegen.java @@ -38,6 +38,7 @@ import org.jetbrains.jet.lang.resolve.java.JvmClassName; import javax.inject.Inject; import java.util.List; +import static org.jetbrains.asm4.Opcodes.*; import static org.jetbrains.jet.codegen.JetTypeMapper.OBJECT_TYPE; import static org.jetbrains.jet.codegen.context.CodegenBinding.*; @@ -102,8 +103,8 @@ public class ScriptCodegen { ClassBuilder classBuilder = classFileFactory.newVisitor(className.getInternalName() + ".class"); classBuilder.defineClass(scriptDeclaration, - Opcodes.V1_6, - Opcodes.ACC_PUBLIC, + V1_6, + ACC_PUBLIC, className.getInternalName(), null, "java/lang/Object", @@ -129,7 +130,7 @@ public class ScriptCodegen { Type blockType = jetTypeMapper.mapType(scriptDescriptor.getReturnType(), MapTypeMode.VALUE); - classBuilder.newField(null, Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, ScriptNameUtil.LAST_EXPRESSION_VALUE_FIELD_NAME, + classBuilder.newField(null, ACC_PUBLIC | ACC_FINAL, ScriptNameUtil.LAST_EXPRESSION_VALUE_FIELD_NAME, blockType.getDescriptor(), null, null); JvmMethodSignature jvmSignature = jetTypeMapper.mapScriptSignature(scriptDescriptor, importedScripts); @@ -137,7 +138,7 @@ public class ScriptCodegen { state.setScriptConstructorMethod(jvmSignature.getAsmMethod()); MethodVisitor mv = classBuilder.newMethod( - scriptDeclaration, Opcodes.ACC_PUBLIC, jvmSignature.getAsmMethod().getName(), jvmSignature.getAsmMethod().getDescriptor(), + scriptDeclaration, ACC_PUBLIC, jvmSignature.getAsmMethod().getName(), jvmSignature.getAsmMethod().getDescriptor(), null, null); mv.visitCode(); @@ -208,13 +209,13 @@ public class ScriptCodegen { for (ScriptDescriptor earlierScript : earlierScripts) { JvmClassName earlierClassName; earlierClassName = classNameForScriptDescriptor(bindingContext, earlierScript); - int access = Opcodes.ACC_PRIVATE | Opcodes.ACC_FINAL; + int access = ACC_PRIVATE | ACC_FINAL; classBuilder.newField(null, access, getScriptFieldName(earlierScript), earlierClassName.getDescriptor(), null, null); } for (ValueParameterDescriptor parameter : script.getValueParameters()) { Type parameterType = jetTypeMapper.mapType(parameter.getType(), MapTypeMode.VALUE); - int access = Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL; + int access = ACC_PUBLIC | ACC_FINAL; classBuilder.newField(null, access, parameter.getName().getIdentifier(), parameterType.getDescriptor(), null, null); } } diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/StackValue.java b/compiler/backend/src/org/jetbrains/jet/codegen/StackValue.java index de80b0316f2..9cce36b41d2 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/StackValue.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/StackValue.java @@ -35,6 +35,7 @@ import org.jetbrains.jet.lexer.JetTokens; import java.util.List; +import static org.jetbrains.asm4.Opcodes.*; import static org.jetbrains.jet.codegen.JetTypeMapper.OBJECT_TYPE; /** @@ -302,7 +303,7 @@ public abstract class StackValue { } public static void putTuple0Instance(InstructionAdapter v) { - v.visitFieldInsn(Opcodes.GETSTATIC, "jet/Tuple0", "INSTANCE", "Ljet/Tuple0;"); + v.visitFieldInsn(GETSTATIC, "jet/Tuple0", "INSTANCE", "Ljet/Tuple0;"); } protected void putAsBoolean(InstructionAdapter v) { @@ -494,22 +495,22 @@ public abstract class StackValue { public void condJump(Label label, boolean jumpIfFalse, InstructionAdapter v) { int opcode; if (opToken == JetTokens.EQEQ) { - opcode = jumpIfFalse ? Opcodes.IFNE : Opcodes.IFEQ; + opcode = jumpIfFalse ? IFNE : IFEQ; } else if (opToken == JetTokens.EXCLEQ) { - opcode = jumpIfFalse ? Opcodes.IFEQ : Opcodes.IFNE; + opcode = jumpIfFalse ? IFEQ : IFNE; } else if (opToken == JetTokens.GT) { - opcode = jumpIfFalse ? Opcodes.IFLE : Opcodes.IFGT; + opcode = jumpIfFalse ? IFLE : IFGT; } else if (opToken == JetTokens.GTEQ) { - opcode = jumpIfFalse ? Opcodes.IFLT : Opcodes.IFGE; + opcode = jumpIfFalse ? IFLT : IFGE; } else if (opToken == JetTokens.LT) { - opcode = jumpIfFalse ? Opcodes.IFGE : Opcodes.IFLT; + opcode = jumpIfFalse ? IFGE : IFLT; } else if (opToken == JetTokens.LTEQ) { - opcode = jumpIfFalse ? Opcodes.IFGT : Opcodes.IFLE; + opcode = jumpIfFalse ? IFGT : IFLE; } else { throw new UnsupportedOperationException("don't know how to generate this condjump"); @@ -526,7 +527,7 @@ public abstract class StackValue { v.lcmp(); } else { - opcode += (Opcodes.IF_ICMPEQ - Opcodes.IFEQ); + opcode += (IF_ICMPEQ - IFEQ); } v.visitJumpInsn(opcode, label); } @@ -541,10 +542,10 @@ public abstract class StackValue { public void condJump(Label label, boolean jumpIfFalse, InstructionAdapter v) { int opcode; if (opToken == JetTokens.EQEQEQ) { - opcode = jumpIfFalse ? Opcodes.IF_ACMPNE : Opcodes.IF_ACMPEQ; + opcode = jumpIfFalse ? IF_ACMPNE : IF_ACMPEQ; } else if (opToken == JetTokens.EXCLEQEQEQ) { - opcode = jumpIfFalse ? Opcodes.IF_ACMPEQ : Opcodes.IF_ACMPNE; + opcode = jumpIfFalse ? IF_ACMPEQ : IF_ACMPNE; } else { throw new UnsupportedOperationException("don't know how to generate this condjump"); @@ -879,7 +880,7 @@ public abstract class StackValue { @Override public void put(Type type, InstructionAdapter v) { - v.visitFieldInsn(isStatic ? Opcodes.GETSTATIC : Opcodes.GETFIELD, owner.getInternalName(), name, this.type.getDescriptor()); + v.visitFieldInsn(isStatic ? GETSTATIC : GETFIELD, owner.getInternalName(), name, this.type.getDescriptor()); coerce(type, v); } @@ -898,7 +899,7 @@ public abstract class StackValue { @Override public void store(Type topOfStackType, InstructionAdapter v) { coerce(topOfStackType, this.type, v); - v.visitFieldInsn(isStatic ? Opcodes.PUTSTATIC : Opcodes.PUTFIELD, owner.getInternalName(), name, this.type.getDescriptor()); + v.visitFieldInsn(isStatic ? PUTSTATIC : PUTFIELD, owner.getInternalName(), name, this.type.getDescriptor()); } } @@ -943,12 +944,12 @@ public abstract class StackValue { public void put(Type type, InstructionAdapter v) { if (isSuper && isInterface) { assert getter != null; - v.visitMethodInsn(Opcodes.INVOKESTATIC, methodOwner.getInternalName(), getter.getName(), + v.visitMethodInsn(INVOKESTATIC, methodOwner.getInternalName(), getter.getName(), getter.getDescriptor().replace("(", "(" + methodOwnerParam.getDescriptor())); } else { if (getter == null) { - v.visitFieldInsn(isStatic ? Opcodes.GETSTATIC : Opcodes.GETFIELD, methodOwner.getInternalName(), name, + v.visitFieldInsn(isStatic ? GETSTATIC : GETFIELD, methodOwner.getInternalName(), name, this.type.getDescriptor()); } else { @@ -962,11 +963,11 @@ public abstract class StackValue { public void store(Type topOfStackType, InstructionAdapter v) { if (isSuper && isInterface) { assert setter != null; - v.visitMethodInsn(Opcodes.INVOKESTATIC, methodOwner.getInternalName(), setter.getName(), + v.visitMethodInsn(INVOKESTATIC, methodOwner.getInternalName(), setter.getName(), setter.getDescriptor().replace("(", "(" + methodOwnerParam.getDescriptor())); } else if (setter == null) { - v.visitFieldInsn(isStatic ? Opcodes.PUTSTATIC : Opcodes.PUTFIELD, methodOwner.getInternalName(), name, + v.visitFieldInsn(isStatic ? PUTSTATIC : PUTFIELD, methodOwner.getInternalName(), name, this.type.getDescriptor()); } else { @@ -1025,7 +1026,7 @@ public abstract class StackValue { v.load(index, OBJECT_TYPE); Type refType = refType(this.type); Type sharedType = sharedTypeForType(this.type); - v.visitFieldInsn(Opcodes.GETFIELD, sharedType.getInternalName(), "ref", refType.getDescriptor()); + v.visitFieldInsn(GETFIELD, sharedType.getInternalName(), "ref", refType.getDescriptor()); coerce(refType, this.type, v); coerce(this.type, type, v); if (isReleaseOnPut) { @@ -1040,7 +1041,7 @@ public abstract class StackValue { v.swap(); Type refType = refType(this.type); Type sharedType = sharedTypeForType(this.type); - v.visitFieldInsn(Opcodes.PUTFIELD, sharedType.getInternalName(), "ref", refType.getDescriptor()); + v.visitFieldInsn(PUTFIELD, sharedType.getInternalName(), "ref", refType.getDescriptor()); } } @@ -1111,7 +1112,7 @@ public abstract class StackValue { public void put(Type type, InstructionAdapter v) { Type sharedType = sharedTypeForType(this.type); Type refType = refType(this.type); - v.visitFieldInsn(Opcodes.GETFIELD, sharedType.getInternalName(), "ref", refType.getDescriptor()); + v.visitFieldInsn(GETFIELD, sharedType.getInternalName(), "ref", refType.getDescriptor()); StackValue.onStack(refType).coerce(this.type, v); StackValue.onStack(this.type).coerce(type, v); } @@ -1119,7 +1120,7 @@ public abstract class StackValue { @Override public void store(Type topOfStackType, InstructionAdapter v) { coerce(topOfStackType, v); - v.visitFieldInsn(Opcodes.PUTFIELD, sharedTypeForType(type).getInternalName(), "ref", refType(type).getDescriptor()); + v.visitFieldInsn(PUTFIELD, sharedTypeForType(type).getInternalName(), "ref", refType(type).getDescriptor()); } } diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/TraitImplBodyCodegen.java b/compiler/backend/src/org/jetbrains/jet/codegen/TraitImplBodyCodegen.java index 0b72feb81d8..bbb7f33245e 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/TraitImplBodyCodegen.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/TraitImplBodyCodegen.java @@ -27,6 +27,8 @@ import org.jetbrains.jet.lang.types.lang.JetStandardClasses; import java.util.List; +import static org.jetbrains.asm4.Opcodes.*; + public class TraitImplBodyCodegen extends ClassBodyCodegen { public TraitImplBodyCodegen(JetClassOrObject aClass, CodegenContext context, ClassBuilder v, GenerationState state) { super(aClass, context, v, state); @@ -44,8 +46,8 @@ public class TraitImplBodyCodegen extends ClassBodyCodegen { @Override protected void generateDeclaration() { - v.defineClass(myClass, Opcodes.V1_6, - Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL/*| Opcodes.ACC_SUPER*/, + v.defineClass(myClass, V1_6, + ACC_PUBLIC | ACC_FINAL/*| Opcodes.ACC_SUPER*/, jvmName(), null, "java/lang/Object", diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/BinaryOp.java b/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/BinaryOp.java index c535fa07fb3..ca0f8c1931d 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/BinaryOp.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/BinaryOp.java @@ -29,6 +29,8 @@ import org.jetbrains.jet.lang.psi.JetExpression; import java.util.List; +import static org.jetbrains.asm4.Opcodes.*; + /** * @author yole */ @@ -73,6 +75,6 @@ public class BinaryOp implements IntrinsicMethod { } private boolean shift() { - return opcode == Opcodes.ISHL || opcode == Opcodes.ISHR || opcode == Opcodes.IUSHR; + return opcode == ISHL || opcode == ISHR || opcode == IUSHR; } } diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/IntrinsicMethods.java b/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/IntrinsicMethods.java index 74cc5522b8e..da719ada62e 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/IntrinsicMethods.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/IntrinsicMethods.java @@ -35,6 +35,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import static org.jetbrains.asm4.Opcodes.*; import static org.jetbrains.jet.lang.resolve.DescriptorUtils.getClassObjectName; /** @@ -96,17 +97,17 @@ public class IntrinsicMethods { declareIntrinsicFunction(typeName, Name.identifier("equals"), 1, EQUALS); } - declareBinaryOp(Name.identifier("plus"), Opcodes.IADD); - declareBinaryOp(Name.identifier("minus"), Opcodes.ISUB); - declareBinaryOp(Name.identifier("times"), Opcodes.IMUL); - declareBinaryOp(Name.identifier("div"), Opcodes.IDIV); - declareBinaryOp(Name.identifier("mod"), Opcodes.IREM); - declareBinaryOp(Name.identifier("shl"), Opcodes.ISHL); - declareBinaryOp(Name.identifier("shr"), Opcodes.ISHR); - declareBinaryOp(Name.identifier("ushr"), Opcodes.IUSHR); - declareBinaryOp(Name.identifier("and"), Opcodes.IAND); - declareBinaryOp(Name.identifier("or"), Opcodes.IOR); - declareBinaryOp(Name.identifier("xor"), Opcodes.IXOR); + declareBinaryOp(Name.identifier("plus"), IADD); + declareBinaryOp(Name.identifier("minus"), ISUB); + declareBinaryOp(Name.identifier("times"), IMUL); + declareBinaryOp(Name.identifier("div"), IDIV); + declareBinaryOp(Name.identifier("mod"), IREM); + declareBinaryOp(Name.identifier("shl"), ISHL); + declareBinaryOp(Name.identifier("shr"), ISHR); + declareBinaryOp(Name.identifier("ushr"), IUSHR); + declareBinaryOp(Name.identifier("and"), IAND); + declareBinaryOp(Name.identifier("or"), IOR); + declareBinaryOp(Name.identifier("xor"), IXOR); declareIntrinsicFunction(Name.identifier("Boolean"), Name.identifier("not"), 0, new Not());