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

The following examples show how to use com.sun.org.apache.bcel.internal.Constants#T_OBJECT . 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: InstructionFactory.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
/**
 * @param index index of local variable
 */
public static LocalVariableInstruction createStore(Type type, int index) {
  switch(type.getType()) {
  case Constants.T_BOOLEAN:
  case Constants.T_CHAR:
  case Constants.T_BYTE:
  case Constants.T_SHORT:
  case Constants.T_INT:    return new ISTORE(index);
  case Constants.T_FLOAT:  return new FSTORE(index);
  case Constants.T_DOUBLE: return new DSTORE(index);
  case Constants.T_LONG:   return new LSTORE(index);
  case Constants.T_ARRAY:
  case Constants.T_OBJECT: return new ASTORE(index);
  default:       throw new RuntimeException("Invalid type " + type);
  }
}
 
Example 2
Source File: InstructionFactory.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/** Create typed return
 */
public static ReturnInstruction createReturn(Type type) {
  switch(type.getType()) {
  case Constants.T_ARRAY:
  case Constants.T_OBJECT:  return ARETURN;
  case Constants.T_INT:
  case Constants.T_SHORT:
  case Constants.T_BOOLEAN:
  case Constants.T_CHAR:
  case Constants.T_BYTE:    return IRETURN;
  case Constants.T_FLOAT:   return FRETURN;
  case Constants.T_DOUBLE:  return DRETURN;
  case Constants.T_LONG:    return LRETURN;
  case Constants.T_VOID:    return RETURN;

  default:
    throw new RuntimeException("Invalid type: " + type);
  }
}
 
Example 3
Source File: InstructionFactory.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/** Create typed return
 */
public static ReturnInstruction createReturn(Type type) {
  switch(type.getType()) {
  case Constants.T_ARRAY:
  case Constants.T_OBJECT:  return ARETURN;
  case Constants.T_INT:
  case Constants.T_SHORT:
  case Constants.T_BOOLEAN:
  case Constants.T_CHAR:
  case Constants.T_BYTE:    return IRETURN;
  case Constants.T_FLOAT:   return FRETURN;
  case Constants.T_DOUBLE:  return DRETURN;
  case Constants.T_LONG:    return LRETURN;
  case Constants.T_VOID:    return RETURN;

  default:
    throw new RuntimeException("Invalid type: " + type);
  }
}
 
Example 4
Source File: InstructionFactory.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * @param index index of local variable
 */
public static LocalVariableInstruction createLoad(Type type, int index) {
  switch(type.getType()) {
  case Constants.T_BOOLEAN:
  case Constants.T_CHAR:
  case Constants.T_BYTE:
  case Constants.T_SHORT:
  case Constants.T_INT:    return new ILOAD(index);
  case Constants.T_FLOAT:  return new FLOAD(index);
  case Constants.T_DOUBLE: return new DLOAD(index);
  case Constants.T_LONG:   return new LLOAD(index);
  case Constants.T_ARRAY:
  case Constants.T_OBJECT: return new ALOAD(index);
  default:       throw new RuntimeException("Invalid type " + type);
  }
}
 
Example 5
Source File: InstructionFactory.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * @param index index of local variable
 */
public static LocalVariableInstruction createLoad(Type type, int index) {
  switch(type.getType()) {
  case Constants.T_BOOLEAN:
  case Constants.T_CHAR:
  case Constants.T_BYTE:
  case Constants.T_SHORT:
  case Constants.T_INT:    return new ILOAD(index);
  case Constants.T_FLOAT:  return new FLOAD(index);
  case Constants.T_DOUBLE: return new DLOAD(index);
  case Constants.T_LONG:   return new LLOAD(index);
  case Constants.T_ARRAY:
  case Constants.T_OBJECT: return new ALOAD(index);
  default:       throw new RuntimeException("Invalid type " + type);
  }
}
 
Example 6
Source File: InstructionFactory.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * @param type type of elements of array, i.e., array.getElementType()
 */
public static ArrayInstruction createArrayStore(Type type) {
  switch(type.getType()) {
  case Constants.T_BOOLEAN:
  case Constants.T_BYTE:   return BASTORE;
  case Constants.T_CHAR:   return CASTORE;
  case Constants.T_SHORT:  return SASTORE;
  case Constants.T_INT:    return IASTORE;
  case Constants.T_FLOAT:  return FASTORE;
  case Constants.T_DOUBLE: return DASTORE;
  case Constants.T_LONG:   return LASTORE;
  case Constants.T_ARRAY:
  case Constants.T_OBJECT: return AASTORE;
  default:       throw new RuntimeException("Invalid type " + type);
  }
}
 
Example 7
Source File: InstructionFactory.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * @param type type of elements of array, i.e., array.getElementType()
 */
public static ArrayInstruction createArrayLoad(Type type) {
  switch(type.getType()) {
  case Constants.T_BOOLEAN:
  case Constants.T_BYTE:   return BALOAD;
  case Constants.T_CHAR:   return CALOAD;
  case Constants.T_SHORT:  return SALOAD;
  case Constants.T_INT:    return IALOAD;
  case Constants.T_FLOAT:  return FALOAD;
  case Constants.T_DOUBLE: return DALOAD;
  case Constants.T_LONG:   return LALOAD;
  case Constants.T_ARRAY:
  case Constants.T_OBJECT: return AALOAD;
  default:       throw new RuntimeException("Invalid type " + type);
  }
}
 
Example 8
Source File: InstructionFactory.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/** Create typed return
 */
public static ReturnInstruction createReturn(Type type) {
  switch(type.getType()) {
  case Constants.T_ARRAY:
  case Constants.T_OBJECT:  return ARETURN;
  case Constants.T_INT:
  case Constants.T_SHORT:
  case Constants.T_BOOLEAN:
  case Constants.T_CHAR:
  case Constants.T_BYTE:    return IRETURN;
  case Constants.T_FLOAT:   return FRETURN;
  case Constants.T_DOUBLE:  return DRETURN;
  case Constants.T_LONG:    return LRETURN;
  case Constants.T_VOID:    return RETURN;

  default:
    throw new RuntimeException("Invalid type: " + type);
  }
}
 
Example 9
Source File: InstructionFactory.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * @param index index of local variable
 */
public static LocalVariableInstruction createStore(Type type, int index) {
  switch(type.getType()) {
  case Constants.T_BOOLEAN:
  case Constants.T_CHAR:
  case Constants.T_BYTE:
  case Constants.T_SHORT:
  case Constants.T_INT:    return new ISTORE(index);
  case Constants.T_FLOAT:  return new FSTORE(index);
  case Constants.T_DOUBLE: return new DSTORE(index);
  case Constants.T_LONG:   return new LSTORE(index);
  case Constants.T_ARRAY:
  case Constants.T_OBJECT: return new ASTORE(index);
  default:       throw new RuntimeException("Invalid type " + type);
  }
}
 
Example 10
Source File: InstructionFactory.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
/** Create typed return
 */
public static ReturnInstruction createReturn(Type type) {
  switch(type.getType()) {
  case Constants.T_ARRAY:
  case Constants.T_OBJECT:  return ARETURN;
  case Constants.T_INT:
  case Constants.T_SHORT:
  case Constants.T_BOOLEAN:
  case Constants.T_CHAR:
  case Constants.T_BYTE:    return IRETURN;
  case Constants.T_FLOAT:   return FRETURN;
  case Constants.T_DOUBLE:  return DRETURN;
  case Constants.T_LONG:    return LRETURN;
  case Constants.T_VOID:    return RETURN;

  default:
    throw new RuntimeException("Invalid type: " + type);
  }
}
 
Example 11
Source File: InstructionFactory.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * @param index index of local variable
 */
public static LocalVariableInstruction createStore(Type type, int index) {
  switch(type.getType()) {
  case Constants.T_BOOLEAN:
  case Constants.T_CHAR:
  case Constants.T_BYTE:
  case Constants.T_SHORT:
  case Constants.T_INT:    return new ISTORE(index);
  case Constants.T_FLOAT:  return new FSTORE(index);
  case Constants.T_DOUBLE: return new DSTORE(index);
  case Constants.T_LONG:   return new LSTORE(index);
  case Constants.T_ARRAY:
  case Constants.T_OBJECT: return new ASTORE(index);
  default:       throw new RuntimeException("Invalid type " + type);
  }
}
 
Example 12
Source File: InstructionFactory.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
/**
 * @param type type of elements of array, i.e., array.getElementType()
 */
public static ArrayInstruction createArrayStore(Type type) {
  switch(type.getType()) {
  case Constants.T_BOOLEAN:
  case Constants.T_BYTE:   return BASTORE;
  case Constants.T_CHAR:   return CASTORE;
  case Constants.T_SHORT:  return SASTORE;
  case Constants.T_INT:    return IASTORE;
  case Constants.T_FLOAT:  return FASTORE;
  case Constants.T_DOUBLE: return DASTORE;
  case Constants.T_LONG:   return LASTORE;
  case Constants.T_ARRAY:
  case Constants.T_OBJECT: return AASTORE;
  default:       throw new RuntimeException("Invalid type " + type);
  }
}
 
Example 13
Source File: InstructionFactory.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 * @param index index of local variable
 */
public static LocalVariableInstruction createLoad(Type type, int index) {
  switch(type.getType()) {
  case Constants.T_BOOLEAN:
  case Constants.T_CHAR:
  case Constants.T_BYTE:
  case Constants.T_SHORT:
  case Constants.T_INT:    return new ILOAD(index);
  case Constants.T_FLOAT:  return new FLOAD(index);
  case Constants.T_DOUBLE: return new DLOAD(index);
  case Constants.T_LONG:   return new LLOAD(index);
  case Constants.T_ARRAY:
  case Constants.T_OBJECT: return new ALOAD(index);
  default:       throw new RuntimeException("Invalid type " + type);
  }
}
 
Example 14
Source File: InstructionFactory.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/** Create "null" value for reference types, 0 for basic types like int
 */
public static Instruction createNull(Type type) {
  switch(type.getType()) {
  case Constants.T_ARRAY:
  case Constants.T_OBJECT:  return ACONST_NULL;
  case Constants.T_INT:
  case Constants.T_SHORT:
  case Constants.T_BOOLEAN:
  case Constants.T_CHAR:
  case Constants.T_BYTE:    return ICONST_0;
  case Constants.T_FLOAT:   return FCONST_0;
  case Constants.T_DOUBLE:  return DCONST_0;
  case Constants.T_LONG:    return LCONST_0;
  case Constants.T_VOID:    return NOP;

  default:
    throw new RuntimeException("Invalid type: " + type);
  }
}
 
Example 15
Source File: InstructionFactory.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * @param type type of elements of array, i.e., array.getElementType()
 */
public static ArrayInstruction createArrayStore(Type type) {
  switch(type.getType()) {
  case Constants.T_BOOLEAN:
  case Constants.T_BYTE:   return BASTORE;
  case Constants.T_CHAR:   return CASTORE;
  case Constants.T_SHORT:  return SASTORE;
  case Constants.T_INT:    return IASTORE;
  case Constants.T_FLOAT:  return FASTORE;
  case Constants.T_DOUBLE: return DASTORE;
  case Constants.T_LONG:   return LASTORE;
  case Constants.T_ARRAY:
  case Constants.T_OBJECT: return AASTORE;
  default:       throw new RuntimeException("Invalid type " + type);
  }
}
 
Example 16
Source File: InstructionFactory.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * @param index index of local variable
 */
public static LocalVariableInstruction createStore(Type type, int index) {
  switch(type.getType()) {
  case Constants.T_BOOLEAN:
  case Constants.T_CHAR:
  case Constants.T_BYTE:
  case Constants.T_SHORT:
  case Constants.T_INT:    return new ISTORE(index);
  case Constants.T_FLOAT:  return new FSTORE(index);
  case Constants.T_DOUBLE: return new DSTORE(index);
  case Constants.T_LONG:   return new LSTORE(index);
  case Constants.T_ARRAY:
  case Constants.T_OBJECT: return new ASTORE(index);
  default:       throw new RuntimeException("Invalid type " + type);
  }
}
 
Example 17
Source File: ReferenceType.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
/** Class is non-abstract but not instantiable from the outside
 */
ReferenceType() {
  super(Constants.T_OBJECT, "<null object>");
}
 
Example 18
Source File: ReferenceType.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
/** Class is non-abstract but not instantiable from the outside
 */
ReferenceType() {
  super(Constants.T_OBJECT, "<null object>");
}
 
Example 19
Source File: ReferenceType.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
/** Class is non-abstract but not instantiable from the outside
 */
ReferenceType() {
  super(Constants.T_OBJECT, "<null object>");
}
 
Example 20
Source File: ReferenceType.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
/** Class is non-abstract but not instantiable from the outside
 */
ReferenceType() {
  super(Constants.T_OBJECT, "<null object>");
}