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

The following examples show how to use com.sun.org.apache.bcel.internal.Constants#MAX_SHORT . 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: LocalVariableInstruction.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
/**
 * Set the local variable index
 */
public void setIndex(int n) {
  if((n < 0) || (n > Constants.MAX_SHORT))
    throw new ClassGenException("Illegal value: " + n);

  this.n = n;

  if(n >= 0 && n <= 3) { // Use more compact instruction xLOAD_n
    opcode = (short)(c_tag + n);
    length = 1;
  } else {
    opcode = canon_tag;

    if(wide()) // Need WIDE prefix ?
      length = 4;
    else
      length = 2;
  }
}
 
Example 2
Source File: LocalVariableInstruction.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Set the local variable index
 */
public void setIndex(int n) {
  if((n < 0) || (n > Constants.MAX_SHORT))
    throw new ClassGenException("Illegal value: " + n);

  this.n = n;

  if(n >= 0 && n <= 3) { // Use more compact instruction xLOAD_n
    opcode = (short)(c_tag + n);
    length = 1;
  } else {
    opcode = canon_tag;

    if(wide()) // Need WIDE prefix ?
      length = 4;
    else
      length = 2;
  }
}
 
Example 3
Source File: LocalVariableInstruction.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Set the local variable index
 */
public void setIndex(int n) {
  if((n < 0) || (n > Constants.MAX_SHORT))
    throw new ClassGenException("Illegal value: " + n);

  this.n = n;

  if(n >= 0 && n <= 3) { // Use more compact instruction xLOAD_n
    opcode = (short)(c_tag + n);
    length = 1;
  } else {
    opcode = canon_tag;

    if(wide()) // Need WIDE prefix ?
      length = 4;
    else
      length = 2;
  }
}
 
Example 4
Source File: LocalVariableInstruction.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Set the local variable index
 */
public void setIndex(int n) {
  if((n < 0) || (n > Constants.MAX_SHORT))
    throw new ClassGenException("Illegal value: " + n);

  this.n = n;

  if(n >= 0 && n <= 3) { // Use more compact instruction xLOAD_n
    opcode = (short)(c_tag + n);
    length = 1;
  } else {
    opcode = canon_tag;

    if(wide()) // Need WIDE prefix ?
      length = 4;
    else
      length = 2;
  }
}
 
Example 5
Source File: LocalVariableInstruction.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Set the local variable index
 */
public void setIndex(int n) {
  if((n < 0) || (n > Constants.MAX_SHORT))
    throw new ClassGenException("Illegal value: " + n);

  this.n = n;

  if(n >= 0 && n <= 3) { // Use more compact instruction xLOAD_n
    opcode = (short)(c_tag + n);
    length = 1;
  } else {
    opcode = canon_tag;

    if(wide()) // Need WIDE prefix ?
      length = 4;
    else
      length = 2;
  }
}
 
Example 6
Source File: LocalVariableInstruction.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Set the local variable index
 */
public void setIndex(int n) {
  if((n < 0) || (n > Constants.MAX_SHORT))
    throw new ClassGenException("Illegal value: " + n);

  this.n = n;

  if(n >= 0 && n <= 3) { // Use more compact instruction xLOAD_n
    opcode = (short)(c_tag + n);
    length = 1;
  } else {
    opcode = canon_tag;

    if(wide()) // Need WIDE prefix ?
      length = 4;
    else
      length = 2;
  }
}
 
Example 7
Source File: LocalVariableInstruction.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Set the local variable index
 */
public void setIndex(int n) {
  if((n < 0) || (n > Constants.MAX_SHORT))
    throw new ClassGenException("Illegal value: " + n);

  this.n = n;

  if(n >= 0 && n <= 3) { // Use more compact instruction xLOAD_n
    opcode = (short)(c_tag + n);
    length = 1;
  } else {
    opcode = canon_tag;

    if(wide()) // Need WIDE prefix ?
      length = 4;
    else
      length = 2;
  }
}
 
Example 8
Source File: LocalVariableInstruction.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
/**
 * Set the local variable index
 */
public void setIndex(int n) {
  if((n < 0) || (n > Constants.MAX_SHORT))
    throw new ClassGenException("Illegal value: " + n);

  this.n = n;

  if(n >= 0 && n <= 3) { // Use more compact instruction xLOAD_n
    opcode = (short)(c_tag + n);
    length = 1;
  } else {
    opcode = canon_tag;

    if(wide()) // Need WIDE prefix ?
      length = 4;
    else
      length = 2;
  }
}
 
Example 9
Source File: LocalVariableInstruction.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Set the local variable index
 */
public void setIndex(int n) {
  if((n < 0) || (n > Constants.MAX_SHORT))
    throw new ClassGenException("Illegal value: " + n);

  this.n = n;

  if(n >= 0 && n <= 3) { // Use more compact instruction xLOAD_n
    opcode = (short)(c_tag + n);
    length = 1;
  } else {
    opcode = canon_tag;

    if(wide()) // Need WIDE prefix ?
      length = 4;
    else
      length = 2;
  }
}
 
Example 10
Source File: LocalVariableInstruction.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Set the local variable index
 */
public void setIndex(int n) {
  if((n < 0) || (n > Constants.MAX_SHORT))
    throw new ClassGenException("Illegal value: " + n);

  this.n = n;

  if(n >= 0 && n <= 3) { // Use more compact instruction xLOAD_n
    opcode = (short)(c_tag + n);
    length = 1;
  } else {
    opcode = canon_tag;

    if(wide()) // Need WIDE prefix ?
      length = 4;
    else
      length = 2;
  }
}
 
Example 11
Source File: LocalVariableGen.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Generate a local variable that with index `index'. Note that double and long
 * variables need two indexs. Index indices have to be provided by the user.
 *
 * @param index index of local variable
 * @param name its name
 * @param type its type
 * @param start from where the instruction is valid (null means from the start)
 * @param end until where the instruction is valid (null means to the end)
 */
public LocalVariableGen(int index, String name, Type type,
                        InstructionHandle start, InstructionHandle end) {
  if((index < 0) || (index > Constants.MAX_SHORT))
    throw new ClassGenException("Invalid index index: " + index);

  this.name  = name;
  this.type  = type;
  this.index  = index;
  setStart(start);
  setEnd(end);
}
 
Example 12
Source File: LocalVariableGen.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
/**
 * Generate a local variable that with index `index'. Note that double and long
 * variables need two indexs. Index indices have to be provided by the user.
 *
 * @param index index of local variable
 * @param name its name
 * @param type its type
 * @param start from where the instruction is valid (null means from the start)
 * @param end until where the instruction is valid (null means to the end)
 */
public LocalVariableGen(int index, String name, Type type,
                        InstructionHandle start, InstructionHandle end) {
  if((index < 0) || (index > Constants.MAX_SHORT))
    throw new ClassGenException("Invalid index index: " + index);

  this.name  = name;
  this.type  = type;
  this.index  = index;
  setStart(start);
  setEnd(end);
}
 
Example 13
Source File: LocalVariableGen.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Generate a local variable that with index `index'. Note that double and long
 * variables need two indexs. Index indices have to be provided by the user.
 *
 * @param index index of local variable
 * @param name its name
 * @param type its type
 * @param start from where the instruction is valid (null means from the start)
 * @param end until where the instruction is valid (null means to the end)
 */
public LocalVariableGen(int index, String name, Type type,
                        InstructionHandle start, InstructionHandle end) {
  if((index < 0) || (index > Constants.MAX_SHORT))
    throw new ClassGenException("Invalid index index: " + index);

  this.name  = name;
  this.type  = type;
  this.index  = index;
  setStart(start);
  setEnd(end);
}
 
Example 14
Source File: LocalVariableGen.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Generate a local variable that with index `index'. Note that double and long
 * variables need two indexs. Index indices have to be provided by the user.
 *
 * @param index index of local variable
 * @param name its name
 * @param type its type
 * @param start from where the instruction is valid (null means from the start)
 * @param end until where the instruction is valid (null means to the end)
 */
public LocalVariableGen(int index, String name, Type type,
                        InstructionHandle start, InstructionHandle end) {
  if((index < 0) || (index > Constants.MAX_SHORT))
    throw new ClassGenException("Invalid index index: " + index);

  this.name  = name;
  this.type  = type;
  this.index  = index;
  setStart(start);
  setEnd(end);
}
 
Example 15
Source File: LocalVariableGen.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Generate a local variable that with index `index'. Note that double and long
 * variables need two indexs. Index indices have to be provided by the user.
 *
 * @param index index of local variable
 * @param name its name
 * @param type its type
 * @param start from where the instruction is valid (null means from the start)
 * @param end until where the instruction is valid (null means to the end)
 */
public LocalVariableGen(int index, String name, Type type,
                        InstructionHandle start, InstructionHandle end) {
  if((index < 0) || (index > Constants.MAX_SHORT))
    throw new ClassGenException("Invalid index index: " + index);

  this.name  = name;
  this.type  = type;
  this.index  = index;
  setStart(start);
  setEnd(end);
}
 
Example 16
Source File: LocalVariableGen.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Generate a local variable that with index `index'. Note that double and long
 * variables need two indexs. Index indices have to be provided by the user.
 *
 * @param index index of local variable
 * @param name its name
 * @param type its type
 * @param start from where the instruction is valid (null means from the start)
 * @param end until where the instruction is valid (null means to the end)
 */
public LocalVariableGen(int index, String name, Type type,
                        InstructionHandle start, InstructionHandle end) {
  if((index < 0) || (index > Constants.MAX_SHORT))
    throw new ClassGenException("Invalid index index: " + index);

  this.name  = name;
  this.type  = type;
  this.index  = index;
  setStart(start);
  setEnd(end);
}
 
Example 17
Source File: LocalVariableGen.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Generate a local variable that with index `index'. Note that double and long
 * variables need two indexs. Index indices have to be provided by the user.
 *
 * @param index index of local variable
 * @param name its name
 * @param type its type
 * @param start from where the instruction is valid (null means from the start)
 * @param end until where the instruction is valid (null means to the end)
 */
public LocalVariableGen(int index, String name, Type type,
                        InstructionHandle start, InstructionHandle end) {
  if((index < 0) || (index > Constants.MAX_SHORT))
    throw new ClassGenException("Invalid index index: " + index);

  this.name  = name;
  this.type  = type;
  this.index  = index;
  setStart(start);
  setEnd(end);
}
 
Example 18
Source File: LocalVariableGen.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Generate a local variable that with index `index'. Note that double and long
 * variables need two indexs. Index indices have to be provided by the user.
 *
 * @param index index of local variable
 * @param name its name
 * @param type its type
 * @param start from where the instruction is valid (null means from the start)
 * @param end until where the instruction is valid (null means to the end)
 */
public LocalVariableGen(int index, String name, Type type,
                        InstructionHandle start, InstructionHandle end) {
  if((index < 0) || (index > Constants.MAX_SHORT))
    throw new ClassGenException("Invalid index index: " + index);

  this.name  = name;
  this.type  = type;
  this.index  = index;
  setStart(start);
  setEnd(end);
}
 
Example 19
Source File: LocalVariableGen.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Generate a local variable that with index `index'. Note that double and long
 * variables need two indexs. Index indices have to be provided by the user.
 *
 * @param index index of local variable
 * @param name its name
 * @param type its type
 * @param start from where the instruction is valid (null means from the start)
 * @param end until where the instruction is valid (null means to the end)
 */
public LocalVariableGen(int index, String name, Type type,
                        InstructionHandle start, InstructionHandle end) {
  if((index < 0) || (index > Constants.MAX_SHORT))
    throw new ClassGenException("Invalid index index: " + index);

  this.name  = name;
  this.type  = type;
  this.index  = index;
  setStart(start);
  setEnd(end);
}
 
Example 20
Source File: LocalVariableGen.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
/**
 * Generate a local variable that with index `index'. Note that double and long
 * variables need two indexs. Index indices have to be provided by the user.
 *
 * @param index index of local variable
 * @param name its name
 * @param type its type
 * @param start from where the instruction is valid (null means from the start)
 * @param end until where the instruction is valid (null means to the end)
 */
public LocalVariableGen(int index, String name, Type type,
                        InstructionHandle start, InstructionHandle end) {
  if((index < 0) || (index > Constants.MAX_SHORT))
    throw new ClassGenException("Invalid index index: " + index);

  this.name  = name;
  this.type  = type;
  this.index  = index;
  setStart(start);
  setEnd(end);
}