org.jikesrvm.classloader
Class RVMMember

java.lang.Object
  extended by org.jikesrvm.classloader.AnnotatedElement
      extended by org.jikesrvm.classloader.RVMMember
All Implemented Interfaces:
AnnotatedElement, ClassLoaderConstants, Constants, HeapLayoutConstants, ThinLockConstants, TIBLayoutConstants, SizeConstants
Direct Known Subclasses:
RVMField, RVMMethod

public abstract class RVMMember
extends AnnotatedElement
implements Constants, ClassLoaderConstants

A field or method of a java class.


Field Summary
private  TypeReference declaringClass
          The class that declared this member, available by calling getDeclaringClass once the class is loaded.
protected  MemberReference memRef
          The canonical MemberReference for this member
protected  short modifiers
          The modifiers associated with this member.
private static int NO_OFFSET
          Initial value for a field offset - indicates field not laid out.
protected  int offset
          The member's jtoc/obj/tib offset in bytes.
private  Atom signature
          The signature is a string representing the generic type for this field or method declaration, may be null
 
Fields inherited from class org.jikesrvm.classloader.AnnotatedElement
declaredAnnotationDatas
 
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.SizeConstants
BITS_IN_ADDRESS, BITS_IN_BOOLEAN, BITS_IN_BYTE, BITS_IN_CHAR, BITS_IN_DOUBLE, BITS_IN_EXTENT, BITS_IN_FLOAT, BITS_IN_INT, BITS_IN_LONG, BITS_IN_OFFSET, BITS_IN_PAGE, BITS_IN_SHORT, BITS_IN_WORD, BYTES_IN_ADDRESS, BYTES_IN_BOOLEAN, BYTES_IN_BYTE, BYTES_IN_CHAR, BYTES_IN_DOUBLE, BYTES_IN_EXTENT, BYTES_IN_FLOAT, BYTES_IN_INT, BYTES_IN_LONG, BYTES_IN_OFFSET, BYTES_IN_PAGE, BYTES_IN_SHORT, BYTES_IN_WORD, LOG_BITS_IN_ADDRESS, LOG_BITS_IN_BOOLEAN, LOG_BITS_IN_BYTE, LOG_BITS_IN_CHAR, LOG_BITS_IN_DOUBLE, LOG_BITS_IN_EXTENT, LOG_BITS_IN_FLOAT, LOG_BITS_IN_INT, LOG_BITS_IN_LONG, LOG_BITS_IN_OFFSET, LOG_BITS_IN_PAGE, LOG_BITS_IN_SHORT, LOG_BITS_IN_WORD, LOG_BYTES_IN_ADDRESS, LOG_BYTES_IN_BOOLEAN, LOG_BYTES_IN_BYTE, LOG_BYTES_IN_CHAR, LOG_BYTES_IN_DOUBLE, LOG_BYTES_IN_EXTENT, LOG_BYTES_IN_FLOAT, LOG_BYTES_IN_INT, LOG_BYTES_IN_LONG, LOG_BYTES_IN_OFFSET, LOG_BYTES_IN_PAGE, LOG_BYTES_IN_SHORT, LOG_BYTES_IN_WORD
 
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
 
Fields inherited from interface org.jikesrvm.classloader.ClassLoaderConstants
ACC_ABSTRACT, ACC_ANNOTATION, ACC_ENUM, ACC_FINAL, ACC_INTERFACE, ACC_NATIVE, ACC_PRIVATE, ACC_PROTECTED, ACC_PUBLIC, ACC_STATIC, ACC_STRICT, ACC_SUPER, ACC_SYNCHRONIZED, ACC_SYNTHETIC, ACC_TRANSIENT, ACC_VOLATILE, APPLICABLE_TO_CLASSES, APPLICABLE_TO_FIELDS, APPLICABLE_TO_METHODS, ArrayTypeCode, BooleanTypeCode, BRIDGE, ByteTypeCode, CharTypeCode, CLASS_INITIALIZED, CLASS_INITIALIZER_FAILED, CLASS_INITIALIZING, CLASS_INSTANTIATED, CLASS_LOADED, CLASS_RESOLVED, CLASS_VACANT, ClassTypeCode, CP_CLASS, CP_DOUBLE, CP_FLOAT, CP_INT, CP_LONG, CP_MEMBER, CP_STRING, CP_UTF, DoubleTypeCode, FloatTypeCode, IntTypeCode, LongTypeCode, ShortTypeCode, TAG_DOUBLE, TAG_FIELDREF, TAG_FLOAT, TAG_INT, TAG_INTERFACE_METHODREF, TAG_LONG, TAG_MEMBERNAME_AND_DESCRIPTOR, TAG_METHODREF, TAG_STRING, TAG_TYPEREF, TAG_UNUSED, TAG_UTF, VARARGS, VoidTypeCode
 
Constructor Summary
protected RVMMember(TypeReference declaringClass, MemberReference memRef, short modifiers, Atom signature, RVMAnnotation[] annotations)
          NOTE: Only RVMClass is allowed to create an instance of a RVMMember.
 
Method Summary
 RVMClass getDeclaringClass()
          Class that declared this field or method.
 Atom getDescriptor()
          Descriptor for this member.
 int getId()
          Get a unique id for this member.
 MemberReference getMemberRef()
          Canonical member reference for this member.
 int getModifiers()
          Get the member's modifiers.
 Atom getName()
          Name of this member.
 Offset getOffset()
          Offset of this field or method, in bytes.
 Atom getSignature()
          Generic type for member
 int hashCode()
           
 boolean hasOffset()
          Has the field been laid out in the object yet ?
 boolean isPrivate()
          Usable only from this class?
 boolean isProtected()
          Usable from subclasses?
 boolean isPublic()
          Usable from classes outside its package?
 void setOffset(Offset off)
          Only meant to be used by ObjectModel.layoutInstanceFields.
 String toString()
           
 
Methods inherited from class org.jikesrvm.classloader.AnnotatedElement
getAnnotation, getAnnotations, getAnnotationsInternal, getDeclaredAnnotations, getDeclaredAnnotationsInternal, hasAnnotations, hasBaselineNoRegistersAnnotation, hasBaselineSaveLSRegistersAnnotation, hasInlineAnnotation, hasInterruptibleAnnotation, hasLogicallyUninterruptibleAnnotation, hasNoBoundsCheckAnnotation, hasNoCheckStoreAnnotation, hasNoEscapesAnnotation, hasNoInlineAnnotation, hasNonMovingAllocationAnnotation, hasNonMovingAnnotation, hasNoNullCheckAnnotation, hasNoOptCompileAnnotation, hasPreemptibleAnnotation, hasPureAnnotation, hasRuntimeFinalAnnotation, hasRuntimePureAnnotation, hasUninterruptibleAnnotation, hasUninterruptibleNoWarnAnnotation, hasUnpreemptibleAnnotation, hasUnpreemptibleNoWarnAnnotation, hasUntracedAnnotation, isAnnotationDeclared, isAnnotationPresent, readAnnotations, toAnnotations
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

NO_OFFSET

private static final int NO_OFFSET
Initial value for a field offset - indicates field not laid out.

See Also:
Constant Field Values

declaringClass

private final TypeReference declaringClass
The class that declared this member, available by calling getDeclaringClass once the class is loaded.


memRef

protected final MemberReference memRef
The canonical MemberReference for this member


modifiers

protected final short modifiers
The modifiers associated with this member.


signature

private final Atom signature
The signature is a string representing the generic type for this field or method declaration, may be null


offset

protected int offset
The member's jtoc/obj/tib offset in bytes. Set by RVMClass.resolve()

Constructor Detail

RVMMember

protected RVMMember(TypeReference declaringClass,
                    MemberReference memRef,
                    short modifiers,
                    Atom signature,
                    RVMAnnotation[] annotations)
NOTE: Only RVMClass is allowed to create an instance of a RVMMember.

Parameters:
declaringClass - the TypeReference object of the class that declared this member
memRef - the canonical memberReference for this member.
modifiers - modifiers associated with this member.
signature - generic type of this member
annotations - array of runtime visible annotations
Method Detail

getDeclaringClass

public final RVMClass getDeclaringClass()
Class that declared this field or method. Not available before the class is loaded.


getMemberRef

public final MemberReference getMemberRef()
Canonical member reference for this member.


getName

public final Atom getName()
Name of this member.


getDescriptor

public final Atom getDescriptor()
Descriptor for this member. something like "I" for a field or "(I)V" for a method.


getSignature

public final Atom getSignature()
Generic type for member


getId

public final int getId()
Get a unique id for this member. The id is the id of the canonical MemberReference for this member and thus may be used to find the member by first finding the member reference.


hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public final String toString()
Overrides:
toString in class Object

isPublic

public final boolean isPublic()
Usable from classes outside its package?


isPrivate

public final boolean isPrivate()
Usable only from this class?


isProtected

public final boolean isProtected()
Usable from subclasses?


getModifiers

public final int getModifiers()
Get the member's modifiers.


hasOffset

public final boolean hasOffset()
Has the field been laid out in the object yet ?

Returns:
true if the field has been assigned an offset, false if not

getOffset

public final Offset getOffset()
Offset of this field or method, in bytes.


setOffset

public final void setOffset(Offset off)
Only meant to be used by ObjectModel.layoutInstanceFields. TODO: refactor system so this functionality is in the classloader package and this method doesn't have to be final.