/** * Generates the instruction to push a handle on the stack. * * @param handle * the handle to be pushed on the stack. */ public void push(final Handle handle) { mv.visitLdcInsn(handle); }
@Override public void visitLdcInsn(final Object cst) { if (cst instanceof Long || cst instanceof Double) { minSize += 3; maxSize += 3; } else { minSize += 2; maxSize += 3; } if (mv != null) { mv.visitLdcInsn(cst); } }
public void tconst(final Type type) { mv.visitLdcInsn(type); }
public void hconst(final Handle handle) { mv.visitLdcInsn(handle); }
public void lconst(final long cst) { if (cst == 0L || cst == 1L) { mv.visitInsn(Opcodes.LCONST_0 + (int) cst); } else { mv.visitLdcInsn(new Long(cst)); } }
public void fconst(final float cst) { int bits = Float.floatToIntBits(cst); if (bits == 0L || bits == 0x3f800000 || bits == 0x40000000) { // 0..2 mv.visitInsn(Opcodes.FCONST_0 + (int) cst); } else { mv.visitLdcInsn(new Float(cst)); } }
public void aconst(final Object cst) { if (cst == null) { mv.visitInsn(Opcodes.ACONST_NULL); } else { mv.visitLdcInsn(cst); } }
public void dconst(final double cst) { long bits = Double.doubleToLongBits(cst); if (bits == 0L || bits == 0x3ff0000000000000L) { // +0.0d and 1.0d mv.visitInsn(Opcodes.DCONST_0 + (int) cst); } else { mv.visitLdcInsn(new Double(cst)); } }
/** * Generates the instruction to push the given value on the stack. * * @param value * the value to be pushed on the stack. */ public void push(final long value) { if (value == 0L || value == 1L) { mv.visitInsn(Opcodes.LCONST_0 + (int) value); } else { mv.visitLdcInsn(new Long(value)); } }
/** * Generates the instruction to push the given value on the stack. * * @param value * the value to be pushed on the stack. May be <tt>null</tt>. */ public void push(final String value) { if (value == null) { mv.visitInsn(Opcodes.ACONST_NULL); } else { mv.visitLdcInsn(value); } }
/** * Generates the instruction to push the given value on the stack. * * @param value * the value to be pushed on the stack. */ public void push(final float value) { int bits = Float.floatToIntBits(value); if (bits == 0L || bits == 0x3f800000 || bits == 0x40000000) { // 0..2 mv.visitInsn(Opcodes.FCONST_0 + (int) value); } else { mv.visitLdcInsn(new Float(value)); } }
/** * Generates the instruction to push the given value on the stack. * * @param value * the value to be pushed on the stack. */ public void push(final double value) { long bits = Double.doubleToLongBits(value); if (bits == 0L || bits == 0x3ff0000000000000L) { // +0.0d and 1.0d mv.visitInsn(Opcodes.DCONST_0 + (int) value); } else { mv.visitLdcInsn(new Double(value)); } }
/** * Generates the instruction to push the given value on the stack. * * @param value the value to be pushed on the stack. */ public void push(final float value){ int bits = Float.floatToIntBits(value); if(bits == 0L || bits == 0x3f800000 || bits == 0x40000000) { // 0..2 mv.visitInsn(Opcodes.FCONST_0 + (int) value); } else { mv.visitLdcInsn(new Float(value)); } }
/** * Generates the instruction to push the given value on the stack. * * @param value the value to be pushed on the stack. */ public void push(final double value){ long bits = Double.doubleToLongBits(value); if(bits == 0L || bits == 0x3ff0000000000000L) { // +0.0d and 1.0d mv.visitInsn(Opcodes.DCONST_0 + (int) value); } else { mv.visitLdcInsn(new Double(value)); } }
/** * Generates the instruction to push the given value on the stack. * * @param value the value to be pushed on the stack. */ public void push(final long value){ if(value == 0L || value == 1L) { mv.visitInsn(Opcodes.LCONST_0 + (int) value); } else { mv.visitLdcInsn(new Long(value)); } }
@Override public void visitLdcInsn(final Object cst) { mv.visitLdcInsn(cst); if (constructor) { pushValue(OTHER); if (cst instanceof Double || cst instanceof Long) { pushValue(OTHER); } } }
public void iconst(final int cst) { if (cst >= -1 && cst <= 5) { mv.visitInsn(Opcodes.ICONST_0 + cst); } else if (cst >= Byte.MIN_VALUE && cst <= Byte.MAX_VALUE) { mv.visitIntInsn(Opcodes.BIPUSH, cst); } else if (cst >= Short.MIN_VALUE && cst <= Short.MAX_VALUE) { mv.visitIntInsn(Opcodes.SIPUSH, cst); } else { mv.visitLdcInsn(new Integer(cst)); } }
/** * Generates the instruction to push the given value on the stack. * * @param value * the value to be pushed on the stack. */ public void push(final int value) { if (value >= -1 && value <= 5) { mv.visitInsn(Opcodes.ICONST_0 + value); } else if (value >= Byte.MIN_VALUE && value <= Byte.MAX_VALUE) { mv.visitIntInsn(Opcodes.BIPUSH, value); } else if (value >= Short.MIN_VALUE && value <= Short.MAX_VALUE) { mv.visitIntInsn(Opcodes.SIPUSH, value); } else { mv.visitLdcInsn(new Integer(value)); } }
/** * Generates the instruction to push the given value on the stack. * * @param value the value to be pushed on the stack. */ public void push(final int value){ if(value >= -1 && value <= 5) { mv.visitInsn(Opcodes.ICONST_0 + value); } else if(value >= Byte.MIN_VALUE && value <= Byte.MAX_VALUE) { mv.visitIntInsn(Opcodes.BIPUSH, value); } else if(value >= Short.MIN_VALUE && value <= Short.MAX_VALUE) { mv.visitIntInsn(Opcodes.SIPUSH, value); } else { mv.visitLdcInsn(new Integer(value)); } }
@Override public void visitLdcInsn(final Object cst) { if (mv != null) { mv.visitLdcInsn(cst);