Modifier and Type | Field and Description |
---|---|
static Word |
BEING_LOGGED |
static int |
BITS_USED
Current not using any bits for cycle detection, etc
|
static int |
DEC_ALIVE |
static int |
DEC_KILL |
static Word |
DOUBLE_INCREMENT |
static int |
GC_HEADER_WORDS_REQUIRED |
static int |
GLOBAL_GC_BITS_REQUIRED |
static int |
INC_NEW |
static int |
INC_OLD |
static Word |
INCREMENT |
static int |
INCREMENT_SHIFT |
static Word |
LIVE_THRESHOLD |
static int |
LOCAL_GC_BITS_REQUIRED |
static int |
LOG_BIT |
static Word |
LOGGED |
static Word |
LOGGING_MASK |
static int |
MARK_BIT
The mark bit used for backup tracing.
|
static Word |
MARK_BIT_MASK |
static int |
NEW_BIT
The bit used for newly allocated objects.
|
static Word |
NEW_BIT_MASK |
static Word |
READ_MASK |
static Word |
refSticky |
static int |
refStickyValue |
static Word |
UNLOGGED |
static Word |
WRITE_MASK |
Constructor and Description |
---|
RCHeader() |
Modifier and Type | Method and Description |
---|---|
static boolean |
attemptToLog(ObjectReference object)
Attempt to log
object for coalescing RC. |
static void |
clearMarked(ObjectReference object)
Clears the mark status for the given object.
|
static int |
decRC(ObjectReference object)
Decrement the reference count of an object.
|
static int |
getRC(ObjectReference object)
Return the reference count for the object.
|
static int |
incRC(ObjectReference object)
Increment the reference count of an object.
|
static void |
initializeHeader(ObjectReference object,
boolean initialInc)
Perform any required initialization of the GC portion of the header.
|
static int |
initRC(ObjectReference object)
Initialize the reference count of an object.
|
private static boolean |
isHeaderMarked(Word header) |
private static boolean |
isHeaderNew(Word header) |
static boolean |
isLiveRC(ObjectReference object)
Return
true if given object is live |
static boolean |
isMarked(ObjectReference object) |
static boolean |
isNew(ObjectReference object) |
private static boolean |
isStuck(Word value) |
static boolean |
logRequired(ObjectReference object)
Return
true if object is yet to be logged (for
coalescing RC). |
static void |
makeLogged(ObjectReference object)
Signify completion of logging
object . |
static void |
makeUnlogged(ObjectReference object)
Change
object 's state to UNLOGGED . |
static int |
remainRC(ObjectReference object)
Retain the reference count of an object.
|
static boolean |
testAndMark(ObjectReference object)
Attempts to atomically mark this object.
|
public static final int LOCAL_GC_BITS_REQUIRED
public static final int GLOBAL_GC_BITS_REQUIRED
public static final int GC_HEADER_WORDS_REQUIRED
public static final int LOG_BIT
public static final Word BEING_LOGGED
public static final Word LOGGING_MASK
public static final int MARK_BIT
public static final Word MARK_BIT_MASK
public static final int NEW_BIT
public static final Word NEW_BIT_MASK
public static final int BITS_USED
public static final int INCREMENT_SHIFT
public static final Word DOUBLE_INCREMENT
public static final Word LIVE_THRESHOLD
public static final int DEC_KILL
public static final int DEC_ALIVE
public static final int INC_OLD
public static final int INC_NEW
public static final int refStickyValue
public static final Word WRITE_MASK
public RCHeader()
public static boolean logRequired(ObjectReference object)
true
if object
is yet to be logged (for
coalescing RC).object
- The object in questiontrue
if object
needs to be logged.public static boolean attemptToLog(ObjectReference object)
object
for coalescing RC. This is
used to handle a race to log the object, and returns
true
if we are to log the object and
false
if we lost the race to log the object.
If this method returns true
, it leaves the object
in the BEING_LOGGED
state. It is the responsibility
of the caller to change the object to LOGGED
once
the logging is complete.
object
- The object in questiontrue
if the race to log
object
was won.makeLogged(ObjectReference)
public static void makeLogged(ObjectReference object)
object
.
object
is left in the LOGGED
state.object
- The object whose state is to be changed.attemptToLog(ObjectReference)
public static void makeUnlogged(ObjectReference object)
object
's state to UNLOGGED
.object
- The object whose state is to be changed.public static boolean isMarked(ObjectReference object)
object
- an objectpublic static void clearMarked(ObjectReference object)
object
- the object whose status will be clearedprivate static boolean isHeaderMarked(Word header)
header
- the headerpublic static boolean testAndMark(ObjectReference object)
object
- the object to marktrue
if the mark was performed, false
otherwisepublic static boolean isNew(ObjectReference object)
object
- an objectprivate static boolean isHeaderNew(Word header)
header
- an object's headerpublic static void initializeHeader(ObjectReference object, boolean initialInc)
object
- the objectinitialInc
- start with a reference count of 1 (0 if false
)public static boolean isLiveRC(ObjectReference object)
true
if given object is liveobject
- The object whose liveness is to be testedtrue
if the object is alivepublic static int getRC(ObjectReference object)
object
- The object whose liveness is to be testedtrue
if the object is alivepublic static int incRC(ObjectReference object)
INC_OLD
if the object is not new,
INC_NEW
if the object is new.object
- The object whose RC is to be incremented.INC_OLD
if the object is not new,
INC_NEW
if the object is new.public static int decRC(ObjectReference object)
DEC_KILL
if the count went to zero,
DEC_ALIVE
if the count did not go to zero.object
- The object whose RC is to be decremented.DEC_KILL
if the count went to zero,
DEC_ALIVE
if the count did not go to zero.public static int initRC(ObjectReference object)
INC_OLD
if the object is not new,
INC_NEW
if the object is new.object
- The object whose RC is to be initialized.INC_OLD
if the object is not new,
INC_NEW
if the object is new.public static int remainRC(ObjectReference object)
INC_OLD
if the object is not new,
INC_NEW
if the object is new.object
- The object whose RC is to be retained.INC_OLD
if the object is not new,
INC_NEW
if the object is new.