public void visitIntInsn(int opcode, int operand) { mv1.visitIntInsn(opcode, operand); mv2.visitIntInsn(opcode, operand); }
public void visitIntInsn(int opcode, int operand) { mv1.visitIntInsn(opcode, operand); mv2.visitIntInsn(opcode, operand); }
/** * Visits an instruction with a single int operand. * * @param opcode the opcode of the instruction to be visited. This opcode is either BIPUSH, SIPUSH * or NEWARRAY. * @param operand the operand of the instruction to be visited.<br> * When opcode is BIPUSH, operand value should be between Byte.MIN_VALUE and Byte.MAX_VALUE. * <br> * When opcode is SIPUSH, operand value should be between Short.MIN_VALUE and Short.MAX_VALUE. * <br> * When opcode is NEWARRAY, operand value should be one of {@link Opcodes#T_BOOLEAN}, {@link * Opcodes#T_CHAR}, {@link Opcodes#T_FLOAT}, {@link Opcodes#T_DOUBLE}, {@link Opcodes#T_BYTE}, * {@link Opcodes#T_SHORT}, {@link Opcodes#T_INT} or {@link Opcodes#T_LONG}. */ public void visitIntInsn(final int opcode, final int operand) { if (mv != null) { mv.visitIntInsn(opcode, operand); } }
public static void PUSH(MethodVisitor mv, int value) { if ((value >= -1) && (value <= 5)) // Use ICONST_n mv.visitInsn(ICONST_0 + value); else if ((value >= -128) && (value <= 127)) // Use BIPUSH mv.visitIntInsn(BIPUSH, value); else if ((value >= -32768) && (value <= 32767)) // Use SIPUSH mv.visitIntInsn(SIPUSH, value); else mv.visitLdcInsn(new Integer(value)); }
public void push(int i) { if (i < -1) { mv.visitLdcInsn(new Integer(i)); } else if (i <= 5) { mv.visitInsn(TypeUtils.ICONST(i)); } else if (i <= Byte.MAX_VALUE) { mv.visitIntInsn(Constants.BIPUSH, i); } else if (i <= Short.MAX_VALUE) { mv.visitIntInsn(Constants.SIPUSH, i); } else { mv.visitLdcInsn(new Integer(i)); } }
public void push(int i) { if (i < -1) { mv.visitLdcInsn(new Integer(i)); } else if (i <= 5) { mv.visitInsn(TypeUtils.ICONST(i)); } else if (i <= Byte.MAX_VALUE) { mv.visitIntInsn(Constants.BIPUSH, i); } else if (i <= Short.MAX_VALUE) { mv.visitIntInsn(Constants.SIPUSH, i); } else { mv.visitLdcInsn(new Integer(i)); } }
mv.visitIntInsn(Opcodes.BIPUSH, argsCount); } else { mv.visitInsn(Opcodes.ICONST_0 + argsCount); mv.visitInsn(Opcodes.ICONST_0 + i); } else { mv.visitIntInsn(Opcodes.BIPUSH, i);
break; case 'Z': asm.visitIntInsn(NEWARRAY, T_BOOLEAN); break; case 'B': asm.visitIntInsn(NEWARRAY, T_BYTE); break; case 'S': asm.visitIntInsn(NEWARRAY, T_SHORT); break; case 'C': asm.visitIntInsn(NEWARRAY, T_CHAR); break; case 'I': asm.visitIntInsn(NEWARRAY, T_INT); break; case 'F': asm.visitIntInsn(NEWARRAY, T_FLOAT); break; case 'J': asm.visitIntInsn(NEWARRAY, T_LONG); break; case 'D': asm.visitIntInsn(NEWARRAY, T_DOUBLE); break;
super.visitInsn(ICONST_0 + value); } else if (value <= Byte.MAX_VALUE && value >= Byte.MIN_VALUE) { super.visitIntInsn(BIPUSH, value); } else if (value <= Short.MAX_VALUE && value >= Short.MIN_VALUE) { super.visitIntInsn(SIPUSH, value); } else { super.visitLdcInsn(cst);
return; } else if (i >= Byte.MIN_VALUE && i <= Byte.MAX_VALUE) { mv.visitIntInsn(BIPUSH, i); return; } else if (i >= Short.MIN_VALUE && i <= Short.MAX_VALUE) { mv.visitIntInsn(SIPUSH, i); return;
public void newarray(Type type) { if (TypeUtils.isPrimitive(type)) { mv.visitIntInsn(Constants.NEWARRAY, TypeUtils.NEWARRAY(type)); } else { emit_type(Constants.ANEWARRAY, type); } }
public void newarray(Type type) { if (TypeUtils.isPrimitive(type)) { mv.visitIntInsn(Constants.NEWARRAY, TypeUtils.NEWARRAY(type)); } else { emit_type(Constants.ANEWARRAY, type); } }
mv.visitInsn(Opcodes.DUP); mv.visitLdcInsn(fieldName); mv.visitIntInsn(Opcodes.BIPUSH, i); mv.visitMethodInsn(Opcodes.INVOKESPECIAL, name, "<init>", "(Ljava/lang/String;I)V", false); mv.visitIntInsn(Opcodes.BIPUSH, fieldCount); mv.visitTypeInsn(Opcodes.ANEWARRAY, name); String fieldName = fieldNames.get(i); mv.visitInsn(Opcodes.DUP); mv.visitIntInsn(Opcodes.BIPUSH, i); mv.visitFieldInsn(Opcodes.GETSTATIC, name, fieldName, classDef.getType()); mv.visitInsn(Opcodes.AASTORE);
for (int p_index = 0; p_index < parameterTypes.length; p_index++) { mv.visitVarInsn(ALOAD, 3); mv.visitIntInsn(BIPUSH, p_index); mv.visitInsn(AALOAD);
for (int p_index = 0; p_index < parameterTypes.length; p_index++) { mv.visitVarInsn(ALOAD, 3); mv.visitIntInsn(BIPUSH, p_index); mv.visitInsn(AALOAD);
throw new RuntimeException("invalid type"); mv.visitIntInsn(Opcodes.NEWARRAY, type);
default: if (v >= Byte.MIN_VALUE && v <= Byte.MAX_VALUE) { mv.visitIntInsn(Opcodes.BIPUSH, v); } else if (v >= Short.MIN_VALUE && v <= Short.MAX_VALUE) { mv.visitIntInsn(Opcodes.SIPUSH, v); } else { mv.visitLdcInsn(v);
mv.visitInsn(ICONST_0 + pc); } else { mv.visitIntInsn(BIPUSH, pc);
mv.visitIntInsn(opcode, op); break;
case Constants.BIPUSH: case Constants.NEWARRAY: methodVisitor.visitIntInsn(opcode, classFileBuffer[currentOffset + 1]); currentOffset += 2; break; case Constants.SIPUSH: methodVisitor.visitIntInsn(opcode, readShort(currentOffset + 1)); currentOffset += 3; break;