Modifier and Type | Field and Description |
---|---|
private static boolean |
ENABLE_BIASED_LOCKING |
(package private) static int |
fastLocks |
private static int |
retryLimit
Number of times a thread yields before inflating the lock on a
object to a heavy-weight lock.
|
(package private) static int |
slowLocks |
(package private) static boolean |
STATS |
(package private) static boolean |
trace |
Constructor and Description |
---|
ThinLock() |
Modifier and Type | Method and Description |
---|---|
protected static Lock |
attemptToInflate(Object o,
Offset lockOffset,
Lock l)
Promotes a light-weight lock to a heavy-weight lock.
|
static boolean |
attemptToMarkDeflated(Object o,
Offset lockOffset,
Word oldLockWord) |
static boolean |
attemptToMarkInflated(Object o,
Offset lockOffset,
Word oldLockWord,
int lockId,
int cnt) |
private static Word |
biasBitsToThinBits(Word bits) |
static boolean |
casFromBiased(Object o,
Offset lockOffset,
Word oldLockWord,
Word changed,
int cnt) |
static Lock |
getHeavyLock(Object o,
Offset lockOffset,
boolean create)
Obtains the heavy-weight lock, if there is one, associated with the
indicated object.
|
static int |
getLockIndex(Word lockWord)
Return the lock index for a given lock word.
|
static int |
getLockOwner(Word lockWord) |
static int |
getRecCount(Word lockWord) |
static boolean |
holdsLock(Object o,
Offset lockOffset,
RVMThread thread) |
private static Lock |
inflate(Object o,
Offset lockOffset)
Promotes a light-weight lock to a heavy-weight lock.
|
private static boolean |
inflateAndLock(Object o,
Offset lockOffset)
Promotes a light-weight lock to a heavy-weight lock and locks it.
|
static void |
inlineLock(Object o,
Offset lockOffset) |
static void |
inlineUnlock(Object o,
Offset lockOffset) |
static boolean |
isFat(Word lockWord) |
static void |
lock(Object o,
Offset lockOffset) |
static void |
markDeflated(Object o,
Offset lockOffset,
int id) |
(package private) static void |
notifyAppRunStart(String app,
int value) |
(package private) static void |
notifyExit(int value) |
private static void |
setDedicatedU16(Object o,
Offset lockOffset,
Word value)
Set only the dedicated locking 16-bit part of the given value.
|
static void |
unlock(Object o,
Offset lockOffset) |
private static final boolean ENABLE_BIASED_LOCKING
private static final int retryLimit
static final boolean STATS
static final boolean trace
static int fastLocks
static int slowLocks
public ThinLock()
public static void inlineLock(Object o, Offset lockOffset)
public static void inlineUnlock(Object o, Offset lockOffset)
public static int getLockIndex(Word lockWord)
lockWord
- The lock word whose lock index is being establishedpublic static int getLockOwner(Word lockWord)
public static int getRecCount(Word lockWord)
private static void setDedicatedU16(Object o, Offset lockOffset, Word value)
o
- The object whose header is to be changedlockOffset
- The lock offsetvalue
- The value which contains the 16-bit portion to be written.public static boolean casFromBiased(Object o, Offset lockOffset, Word oldLockWord, Word changed, int cnt)
public static boolean attemptToMarkInflated(Object o, Offset lockOffset, Word oldLockWord, int lockId, int cnt)
protected static Lock attemptToInflate(Object o, Offset lockOffset, Lock l)
o
- the object to get a heavy-weight locklockOffset
- the offset of the thin lock word in the object.l
- the lock to attempt to inflateprivate static Word biasBitsToThinBits(Word bits)
public static boolean attemptToMarkDeflated(Object o, Offset lockOffset, Word oldLockWord)
public static void markDeflated(Object o, Offset lockOffset, int id)
private static Lock inflate(Object o, Offset lockOffset)
o
- the object to get a heavy-weight locklockOffset
- the offset of the thin lock word in the object.private static boolean inflateAndLock(Object o, Offset lockOffset)
o
- the object to get a heavy-weight locklockOffset
- the offset of the thin lock word in the object.public static Lock getHeavyLock(Object o, Offset lockOffset, boolean create)
null
, if there is no
heavy-weight lock associated with the object.o
- the object from which a lock is desiredlockOffset
- the offset of the thin lock word in the object.create
- if true, create heavy lock if none foundstatic void notifyAppRunStart(String app, int value)
static void notifyExit(int value)