Class TypeInfo
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final int
(package private) static final int
(package private) static final int
(package private) static final int
(package private) static final int
(package private) static final int
(package private) static final int
(package private) static final int
(package private) static final int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static final int
fromType
(String type, ConstantPool pool) Create type information from an internal type.private static Class<?>
getClassFromInternalName
(String internalName) Take an internal name and return a java.lang.Class instance that represents it.(package private) static final int
getPayload
(int typeInfo) (package private) static final String
getPayloadAsType
(int typeInfo, ConstantPool pool) Treat the result of getPayload as a constant pool index and fetch the corresponding String mapped to it.(package private) static final int
getTag
(int typeInfo) (package private) static boolean
isTwoWords
(int type) (package private) static int
merge
(int current, int incoming, ConstantPool pool) Merge two verification types.(package private) static final int
OBJECT
(int constantPoolIndex) (package private) static final int
OBJECT
(String type, ConstantPool pool) (package private) static void
print
(int[] locals, int[] stack, ConstantPool pool) (package private) static void
print
(int[] locals, int localsTop, int[] stack, int stackTop, ConstantPool pool) private static String
toString
(int[] types, int typesTop, ConstantPool pool) (package private) static String
toString
(int type, ConstantPool pool) (package private) static final int
UNINITIALIZED_VARIABLE
(int bytecodeOffset)
-
Field Details
-
TOP
static final int TOP- See Also:
-
INTEGER
static final int INTEGER- See Also:
-
FLOAT
static final int FLOAT- See Also:
-
DOUBLE
static final int DOUBLE- See Also:
-
LONG
static final int LONG- See Also:
-
NULL
static final int NULL- See Also:
-
UNINITIALIZED_THIS
static final int UNINITIALIZED_THIS- See Also:
-
OBJECT_TAG
static final int OBJECT_TAG- See Also:
-
UNINITIALIZED_VAR_TAG
static final int UNINITIALIZED_VAR_TAG- See Also:
-
-
Constructor Details
-
TypeInfo
private TypeInfo()
-
-
Method Details
-
OBJECT
static final int OBJECT(int constantPoolIndex) -
OBJECT
-
UNINITIALIZED_VARIABLE
static final int UNINITIALIZED_VARIABLE(int bytecodeOffset) -
getTag
static final int getTag(int typeInfo) -
getPayload
static final int getPayload(int typeInfo) -
getPayloadAsType
Treat the result of getPayload as a constant pool index and fetch the corresponding String mapped to it.Only works on OBJECT types.
-
fromType
Create type information from an internal type. -
isTwoWords
static boolean isTwoWords(int type) -
merge
Merge two verification types.In most cases, the verification types must be the same. For example, INTEGER and DOUBLE cannot be merged and an exception will be thrown. The basic rules are:
- If the types are equal, simply return one. - If either type is TOP, return TOP. - If either type is NULL, return the other type. - If both types are objects, find the lowest common ancestor in the class hierarchy.
This method uses reflection to traverse the class hierarchy. Therefore, it is assumed that the current class being generated is never the target of a full object-object merge, which would need to load the current class reflectively.
-
toString
-
getClassFromInternalName
Take an internal name and return a java.lang.Class instance that represents it.For example, given "java/lang/Object", returns the equivalent of Class.forName("java.lang.Object"), but also handles exceptions.
-
toString
-
print
-
print
-