/** * * @param type */ public void neg(Type type) { mv.visitInsn(type.getOpcode(Opcodes.INEG)); }
/** * generated the instruction to mul top two stack value * * @param type * which add type */ public void div(Type type) { arithmetic(type.getOpcode(Opcodes.IDIV)); }
/** * generated the instruction to rem top two stack value * * @param type */ public void rem(Type type) { arithmetic(type.getOpcode(Opcodes.IREM)); }
/** * Generates the instruction to load an element from an array. * * @param type * the type of the array element to be loaded. */ public void arrayLoad(final Type type) { mv.visitInsn(type.getOpcode(Opcodes.IALOAD)); }
/** * generated the instruction to add top two stack value * * @param type * which add type */ public void add(Type type) { arithmetic(type.getOpcode(Opcodes.IADD)); }
/** * generated the instruction to mul top two stack value * * @param type * which add type */ public void mul(Type type) { arithmetic(type.getOpcode(Opcodes.IMUL)); }
/** * Generates the instruction to store an element in an array. * * @param type * the type of the array element to be stored. */ public void arrayStore(final Type type) { mv.visitInsn(type.getOpcode(Opcodes.IASTORE)); }
/** * generated the instruction to sub top two stack value * * @param type * which add type */ public void sub(Type type) { arithmetic(type.getOpcode(Opcodes.ISUB)); }
public void bitXor(final Type type) { mv.visitInsn(type.getOpcode(Opcodes.IXOR)); }
public void returnInsn(Type type) { mv.visitInsn(type.getOpcode(Opcodes.IRETURN)); }
public void bitOr(final Type type) { mv.visitInsn(type.getOpcode(Opcodes.IOR)); }
public void leftShift(final Type type) { mv.visitInsn(type.getOpcode(Opcodes.ISHL)); }
public void bitAnd(final Type type) { mv.visitInsn(type.getOpcode(Opcodes.IAND)); }
public void rightShift(final Type type) { mv.visitInsn(type.getOpcode(Opcodes.ISHR)); }
public void unsignedRightShift(final Type type) { mv.visitInsn(type.getOpcode(Opcodes.IUSHR)); }
/** * Generates the instruction to push a local variable on the stack. * * @param type * the type of the local variable to be loaded. * @param index * an index in the frame's local variables array. */ public void loadInsn(final Type type, final int index) { int opcode = type.getOpcode(Opcodes.ILOAD); if (opcode == Opcodes.ALOAD) { mv.setNextPushTypes(type); } mv.visitVarInsn(opcode, index); }
/** * * @param type */ public void inverts(final Type type) { if (type.equals(Type.LONG_TYPE)) { push(-1L); } else { push(-1); } mv.visitInsn(type.getOpcode(Opcodes.IXOR)); }
/** * Generates the instruction to store the top stack value in a local * variable. * * @param var */ public void storeInsn(final LocalVariable var) { locals.setCursor(var.getScopeLogicVar()); locals.printState(); mv.visitVarInsn(var.getMeta().getType().getType().getOpcode(Opcodes.ISTORE), var.getScopeLogicVar().getInitStartPos()); }