/** * 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)); }
/** * Generates the instruction to do the specified mathematical or logical * operation. * * @param op * a mathematical or logical operation. Must be one of ADD, SUB, * MUL, DIV, REM, NEG, SHL, SHR, USHR, AND, OR, XOR. * @param type * the type of the operand(s) for this operation. */ public void math(final int op, final Type type) { mv.visitInsn(type.getOpcode(op)); }
/** * Generates the instruction to store the top stack value in a local * variable. * * @param type * the type of the local variable to be stored. * @param index * an index in the frame's local variables array. */ private void storeInsn(final Type type, final int index) { mv.visitVarInsn(type.getOpcode(Opcodes.ISTORE), index); }
/** * Generates the instruction to return the top stack value to the caller. */ public void returnValue() { mv.visitInsn(returnType.getOpcode(Opcodes.IRETURN)); }
/** * 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. */ private void loadInsn(final Type type, final int index) { mv.visitVarInsn(type.getOpcode(Opcodes.ILOAD), index); }
/** * 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)); }
public void store(final int var, final Type type) { mv.visitVarInsn(type.getOpcode(Opcodes.ISTORE), var); }
public void ushr(final Type type) { mv.visitInsn(type.getOpcode(Opcodes.IUSHR)); }
public void load(final int var, final Type type) { mv.visitVarInsn(type.getOpcode(Opcodes.ILOAD), var); }
public void neg(final Type type) { mv.visitInsn(type.getOpcode(Opcodes.INEG)); }
public void shr(final Type type) { mv.visitInsn(type.getOpcode(Opcodes.ISHR)); }
public void and(final Type type) { mv.visitInsn(type.getOpcode(Opcodes.IAND)); }
public void xor(final Type type) { mv.visitInsn(type.getOpcode(Opcodes.IXOR)); }
public void add(final Type type) { mv.visitInsn(type.getOpcode(Opcodes.IADD)); }
public void mul(final Type type) { mv.visitInsn(type.getOpcode(Opcodes.IMUL)); }
public void rem(final Type type) { mv.visitInsn(type.getOpcode(Opcodes.IREM)); }
public void aload(final Type type) { mv.visitInsn(type.getOpcode(Opcodes.IALOAD)); }
public void div(final Type type) { mv.visitInsn(type.getOpcode(Opcodes.IDIV)); }
public void shl(final Type type) { mv.visitInsn(type.getOpcode(Opcodes.ISHL)); }
public void or(final Type type) { mv.visitInsn(type.getOpcode(Opcodes.IOR)); }