public InstructionSequenceBuilder ldc2_w(double value) { // If we can shrink the instruction, we may not need to create a constant. return ldc2_w(constantPoolEditor.addDoubleConstant(value)); }
public InstructionSequenceBuilder ldc2_w(long value) { // If we can shrink the instruction, we may not need to create a constant. return ldc2_w(constantPoolEditor.addLongConstant(value)); }
public InstructionSequenceBuilder ldc2_w(long value) { // If we can shrink the instruction, we may not need to create a constant. return ldc2_w(constantPoolEditor.addLongConstant(value)); }
/** * Pushes the given primitive long on the stack in the most efficient way * (as an lconst or ldc instruction). * * @param value the int value to be pushed. */ public InstructionSequenceBuilder pushLong(long value) { return value == 0L || value == 1L ? lconst((int)value) : ldc2_w(value); }
/** * Pushes the given primitive long on the stack in the most efficient way * (as an lconst or ldc instruction). * * @param value the int value to be pushed. */ public InstructionSequenceBuilder pushLong(long value) { return value == 0L || value == 1L ? lconst((int)value) : ldc2_w(value); }
/** * Pushes the given primitive double on the stack in the most efficient way * (as a dconst or ldc instruction). * * @param value the int value to be pushed. */ public InstructionSequenceBuilder pushDouble(double value) { return value == 0. || value == 1. ? dconst((int)value) : ldc2_w(value); }
/** * Pushes the given primitive long on the stack in the most efficient way * (as an lconst or ldc instruction). * * @param value the int value to be pushed. */ public InstructionSequenceBuilder pushLong(long value) { return value == 0L || value == 1L ? lconst((int)value) : ldc2_w(value); }
public InstructionSequenceBuilder ldc2_w(long value) { // If we can shrink the instruction, we may not need to create a constant. return ldc2_w(constantPoolEditor.addLongConstant(value)); }
public InstructionSequenceBuilder ldc2_w(double value) { // If we can shrink the instruction, we may not need to create a constant. return ldc2_w(constantPoolEditor.addDoubleConstant(value)); }
public InstructionSequenceBuilder ldc2_w(double value) { // If we can shrink the instruction, we may not need to create a constant. return ldc2_w(constantPoolEditor.addDoubleConstant(value)); }
/** * Pushes the given primitive double on the stack in the most efficient way * (as a dconst or ldc instruction). * * @param value the int value to be pushed. */ public InstructionSequenceBuilder pushDouble(double value) { return value == 0. || value == 1. ? dconst((int)value) : ldc2_w(value); }
/** * Pushes the given primitive double on the stack in the most efficient way * (as a dconst or ldc instruction). * * @param value the int value to be pushed. */ public InstructionSequenceBuilder pushDouble(double value) { return value == 0. || value == 1. ? dconst((int)value) : ldc2_w(value); }
/** * Pushes the given primitive value on the stack. * * Operand stack: * ... -> ..., value * * @param value the primitive value to be pushed - should never be null. * @param type the internal type of the primitive ('Z','B','I',...) */ public InstructionSequenceBuilder pushPrimitive(Object value, char type) { switch (type) { case ClassConstants.TYPE_BOOLEAN: return ((Boolean)value).booleanValue() ? iconst_1() : iconst_0(); case ClassConstants.TYPE_BYTE: case ClassConstants.TYPE_SHORT: case ClassConstants.TYPE_INT: return pushInt(((Number)value).intValue()); case ClassConstants.TYPE_CHAR: return ldc(((Character)value).charValue()); case ClassConstants.TYPE_LONG: return ldc2_w((Long)value); case ClassConstants.TYPE_FLOAT: return ldc(((Float)value).floatValue()); case ClassConstants.TYPE_DOUBLE: return ldc2_w((Double)value); default: throw new IllegalArgumentException("" + type); } }
/** * Pushes the given primitive value on the stack. * * Operand stack: * ... -> ..., value * * @param value the primitive value to be pushed - should never be null. * @param type the internal type of the primitive ('Z','B','I',...) */ public InstructionSequenceBuilder pushPrimitive(Object value, char type) { switch (type) { case ClassConstants.TYPE_BOOLEAN: return ((Boolean)value).booleanValue() ? iconst_1() : iconst_0(); case ClassConstants.TYPE_BYTE: case ClassConstants.TYPE_SHORT: case ClassConstants.TYPE_INT: return pushInt(((Number)value).intValue()); case ClassConstants.TYPE_CHAR: return ldc(((Character)value).charValue()); case ClassConstants.TYPE_LONG: return ldc2_w((Long)value); case ClassConstants.TYPE_FLOAT: return ldc(((Float)value).floatValue()); case ClassConstants.TYPE_DOUBLE: return ldc2_w((Double)value); default: throw new IllegalArgumentException("" + type); } }
/** * Pushes the given primitive value on the stack. * * Operand stack: * ... -> ..., value * * @param value the primitive value to be pushed - should never be null. * @param type the internal type of the primitive ('Z','B','I',...) */ public InstructionSequenceBuilder pushPrimitive(Object value, char type) { switch (type) { case ClassConstants.TYPE_BOOLEAN: return ((Boolean)value).booleanValue() ? iconst_1() : iconst_0(); case ClassConstants.TYPE_BYTE: case ClassConstants.TYPE_SHORT: case ClassConstants.TYPE_INT: return pushInt(((Number)value).intValue()); case ClassConstants.TYPE_CHAR: return ldc(((Character)value).charValue()); case ClassConstants.TYPE_LONG: return ldc2_w((Long)value); case ClassConstants.TYPE_FLOAT: return ldc(((Float)value).floatValue()); case ClassConstants.TYPE_DOUBLE: return ldc2_w((Double)value); default: throw new IllegalArgumentException("" + type); } }