예제 #1
0
 /**
  * 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));
 }
예제 #2
0
 /**
  * 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));
 }
예제 #3
0
 /**
  * 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));
 }
예제 #4
0
 /**
  * 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);
 }
예제 #5
0
 /**
  * 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);
 }
예제 #6
0
 /** Generates the instruction to return the top stack value to the caller. */
 public void returnValue() {
   mv.visitInsn(returnType.getOpcode(Opcodes.IRETURN));
 }