|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jikesrvm.classloader.ClassFileReader
public class ClassFileReader
Support code to parse a DataInputStream in the Java classfile format and create the appropriate instance of an RVMClass or UnboxedType. Also low-level support for our internal constant pool format.
Field Summary |
---|
Fields inherited from interface org.jikesrvm.Constants |
---|
NOT_REACHED, REFLECTION_FPRS_BITS, REFLECTION_FPRS_MASK, REFLECTION_GPRS_BITS, REFLECTION_GPRS_MASK |
Fields inherited from interface org.jikesrvm.objectmodel.ThinLockConstants |
---|
TL_DEDICATED_U16_OFFSET, TL_DEDICATED_U16_SHIFT, TL_LOCK_COUNT_MASK, TL_LOCK_COUNT_SHIFT, TL_LOCK_COUNT_UNIT, TL_LOCK_ID_MASK, TL_LOCK_ID_SHIFT, TL_NUM_BITS_RC, TL_NUM_BITS_STAT, TL_NUM_BITS_TID, TL_STAT_BIASABLE, TL_STAT_FAT, TL_STAT_MASK, TL_STAT_SHIFT, TL_STAT_THIN, TL_THREAD_ID_MASK, TL_THREAD_ID_SHIFT, TL_UNLOCK_MASK |
Fields inherited from interface org.jikesrvm.objectmodel.TIBLayoutConstants |
---|
IMT_METHOD_SLOTS, NEEDS_DYNAMIC_LINK, TIB_ARRAY_ELEMENT_TIB_INDEX, TIB_DOES_IMPLEMENT_INDEX, TIB_FIRST_SPECIALIZED_METHOD_INDEX, TIB_FIRST_VIRTUAL_METHOD_INDEX, TIB_INTERFACE_DISPATCH_TABLE_INDEX, TIB_SUPERCLASS_IDS_INDEX, TIB_TYPE_INDEX |
Fields inherited from interface org.jikesrvm.HeapLayoutConstants |
---|
BAD_MAP_COMPRESSION, BOOT_IMAGE_CODE_END, BOOT_IMAGE_CODE_SIZE, BOOT_IMAGE_CODE_START, BOOT_IMAGE_DATA_END, BOOT_IMAGE_DATA_SIZE, BOOT_IMAGE_DATA_START, BOOT_IMAGE_END, BOOT_IMAGE_RMAP_END, BOOT_IMAGE_RMAP_START, MAX_BOOT_IMAGE_RMAP_SIZE, MAXIMUM_MAPPABLE |
Constructor Summary | |
---|---|
ClassFileReader()
|
Method Summary | |
---|---|
(package private) static RVMMethod |
getClassInitializerMethod(RVMMethod[] declaredMethods)
Return the class initializer method among the declared methods of the class |
(package private) static FieldReference |
getFieldRef(int[] constantPool,
int constantPoolIndex)
Get contents of a "methodRef" constant pool entry. |
(package private) static byte |
getLiteralDescription(int[] constantPool,
int constantPoolIndex)
Get description of a literal constant. |
(package private) static Offset |
getLiteralOffset(int[] constantPool,
int constantPoolIndex)
Get offset of a literal constant, in bytes. |
(package private) static int |
getLiteralSize(int[] constantPool,
int constantPoolIndex)
|
(package private) static MethodReference |
getMethodRef(int[] constantPool,
int constantPoolIndex)
Get contents of a "methodRef" constant pool entry. |
(package private) static TypeReference |
getTypeRef(int[] constantPool,
int constantPoolIndex)
Get contents of a "typeRef" constant pool entry. |
(package private) static Atom |
getUtf(int[] constantPool,
int constantPoolIndex)
Get contents of a "utf" from a constant pool entry. |
(package private) static int |
packCPEntry(byte type,
int value)
|
(package private) static boolean |
packedCPTypeIsClassType(int cpValue)
|
(package private) static int |
packTempCPEntry(int index1,
int index2)
|
(package private) static RVMClass |
readClass(TypeReference typeRef,
DataInputStream input)
Create an instance of a RVMClass. |
(package private) static int[] |
readConstantPool(TypeReference typeRef,
DataInputStream input)
Parse and return the constant pool in a class file |
(package private) static RVMField[] |
readDeclaredFields(TypeReference typeRef,
DataInputStream input,
int[] constantPool)
Read the declared fields of the class being read |
(package private) static RVMClass[] |
readDeclaredInterfaces(DataInputStream input,
int[] constantPool)
Read the list of interfaces implemented by the class being read |
(package private) static RVMMethod[] |
readDeclaredMethods(TypeReference typeRef,
DataInputStream input,
int[] constantPool)
Read the declared methods of the class being read |
(package private) static RVMClass |
readSuperClass(DataInputStream input,
int[] constantPool,
short modifiers)
Read the super class name, load and resolve the super class |
(package private) static int |
readTypeRef(TypeReference typeRef,
DataInputStream input,
int[] constantPool)
Read the class' TypeReference |
(package private) static byte |
unpackCPType(int cpValue)
|
(package private) static int |
unpackSignedCPValue(int cpValue)
|
(package private) static int |
unpackTempCPIndex1(int cpValue)
|
(package private) static int |
unpackTempCPIndex2(int cpValue)
|
(package private) static int |
unpackUnsignedCPValue(int cpValue)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ClassFileReader()
Method Detail |
---|
static int[] readConstantPool(TypeReference typeRef, DataInputStream input) throws ClassFormatError, IOException
typeRef
- the canonical type reference for this type.input
- the data stream from which to read the class's description.
ClassFormatError
IOException
static int readTypeRef(TypeReference typeRef, DataInputStream input, int[] constantPool) throws IOException, ClassFormatError
typeRef
- input
- constantPool
-
IOException
ClassFormatError
static RVMClass readSuperClass(DataInputStream input, int[] constantPool, short modifiers) throws IOException, NoClassDefFoundError
input
- constantPool
- modifiers
-
IOException
NoClassDefFoundError
static RVMClass[] readDeclaredInterfaces(DataInputStream input, int[] constantPool) throws IOException, NoClassDefFoundError
input
- constantPool
-
IOException
NoClassDefFoundError
static RVMField[] readDeclaredFields(TypeReference typeRef, DataInputStream input, int[] constantPool) throws IOException
typeRef
- input
- constantPool
-
IOException
static RVMMethod[] readDeclaredMethods(TypeReference typeRef, DataInputStream input, int[] constantPool) throws IOException
typeRef
- input
- constantPool
-
IOException
static RVMMethod getClassInitializerMethod(RVMMethod[] declaredMethods)
declaredMethods
-
static RVMClass readClass(TypeReference typeRef, DataInputStream input) throws ClassFormatError, IOException
typeRef
- the canonical type reference for this type.input
- the data stream from which to read the class's description.
ClassFormatError
IOException
static int packCPEntry(byte type, int value)
static byte unpackCPType(int cpValue)
static int unpackSignedCPValue(int cpValue)
static int unpackUnsignedCPValue(int cpValue)
static boolean packedCPTypeIsClassType(int cpValue)
static int packTempCPEntry(int index1, int index2)
static int unpackTempCPIndex1(int cpValue)
static int unpackTempCPIndex2(int cpValue)
static int getLiteralSize(int[] constantPool, int constantPoolIndex)
static Offset getLiteralOffset(int[] constantPool, int constantPoolIndex)
static byte getLiteralDescription(int[] constantPool, int constantPoolIndex)
static TypeReference getTypeRef(int[] constantPool, int constantPoolIndex)
static MethodReference getMethodRef(int[] constantPool, int constantPoolIndex)
static FieldReference getFieldRef(int[] constantPool, int constantPoolIndex)
static Atom getUtf(int[] constantPool, int constantPoolIndex)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |