org.vmmagic.unboxed
Class ObjectReference

java.lang.Object
  extended by org.vmmagic.unboxed.ObjectReference

public final class ObjectReference
extends Object

The object reference type is used by the runtime system and collector to represent a type that holds a reference to a single object. We use a separate type instead of the Java Object type for coding clarity, to make a clear distinction between objects the VM is written in, and objects that the VM is managing. No operations that can not be completed in pure Java should be allowed on Object.


Field Summary
private  Object data
          The object field.
 
Constructor Summary
ObjectReference()
           
 
Method Summary
static ObjectReference fromObject(Object obj)
          Convert from an object to a reference.
 boolean isNull()
          Is this a null reference?
static ObjectReference nullReference()
          Return a null reference
 Address toAddress()
          Get a heap address for the object.
 Object toObject()
          Convert from an reference to an object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

data

private Object data
The object field.

Constructor Detail

ObjectReference

public ObjectReference()
Method Detail

fromObject

public static ObjectReference fromObject(Object obj)
Convert from an object to a reference.

Parameters:
obj - The object
Returns:
The corresponding reference

nullReference

public static ObjectReference nullReference()
Return a null reference


toObject

public Object toObject()
Convert from an reference to an object. Note: this is a JikesRVM specific extension to vmmagic.

Returns:
The object

toAddress

public Address toAddress()
Get a heap address for the object.


isNull

public boolean isNull()
Is this a null reference?