|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jikesrvm.classloader.TypeReference
public final class TypeReference
A class to represent the reference in a class file to some type (class, primitive or array). A type reference is uniquely defined by
Constructor Summary | |
---|---|
private |
TypeReference(ClassLoader cl,
Atom tn,
int id)
Constructor |
Method Summary | |
---|---|
private static void |
canonicalizeCL(ClassLoader cl)
|
boolean |
definitelyDifferent(TypeReference that)
Do this and that definitely refer to the different types? |
boolean |
definitelySame(TypeReference that)
Do this and that definitely refer to the same type? |
boolean |
equals(Object other)
Are two keys equivalent? |
static TypeReference |
findOrCreate(Class<?> klass)
Convert a java.lang.Class into a type reference the slow way. |
static TypeReference |
findOrCreate(ClassLoader cl,
Atom tn)
Find or create the canonical TypeReference instance for the given pair. |
static TypeReference |
findOrCreate(String tn)
Shorthand for doing a find or create for a type reference that should be created using the bootstrap classloader. |
static TypeReference |
findOrCreateInternal(ClassLoader cl,
Atom tn)
Find or create the canonical TypeReference instance for the given pair without type descriptor parsing. |
TypeReference |
getArrayElementType()
Get the element type of for this array type |
TypeReference |
getArrayTypeForElementType()
Get array type corresponding to "this" array element type. |
ClassLoader |
getClassLoader()
|
static ImmutableEntryHashSetRVM<ClassLoader> |
getCLDict()
|
int |
getDimensionality()
Return the dimensionality of the type. |
int |
getId()
|
TypeReference |
getInnermostElementType()
Return the innermost element type reference for an array |
int |
getMemoryBytes()
How many bytes do values of this type take? |
Atom |
getName()
|
int |
getStackWords()
How many java stack/local words do value of this type take? |
static TypeReference |
getTypeRef(int id)
Get the canonical type reference given its id. |
int |
hashCode()
Hash value based on name, used for canonical type dictionary |
boolean |
isAddressType()
Does 'this' refer to Address |
boolean |
isArrayType()
Does 'this' refer to an array? |
boolean |
isBooleanType()
Is this the type reference for the boolean primitive type? |
boolean |
isByteType()
Is this the type reference for the byte primitive type? |
boolean |
isCharType()
Is this the type reference for the char primitive type? |
boolean |
isClassType()
Does 'this' refer to a class? |
boolean |
isCodeArrayType()
Does 'this' refer to CodeArray |
boolean |
isCodeType()
Does 'this' refer to Code |
boolean |
isDoubleType()
Is this the type reference for the double primitive type? |
boolean |
isExtentType()
Does 'this' refer to Extent |
boolean |
isFloatType()
Is this the type reference for the float primitive type? |
boolean |
isIntLikeType()
Is this the type reference for an
int-like (1, 8, 16, or 32 bit integral) primitive type? |
boolean |
isIntType()
Is this the type reference for the int primitive type? |
boolean |
isLoaded()
Return true if the type for type reference has been loaded. |
boolean |
isLongType()
Is this the type reference for the long primitive type? |
boolean |
isMagicType()
Does 'this' refer to Magic? |
boolean |
isOffsetType()
Does 'this' refer to Offset |
boolean |
isPrimitiveType()
Does 'this' refer to a primitive type |
boolean |
isReferenceType()
Does 'this' refer to a reference type |
boolean |
isResolved()
Return true if the type for type reference has been loaded and it is resolved. |
boolean |
isRuntimeTable()
Does 'this' refer to a runtime table type? |
boolean |
isShortType()
Is this the type reference for the short primitive type? |
boolean |
isUnboxedArrayType()
Does 'this' refer to WordArray, AddressArray, OffsetArray or ExtentArray |
boolean |
isUnboxedType()
Does 'this' refer to an unboxed type. |
boolean |
isVoidType()
Is this the type reference for the void primitive type? |
boolean |
isWordArrayType()
Does 'this' refer to WordArray, AddressArray, OffsetArray or ExtentArray |
boolean |
isWordLikeType()
Does 'this' refer to Word, Address, Offset or Extent |
boolean |
isWordType()
Does 'this' refer to Word |
RVMType |
peekType()
|
RVMType |
resolve()
Force the resolution of the type reference. |
private RVMType |
resolveInternal()
|
(package private) void |
setType(RVMType rt)
|
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
final ClassLoader classloader
final Atom name
final int id
private RVMType type
private static final ImmutableEntryHashSetRVM<TypeReference> dictionary
private static final ImmutableEntryHashSetRVM<ClassLoader> clDict
private static final int LOG_ROW_SIZE
private static final int ROW_MASK
private static TypeReference[][] types
private static int nextId
RVMClass
).
public static final TypeReference Void
public static final TypeReference Boolean
public static final TypeReference Byte
public static final TypeReference Char
public static final TypeReference Short
public static final TypeReference Int
public static final TypeReference Long
public static final TypeReference Float
public static final TypeReference Double
public static final TypeReference BooleanArray
public static final TypeReference ByteArray
public static final TypeReference CharArray
public static final TypeReference ShortArray
public static final TypeReference IntArray
public static final TypeReference LongArray
public static final TypeReference FloatArray
public static final TypeReference DoubleArray
public static final TypeReference Word
public static final TypeReference Address
public static final TypeReference ObjectReference
public static final TypeReference Offset
public static final TypeReference Extent
public static final TypeReference Code
public static final TypeReference WordArray
public static final TypeReference AddressArray
public static final TypeReference ObjectReferenceArray
public static final TypeReference OffsetArray
public static final TypeReference ExtentArray
public static final TypeReference CodeArray
public static final TypeReference Magic
public static final TypeReference SysCall
public static final TypeReference TIB
public static final TypeReference ITableArray
public static final TypeReference ITable
public static final TypeReference IMT
public static final TypeReference Thread
public static final TypeReference FunctionTable
public static final TypeReference LinkageTripletTable
public static final TypeReference JavaLangObject
public static final TypeReference JavaLangClass
public static final TypeReference JavaLangString
public static final TypeReference JavaLangCloneable
public static final TypeReference JavaIoSerializable
public static final TypeReference JavaLangRefReference
public static final TypeReference JavaLangSystem
public static final TypeReference JavaLangObjectArray
public static final TypeReference JavaLangThrowable
public static final TypeReference JavaLangError
public static final TypeReference JavaLangNullPointerException
public static final TypeReference JavaLangArrayIndexOutOfBoundsException
public static final TypeReference JavaLangArithmeticException
public static final TypeReference JavaLangArrayStoreException
public static final TypeReference JavaLangClassCastException
public static final TypeReference JavaLangNegativeArraySizeException
public static final TypeReference JavaLangIllegalMonitorStateException
public static final TypeReference Type
public static final TypeReference Class
public static final TypeReference NativeBridge
public static final TypeReference DynamicBridge
public static final TypeReference SaveVolatile
public static final TypeReference Interruptible
public static final TypeReference LogicallyUninterruptible
public static final TypeReference Preemptible
public static final TypeReference UninterruptibleNoWarn
public static final TypeReference UnpreemptibleNoWarn
public static final TypeReference Uninterruptible
public static final TypeReference NoCheckStore
public static final TypeReference Unpreemptible
public static final TypeReference SpecializedMethodInvoke
public static final TypeReference Untraced
public static final TypeReference NonMoving
public static final TypeReference NonMovingAllocation
public static final TypeReference BaselineNoRegisters
public static final TypeReference BaselineSaveLSRegisters
public static final TypeReference ReferenceFieldsVary
public static final TypeReference ReferenceMaps
public static final TypeReference JNIFunctions
public static final TypeReference RVMArray
static final TypeReference baseReflectionClass
public static final TypeReference NULL_TYPE
public static final TypeReference VALIDATION_TYPE
public static final TypeReference ExceptionTable
public static final TypeReference OptimizationPlanner
Constructor Detail |
---|
private TypeReference(ClassLoader cl, Atom tn, int id)
cl
- the classloadertn
- the type nameid
- the numeric identifierMethod Detail |
---|
public int hashCode()
hashCode
in class Object
public boolean equals(Object other)
equals
in class Object
public static TypeReference findOrCreate(ClassLoader cl, Atom tn) throws IllegalArgumentException
cl
- the classloader (defining/initiating depending on usage)tn
- the name of the type
IllegalArgumentException
- Needs to throw some kind of error in
the case of a Atom that does not represent a type name.public static TypeReference findOrCreate(String tn)
tn
- type namepublic static TypeReference findOrCreate(Class<?> klass)
klass
- java.lang.Class to convert to type referencepublic static TypeReference findOrCreateInternal(ClassLoader cl, Atom tn)
cl
- the classloader (defining/initiating depending on usage)tn
- the name of the typeprivate static void canonicalizeCL(ClassLoader cl)
public static ImmutableEntryHashSetRVM<ClassLoader> getCLDict()
public static TypeReference getTypeRef(int id)
id
- the type references id
public ClassLoader getClassLoader()
public Atom getName()
public TypeReference getArrayElementType()
public TypeReference getArrayTypeForElementType()
public int getDimensionality()
public TypeReference getInnermostElementType()
public boolean isClassType()
public boolean isArrayType()
public boolean isPrimitiveType()
public boolean isReferenceType()
public boolean isWordLikeType()
public boolean isWordType()
public boolean isAddressType()
public boolean isOffsetType()
public boolean isExtentType()
public boolean isUnboxedType()
public boolean isCodeType()
public boolean isWordArrayType()
public boolean isUnboxedArrayType()
public boolean isRuntimeTable()
public boolean isCodeArrayType()
public boolean isMagicType()
public int getStackWords()
public int getMemoryBytes()
public int getId()
public boolean isVoidType()
public boolean isBooleanType()
public boolean isByteType()
public boolean isShortType()
public boolean isCharType()
public boolean isIntType()
public boolean isLongType()
public boolean isFloatType()
public boolean isDoubleType()
public boolean isIntLikeType()
this
the type reference for an
int-like (1, 8, 16, or 32 bit integral) primitive type?
public boolean definitelyDifferent(TypeReference that)
public boolean definitelySame(TypeReference that)
this
and that definitely refer to the same type?
public boolean isLoaded()
public boolean isResolved()
public RVMType peekType()
void setType(RVMType rt)
public RVMType resolve() throws NoClassDefFoundError, IllegalArgumentException
NoClassDefFoundError
- When it cannot resolve a class.
we go to the trouble of converting the class loader's
ClassNotFoundException
into this error,
since we need to be able to throw
NoClassDefFoundError
for classes
that we're loading whose existence was compile-time checked.
IllegalArgumentException
- In case of a malformed class name
(should never happen, since the right thing to do is probably to
validate them as soon as we insert them into a TypeReference.
This stinks. XXX)private RVMType resolveInternal() throws NoClassDefFoundError, IllegalArgumentException
NoClassDefFoundError
IllegalArgumentException
public String toString()
toString
in class Object
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |