public final class Address extends Object
The address type is used by the runtime system and collector to denote machine addresses. We use a separate type instead of the Java int type for coding clarity, machine-portability (it can map to 32 bit and 64 bit integral types), and access to unsigned operations (Java does not have unsigned int types).
Constructor and Description |
---|
Address() |
Modifier and Type | Method and Description |
---|---|
boolean |
attempt(Address old,
Address value)
Attempt an atomic store operation.
|
boolean |
attempt(Address old,
Address value,
Offset offset)
Attempt an atomic store operation.
|
boolean |
attempt(int old,
int value)
Attempt an atomic store operation.
|
boolean |
attempt(int old,
int value,
Offset offset)
Attempt an atomic store operation.
|
boolean |
attempt(ObjectReference old,
ObjectReference value)
Attempt an atomic store operation.
|
boolean |
attempt(ObjectReference old,
ObjectReference value,
Offset offset)
Attempt an atomic store operation.
|
boolean |
attempt(Word old,
Word value)
Attempt an atomic store operation.
|
boolean |
attempt(Word old,
Word value,
Offset offset)
Attempt an atomic store operation.
|
Offset |
diff(Address addr2)
Compute the difference between two
Address es and
return the result. |
boolean |
EQ(Address addr2)
Return
true if this Address instance is equal
to addr2 . |
static Address |
fromIntSignExtend(int address)
Fabricate an
Address instance from an integer, after
sign extending the integer. |
static Address |
fromIntZeroExtend(int address)
Fabricate an
Address instance from an integer, after
zero extending the integer. |
static Address |
fromLong(long address)
Fabricate an
Address instance from an integer |
boolean |
GE(Address addr2)
Return
true if this Address instance is greater
than or equal to addr2 . |
boolean |
GT(Address addr2)
Return
true if this Address instance is greater
than addr2 . |
boolean |
isMax()
Return
true if this instance is the maximum
allowable Address value. |
boolean |
isZero()
Return
true if this instance is zero. |
boolean |
LE(Address addr2)
Return
true if this Address instance is less
than or equal to addr2 . |
Address |
loadAddress()
Loads an address value from the memory location pointed to by the
current instance.
|
Address |
loadAddress(Offset offset)
Loads an address value from the memory location pointed to by the
current instance.
|
byte |
loadByte()
Loads a byte from the memory location pointed to by the
current instance.
|
byte |
loadByte(Offset offset)
Loads a byte from the memory location pointed to by the
current instance.
|
char |
loadChar()
Loads a char from the memory location pointed to by the
current instance.
|
char |
loadChar(Offset offset)
Loads a char from the memory location pointed to by the
current instance.
|
double |
loadDouble()
Loads a double from the memory location pointed to by the
current instance.
|
double |
loadDouble(Offset offset)
Loads a double from the memory location pointed to by the
current instance.
|
float |
loadFloat()
Loads a float from the memory location pointed to by the
current instance.
|
float |
loadFloat(Offset offset)
Loads a float from the memory location pointed to by the
current instance.
|
int |
loadInt()
Loads an int from the memory location pointed to by the
current instance.
|
int |
loadInt(Offset offset)
Loads an int from the memory location pointed to by the
current instance.
|
long |
loadLong()
Loads a long from the memory location pointed to by the
current instance.
|
long |
loadLong(Offset offset)
Loads a long from the memory location pointed to by the
current instance.
|
ObjectReference |
loadObjectReference()
Loads a reference from the memory location pointed to by the
current instance.
|
ObjectReference |
loadObjectReference(Offset offset)
Loads a reference from the memory location pointed to by the
current instance.
|
short |
loadShort()
Loads a short from the memory location pointed to by the
current instance.
|
short |
loadShort(Offset offset)
Loads a short from the memory location pointed to by the
current instance.
|
Word |
loadWord()
Loads a word value from the memory location pointed to by the
current instance.
|
Word |
loadWord(Offset offset)
Loads a word value from the memory location pointed to by the
current instance.
|
boolean |
LT(Address addr2)
Return
true if this Address instance is less
than addr2 . |
static Address |
max()
Return an
Address instance that reflects the maximum
allowable Address value. |
Address |
minus(Extent extent)
Subtract an
Extent from this Address , and
return the result. |
Address |
minus(int v)
Subtract an integer from this
Address , and return
the result. |
Address |
minus(Offset offset)
Subtract an
Offset from this Address , and
return the result. |
boolean |
NE(Address addr2)
Return
true if this Address instance is not equal
to addr2 . |
Address |
plus(Extent extent)
Add an
Extent to this Address , and
return the sum. |
Address |
plus(int v)
Add an integer to this
Address , and return the sum. |
Address |
plus(Offset offset)
Add an
Offset to this Address , and
return the sum. |
void |
prefetch()
Prefetch a cache-line, architecture-independent
|
Address |
prepareAddress()
Prepare for an atomic store operation.
|
Address |
prepareAddress(Offset offset)
Prepare for an atomic store operation.
|
int |
prepareInt()
Prepare for an atomic store operation.
|
int |
prepareInt(Offset offset)
Prepare for an atomic store operation.
|
ObjectReference |
prepareObjectReference()
Prepare for an atomic store operation.
|
ObjectReference |
prepareObjectReference(Offset offset)
Prepare for an atomic store operation.
|
Word |
prepareWord()
Prepare for an atomic store operation.
|
Word |
prepareWord(Offset offset)
Prepare for an atomic store operation.
|
void |
store(Address value)
Stores the address value in the memory location pointed to by the
current instance.
|
void |
store(Address value,
Offset offset)
Stores the address value in the memory location pointed to by the
current instance.
|
void |
store(boolean value)
Stores the boolean value in the memory location pointed to by the
current instance.
|
void |
store(boolean value,
Offset offset)
Stores the boolean value in the memory location pointed to by the
current instance.
|
void |
store(byte value)
Stores the byte value in the memory location pointed to by the
current instance.
|
void |
store(byte value,
Offset offset)
Stores the byte value in the memory location pointed to by the
current instance.
|
void |
store(char value)
Stores a char value in the memory location pointed to by the
current instance.
|
void |
store(char value,
Offset offset)
Stores a char value in the memory location pointed to by the
current instance.
|
void |
store(double value)
Stores a double value in memory location pointed to by the
current instance.
|
void |
store(double value,
Offset offset)
Stores a double value in memory location pointed to by the
current instance.
|
void |
store(float value)
Stores the float value in the memory location pointed to by the
current instance.
|
void |
store(float value,
Offset offset)
Stores the float value in the memory location pointed to by the
current instance.
|
void |
store(int value)
Stores an int value in memory location pointed to by the
current instance.
|
void |
store(int value,
Offset offset)
Stores an int value in memory location pointed to by the
current instance.
|
void |
store(long value)
Stores a double value in memory location pointed to by the
current instance.
|
void |
store(long value,
Offset offset)
Stores a double value in memory location pointed to by the
current instance.
|
void |
store(ObjectReference value)
Stores the address value in the memory location pointed to by the
current instance.
|
void |
store(ObjectReference value,
Offset offset)
Stores the object reference value in the memory location pointed
to by the current instance.
|
void |
store(short value)
Stores a short value in the memory location pointed to by the
current instance.
|
void |
store(short value,
Offset offset)
Stores a short value in the memory location pointed to by the
current instance.
|
void |
store(Word value)
Stores the word value in the memory location pointed to by the
current instance.
|
void |
store(Word value,
Offset offset)
Stores the word value in the memory location pointed to by the
current instance.
|
int |
toInt()
Return an integer that reflects the value of this
Address instance. |
long |
toLong()
Return an long that reflects the value of this
Address instance. |
ObjectReference |
toObjectReference()
Fabricate an
ObjectReference instance from an
Address instance. |
Word |
toWord()
Return a
Word instance that reflects the value of
this Address instance. |
static Address |
zero()
Return an
Address instance that reflects the value
zero. |
public Address()
public static Address zero()
Address
instance that reflects the value
zero.public boolean isZero()
true
if this instance is zero.true
if this instance is zero.public static Address max()
Address
instance that reflects the maximum
allowable Address
value.Address
instance that reflects the
maximum allowable Address
value.public boolean isMax()
true
if this instance is the maximum
allowable Address
value.true
if this instance is the maximum
allowable Address
valu.public static Address fromIntSignExtend(int address)
Address
instance from an integer, after
sign extending the integer.address
- the integer from which to create an Address
instancepublic static Address fromIntZeroExtend(int address)
Address
instance from an integer, after
zero extending the integer.address
- the integer from which to create an Address
instancepublic static Address fromLong(long address)
Address
instance from an integeraddress
- the integer from which to create an Address
instancepublic ObjectReference toObjectReference()
ObjectReference
instance from an
Address
instance. It is the user's responsibility
to ensure that the Address
is suitable (i.e. it
points to the object header, or satisfies any other VM-specific
requirement for such a conversion).ObjectReference
instance.public int toInt()
Address
instance.Address
instance.public long toLong()
Address
instance.Address
instance.public Word toWord()
Word
instance that reflects the value of
this Address
instance.Word
instance that reflects the value of
this Address
instance.public Address plus(int v)
Address
, and return the sum.v
- the value to be added to this Address
Address
instance that reflects the result
of the addition.public Address plus(Offset offset)
Offset
to this Address
, and
return the sum.offset
- the Offset
to be added to the addressAddress
instance that reflects the result
of the addition.public Address plus(Extent extent)
Extent
to this Address
, and
return the sum.extent
- the Extent
to be added to this
Address
Address
instance that reflects the result
of the addition.public Address minus(int v)
Address
, and return
the result.v
- the integer to be subtracted from this
Address
.Address
instance that reflects the result
of the subtraction.public Address minus(Offset offset)
Offset
from this Address
, and
return the result.offset
- the Offset
to be subtracted from this
Address
.Address
instance that reflects the result
of the subtraction.public Address minus(Extent extent)
Extent
from this Address
, and
return the result.extent
- the Extent
to be subtracted from this
Address
.Address
instance that reflects the result
of the subtraction.public Offset diff(Address addr2)
Address
es and
return the result.addr2
- the Address
to be subtracted from this
Address
.Offset
instance that reflects the result
of the subtraction.public boolean LT(Address addr2)
true
if this Address
instance is less
than addr2
.addr2
- the Address
to be compared to this
Address
.true
if this Address
instance is less
than addr2
.public boolean LE(Address addr2)
true
if this Address
instance is less
than or equal to addr2
.addr2
- the Address
to be compared to this
Address
.true
if this Address
instance is less
than or equal to addr2
.public boolean GT(Address addr2)
true
if this Address
instance is greater
than addr2
.addr2
- the Address
to be compared to this
Address
.true
if this Address
instance is greater
than addr2
.public boolean GE(Address addr2)
true
if this Address
instance is greater
than or equal to addr2
.addr2
- the Address
to be compared to this
Address
.true
if this Address
instance is greater
than or equal to addr2
.public boolean EQ(Address addr2)
true
if this Address
instance is equal
to addr2
.addr2
- the Address
to be compared to this
Address
.true
if this Address
instance is equal
to addr2
.public boolean NE(Address addr2)
true
if this Address
instance is not equal
to addr2
.addr2
- the Address
to be compared to this
Address
.true
if this Address
instance is not
equal to addr2
.public void prefetch()
public ObjectReference loadObjectReference()
public ObjectReference loadObjectReference(Offset offset)
offset
- the offset to the value.public byte loadByte()
public byte loadByte(Offset offset)
offset
- the offset to the value.public char loadChar()
public char loadChar(Offset offset)
offset
- the offset to the value.public short loadShort()
public short loadShort(Offset offset)
offset
- the offset to the value.public float loadFloat()
public float loadFloat(Offset offset)
offset
- the offset to the value.public int loadInt()
public int loadInt(Offset offset)
offset
- the offset to the value.public long loadLong()
public long loadLong(Offset offset)
offset
- the offset to the value.public double loadDouble()
public double loadDouble(Offset offset)
offset
- the offset to the value.public Address loadAddress()
public Address loadAddress(Offset offset)
offset
- the offset to the value.public Word loadWord()
public Word loadWord(Offset offset)
offset
- the offset to the value.public void store(ObjectReference value)
value
- The address value to store.public void store(ObjectReference value, Offset offset)
value
- The object reference value to store.offset
- the offset to the value.public void store(Address value)
value
- The address value to store.public void store(Address value, Offset offset)
value
- The address value to store.offset
- the offset to the value.public void store(float value)
value
- The float value to store.public void store(float value, Offset offset)
value
- The float value to store.offset
- the offset to the value.public void store(Word value)
value
- The word value to store.public void store(Word value, Offset offset)
value
- The word value to store.offset
- the offset to the value.public void store(boolean value)
value
- The boolean value to store.public void store(boolean value, Offset offset)
value
- The boolean value to store.offset
- the offset to the value.public void store(byte value)
value
- The byte value to store.public void store(byte value, Offset offset)
value
- The byte value to store.offset
- the offset to the value.public void store(int value)
value
- The int value to store.public void store(int value, Offset offset)
value
- The int value to store.offset
- the offset to the value.public void store(double value)
value
- The double value to store.public void store(double value, Offset offset)
value
- The double value to store.offset
- the offset to the value.public void store(long value)
value
- The double value to store.public void store(long value, Offset offset)
value
- The double value to store.offset
- the offset to the value.public void store(char value)
value
- the char value to store.public void store(char value, Offset offset)
value
- the char value to store.offset
- the offset to the value.public void store(short value)
value
- the short value to store.public void store(short value, Offset offset)
value
- the short value to store.offset
- the offset to the value.public Word prepareWord()
public Word prepareWord(Offset offset)
offset
- the offset to the value.public ObjectReference prepareObjectReference()
public ObjectReference prepareObjectReference(Offset offset)
offset
- the offset to the value.public Address prepareAddress()
public Address prepareAddress(Offset offset)
offset
- the offset to the value.public int prepareInt()
public int prepareInt(Offset offset)
offset
- the offset to the value.public boolean attempt(int old, int value)
old
- the old value.value
- the new value.true
if the attempt was successful.public boolean attempt(int old, int value, Offset offset)
old
- the old value.value
- the new value.offset
- the offset to the value.true
if the attempt was successful.public boolean attempt(Word old, Word value)
old
- the old value.value
- the new value.true
if the attempt was successful.public boolean attempt(Word old, Word value, Offset offset)
old
- the old value.value
- the new value.offset
- the offset to the value.true
if the attempt was successful.public boolean attempt(ObjectReference old, ObjectReference value)
old
- the old value.value
- the new value.true
if the attempt was successful.public boolean attempt(ObjectReference old, ObjectReference value, Offset offset)
old
- the old value.value
- the new value.offset
- the offset to the value.true
if the attempt was successful.public boolean attempt(Address old, Address value)
old
- the old value.value
- the new value.true
if the attempt was successful.