org.jikesrvm.classloader
Class FieldReference

java.lang.Object
  extended by org.jikesrvm.classloader.MemberReference
      extended by org.jikesrvm.classloader.FieldReference
All Implemented Interfaces:
SizeConstants

public final class FieldReference
extends MemberReference
implements SizeConstants

A class to represent the reference in a class file to a field.


Field Summary
private  TypeReference fieldContentsType
          The field's type
private  RVMField resolvedMember
          The RVMField that this field reference resolved to (null if not yet resolved).
 
Fields inherited from class org.jikesrvm.classloader.MemberReference
descriptor, id, name, type
 
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
 
Constructor Summary
FieldReference(TypeReference tr, Atom mn, Atom d, int id)
           
 
Method Summary
 boolean definitelyDifferent(FieldReference that)
          Do this and that definitely refer to the different fields?
 boolean definitelySame(FieldReference that)
          Do this and that definitely refer to the same field?
 TypeReference getFieldContentsType()
           
 int getNumberOfStackSlots()
          How many stackslots do value of this type take?
 int getSize()
          Get size of the field's value, in bytes.
 boolean isResolved()
          Has the field reference already been resolved into a target method?
 RVMField peekResolvedField()
          Find the RVMField that this field reference refers to using the search order specified in JVM spec 5.4.3.2.
 RVMField resolve()
          Find the RVMField that this field reference refers to using the search order specified in JVM spec 5.4.3.2.
private  RVMField resolveInternal(RVMClass declaringClass)
           
private  RVMField searchInterfaceFields(RVMClass c)
           
(package private)  void setResolvedMember(RVMField it)
          For use by RVMField constructor
 
Methods inherited from class org.jikesrvm.classloader.MemberReference
asFieldReference, asMethodReference, equals, findOrCreate, getDescriptor, getId, getMemberRef, getName, getNextId, getType, hashCode, isFieldReference, isMethodReference, needsDynamicLink, parse, parse, peekResolvedMember, resolveMember, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

fieldContentsType

private final TypeReference fieldContentsType
The field's type


resolvedMember

private RVMField resolvedMember
The RVMField that this field reference resolved to (null if not yet resolved).

Constructor Detail

FieldReference

FieldReference(TypeReference tr,
               Atom mn,
               Atom d,
               int id)
Parameters:
tr - a type reference
mn - the field or method name
d - the field or method descriptor
id - the new ID of the member were a new member required
Method Detail

getFieldContentsType

public TypeReference getFieldContentsType()
Returns:
the type of the field's value

getNumberOfStackSlots

public int getNumberOfStackSlots()
How many stackslots do value of this type take?


getSize

public int getSize()
Get size of the field's value, in bytes.


definitelyDifferent

public boolean definitelyDifferent(FieldReference that)
Do this and that definitely refer to the different fields?


definitelySame

public boolean definitelySame(FieldReference that)
Do this and that definitely refer to the same field?


isResolved

public boolean isResolved()
Has the field reference already been resolved into a target method?


setResolvedMember

void setResolvedMember(RVMField it)
For use by RVMField constructor


peekResolvedField

public RVMField peekResolvedField()
Find the RVMField that this field reference refers to using the search order specified in JVM spec 5.4.3.2.

Returns:
the RVMField that this method ref resolved to or null if it cannot be resolved.

resolve

public RVMField resolve()
Find the RVMField that this field reference refers to using the search order specified in JVM spec 5.4.3.2.

Returns:
the RVMField that this method ref resolved to.

resolveInternal

private RVMField resolveInternal(RVMClass declaringClass)

searchInterfaceFields

private RVMField searchInterfaceFields(RVMClass c)