Java Code Examples for com.sun.org.apache.bcel.internal.Constants#ICONST_0

The following examples show how to use com.sun.org.apache.bcel.internal.Constants#ICONST_0 . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PUSH.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
/**
 * This constructor also applies for values of type short, char, byte
 *
 * @param cp Constant pool
 * @param value to be pushed
 */
public PUSH(ConstantPoolGen cp, int value) {
  if((value >= -1) && (value <= 5)) // Use ICONST_n
    instruction = INSTRUCTIONS[Constants.ICONST_0 + value];
  else if((value >= -128) && (value <= 127)) // Use BIPUSH
    instruction = new BIPUSH((byte)value);
  else if((value >= -32768) && (value <= 32767)) // Use SIPUSH
    instruction = new SIPUSH((short)value);
  else // If everything fails create a Constant pool entry
    instruction = new LDC(cp.addInteger(value));
}
 
Example 2
Source File: PUSH.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * This constructor also applies for values of type short, char, byte
 *
 * @param cp Constant pool
 * @param value to be pushed
 */
public PUSH(ConstantPoolGen cp, int value) {
  if((value >= -1) && (value <= 5)) // Use ICONST_n
    instruction = INSTRUCTIONS[Constants.ICONST_0 + value];
  else if((value >= -128) && (value <= 127)) // Use BIPUSH
    instruction = new BIPUSH((byte)value);
  else if((value >= -32768) && (value <= 32767)) // Use SIPUSH
    instruction = new SIPUSH((short)value);
  else // If everything fails create a Constant pool entry
    instruction = new LDC(cp.addInteger(value));
}
 
Example 3
Source File: PUSH.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * This constructor also applies for values of type short, char, byte
 *
 * @param cp Constant pool
 * @param value to be pushed
 */
public PUSH(ConstantPoolGen cp, int value) {
  if((value >= -1) && (value <= 5)) // Use ICONST_n
    instruction = INSTRUCTIONS[Constants.ICONST_0 + value];
  else if((value >= -128) && (value <= 127)) // Use BIPUSH
    instruction = new BIPUSH((byte)value);
  else if((value >= -32768) && (value <= 32767)) // Use SIPUSH
    instruction = new SIPUSH((short)value);
  else // If everything fails create a Constant pool entry
    instruction = new LDC(cp.addInteger(value));
}
 
Example 4
Source File: PUSH.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * This constructor also applies for values of type short, char, byte
 *
 * @param cp Constant pool
 * @param value to be pushed
 */
public PUSH(ConstantPoolGen cp, int value) {
  if((value >= -1) && (value <= 5)) // Use ICONST_n
    instruction = INSTRUCTIONS[Constants.ICONST_0 + value];
  else if((value >= -128) && (value <= 127)) // Use BIPUSH
    instruction = new BIPUSH((byte)value);
  else if((value >= -32768) && (value <= 32767)) // Use SIPUSH
    instruction = new SIPUSH((short)value);
  else // If everything fails create a Constant pool entry
    instruction = new LDC(cp.addInteger(value));
}
 
Example 5
Source File: PUSH.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
/**
 * This constructor also applies for values of type short, char, byte
 *
 * @param cp Constant pool
 * @param value to be pushed
 */
public PUSH(ConstantPoolGen cp, int value) {
  if((value >= -1) && (value <= 5)) // Use ICONST_n
    instruction = INSTRUCTIONS[Constants.ICONST_0 + value];
  else if((value >= -128) && (value <= 127)) // Use BIPUSH
    instruction = new BIPUSH((byte)value);
  else if((value >= -32768) && (value <= 32767)) // Use SIPUSH
    instruction = new SIPUSH((short)value);
  else // If everything fails create a Constant pool entry
    instruction = new LDC(cp.addInteger(value));
}
 
Example 6
Source File: PUSH.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * This constructor also applies for values of type short, char, byte
 *
 * @param cp Constant pool
 * @param value to be pushed
 */
public PUSH(ConstantPoolGen cp, int value) {
  if((value >= -1) && (value <= 5)) // Use ICONST_n
    instruction = INSTRUCTIONS[Constants.ICONST_0 + value];
  else if((value >= -128) && (value <= 127)) // Use BIPUSH
    instruction = new BIPUSH((byte)value);
  else if((value >= -32768) && (value <= 32767)) // Use SIPUSH
    instruction = new SIPUSH((short)value);
  else // If everything fails create a Constant pool entry
    instruction = new LDC(cp.addInteger(value));
}
 
Example 7
Source File: PUSH.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * This constructor also applies for values of type short, char, byte
 *
 * @param cp Constant pool
 * @param value to be pushed
 */
public PUSH(ConstantPoolGen cp, int value) {
  if((value >= -1) && (value <= 5)) // Use ICONST_n
    instruction = INSTRUCTIONS[Constants.ICONST_0 + value];
  else if((value >= -128) && (value <= 127)) // Use BIPUSH
    instruction = new BIPUSH((byte)value);
  else if((value >= -32768) && (value <= 32767)) // Use SIPUSH
    instruction = new SIPUSH((short)value);
  else // If everything fails create a Constant pool entry
    instruction = new LDC(cp.addInteger(value));
}
 
Example 8
Source File: PUSH.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * This constructor also applies for values of type short, char, byte
 *
 * @param cp Constant pool
 * @param value to be pushed
 */
public PUSH(ConstantPoolGen cp, int value) {
  if((value >= -1) && (value <= 5)) // Use ICONST_n
    instruction = INSTRUCTIONS[Constants.ICONST_0 + value];
  else if((value >= -128) && (value <= 127)) // Use BIPUSH
    instruction = new BIPUSH((byte)value);
  else if((value >= -32768) && (value <= 32767)) // Use SIPUSH
    instruction = new SIPUSH((short)value);
  else // If everything fails create a Constant pool entry
    instruction = new LDC(cp.addInteger(value));
}
 
Example 9
Source File: PUSH.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * This constructor also applies for values of type short, char, byte
 *
 * @param cp Constant pool
 * @param value to be pushed
 */
public PUSH(ConstantPoolGen cp, int value) {
  if((value >= -1) && (value <= 5)) // Use ICONST_n
    instruction = INSTRUCTIONS[Constants.ICONST_0 + value];
  else if((value >= -128) && (value <= 127)) // Use BIPUSH
    instruction = new BIPUSH((byte)value);
  else if((value >= -32768) && (value <= 32767)) // Use SIPUSH
    instruction = new SIPUSH((short)value);
  else // If everything fails create a Constant pool entry
    instruction = new LDC(cp.addInteger(value));
}
 
Example 10
Source File: PUSH.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * This constructor also applies for values of type short, char, byte
 *
 * @param cp Constant pool
 * @param value to be pushed
 */
public PUSH(ConstantPoolGen cp, int value) {
  if((value >= -1) && (value <= 5)) // Use ICONST_n
    instruction = INSTRUCTIONS[Constants.ICONST_0 + value];
  else if((value >= -128) && (value <= 127)) // Use BIPUSH
    instruction = new BIPUSH((byte)value);
  else if((value >= -32768) && (value <= 32767)) // Use SIPUSH
    instruction = new SIPUSH((short)value);
  else // If everything fails create a Constant pool entry
    instruction = new LDC(cp.addInteger(value));
}
 
Example 11
Source File: PUSH.java    From openjdk-8 with GNU General Public License v2.0 2 votes vote down vote up
/**
 * @param cp Constant pool
 * @param value to be pushed
 */
public PUSH(ConstantPoolGen cp, boolean value) {
  instruction = INSTRUCTIONS[Constants.ICONST_0 + (value? 1 : 0)];
}
 
Example 12
Source File: PUSH.java    From openjdk-8-source with GNU General Public License v2.0 2 votes vote down vote up
/**
 * @param cp Constant pool
 * @param value to be pushed
 */
public PUSH(ConstantPoolGen cp, boolean value) {
  instruction = INSTRUCTIONS[Constants.ICONST_0 + (value? 1 : 0)];
}
 
Example 13
Source File: PUSH.java    From hottub with GNU General Public License v2.0 2 votes vote down vote up
/**
 * @param cp Constant pool
 * @param value to be pushed
 */
public PUSH(ConstantPoolGen cp, boolean value) {
  instruction = INSTRUCTIONS[Constants.ICONST_0 + (value? 1 : 0)];
}
 
Example 14
Source File: PUSH.java    From openjdk-jdk9 with GNU General Public License v2.0 2 votes vote down vote up
/**
 * @param cp Constant pool
 * @param value to be pushed
 */
public PUSH(ConstantPoolGen cp, boolean value) {
  instruction = INSTRUCTIONS[Constants.ICONST_0 + (value? 1 : 0)];
}
 
Example 15
Source File: PUSH.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 2 votes vote down vote up
/**
 * @param cp Constant pool
 * @param value to be pushed
 */
public PUSH(ConstantPoolGen cp, boolean value) {
  instruction = INSTRUCTIONS[Constants.ICONST_0 + (value? 1 : 0)];
}
 
Example 16
Source File: PUSH.java    From openjdk-jdk8u with GNU General Public License v2.0 2 votes vote down vote up
/**
 * @param cp Constant pool
 * @param value to be pushed
 */
public PUSH(ConstantPoolGen cp, boolean value) {
  instruction = INSTRUCTIONS[Constants.ICONST_0 + (value? 1 : 0)];
}
 
Example 17
Source File: PUSH.java    From JDKSourceCode1.8 with MIT License 2 votes vote down vote up
/**
 * @param cp Constant pool
 * @param value to be pushed
 */
public PUSH(ConstantPoolGen cp, boolean value) {
  instruction = INSTRUCTIONS[Constants.ICONST_0 + (value? 1 : 0)];
}
 
Example 18
Source File: PUSH.java    From jdk8u60 with GNU General Public License v2.0 2 votes vote down vote up
/**
 * @param cp Constant pool
 * @param value to be pushed
 */
public PUSH(ConstantPoolGen cp, boolean value) {
  instruction = INSTRUCTIONS[Constants.ICONST_0 + (value? 1 : 0)];
}
 
Example 19
Source File: PUSH.java    From TencentKona-8 with GNU General Public License v2.0 2 votes vote down vote up
/**
 * @param cp Constant pool
 * @param value to be pushed
 */
public PUSH(ConstantPoolGen cp, boolean value) {
  instruction = INSTRUCTIONS[Constants.ICONST_0 + (value? 1 : 0)];
}
 
Example 20
Source File: PUSH.java    From jdk1.8-source-analysis with Apache License 2.0 2 votes vote down vote up
/**
 * @param cp Constant pool
 * @param value to be pushed
 */
public PUSH(ConstantPoolGen cp, boolean value) {
  instruction = INSTRUCTIONS[Constants.ICONST_0 + (value? 1 : 0)];
}