/** * 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 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)); }
/** * 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 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 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)); }
public void astore(final Type type) { mv.visitInsn(type.getOpcode(Opcodes.IASTORE)); }
public void xor(final Type type) { mv.visitInsn(type.getOpcode(Opcodes.IXOR)); }
/** * 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 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)); }
public void store(final int var, final Type type) { mv.visitVarInsn(type.getOpcode(Opcodes.ISTORE), var); }
public void sub(final Type type) { mv.visitInsn(type.getOpcode(Opcodes.ISUB)); }
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 ushr(final Type type) { mv.visitInsn(type.getOpcode(Opcodes.IUSHR)); }
/** * 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 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 load(final int var, final Type type) { mv.visitVarInsn(type.getOpcode(Opcodes.ILOAD), var); }
public void shr(final Type type) { mv.visitInsn(type.getOpcode(Opcodes.ISHR)); }
public void areturn(final Type t) { mv.visitInsn(t.getOpcode(Opcodes.IRETURN)); }
private void emitUnboxedLocal(GeneratorAdapter gen, LocalBinding lb){ int argoff = isStatic?0:1; Class primc = lb.getPrimitiveType(); if(closes.containsKey(lb)) { gen.loadThis(); gen.getField(objtype, lb.name, Type.getType(primc)); } else if(lb.isArg) gen.loadArg(lb.idx-argoff); else gen.visitVarInsn(Type.getType(primc).getOpcode(Opcodes.ILOAD), lb.idx); }