use of org.vmmagic.pragma.Uninterruptible in project JikesRVM by JikesRVM.
the class RCHeader method makeLogged.
/**
* Signify completion of logging <code>object</code>.
*
* <code>object</code> is left in the <code>LOGGED</code> state.
*
* @see #attemptToLog(ObjectReference)
* @param object The object whose state is to be changed.
*/
@Inline
@Uninterruptible
public static void makeLogged(ObjectReference object) {
Word value = VM.objectModel.readAvailableBitsWord(object);
if (VM.VERIFY_ASSERTIONS)
VM.assertions._assert(value.and(LOGGING_MASK).NE(LOGGED));
VM.objectModel.writeAvailableBitsWord(object, value.and(LOGGING_MASK.not()));
}
use of org.vmmagic.pragma.Uninterruptible in project JikesRVM by JikesRVM.
the class RCHeader method decRC.
/**
* Decrement the reference count of an object. Return either
* <code>DEC_KILL</code> if the count went to zero,
* <code>DEC_ALIVE</code> if the count did not go to zero.
*
* @param object The object whose RC is to be decremented.
* @return <code>DEC_KILL</code> if the count went to zero,
* <code>DEC_ALIVE</code> if the count did not go to zero.
*/
@Inline
@Uninterruptible
public static int decRC(ObjectReference object) {
Word oldValue, newValue;
int rtn;
if (VM.VERIFY_ASSERTIONS) {
VM.assertions._assert(RCBase.isRCObject(object));
VM.assertions._assert(isLiveRC(object));
}
do {
oldValue = VM.objectModel.prepareAvailableBits(object);
if (isStuck(oldValue))
return DEC_ALIVE;
newValue = oldValue.minus(INCREMENT);
if (newValue.and(READ_MASK).LT(LIVE_THRESHOLD)) {
rtn = DEC_KILL;
} else {
rtn = DEC_ALIVE;
}
} while (!VM.objectModel.attemptAvailableBits(object, oldValue, newValue));
return rtn;
}
use of org.vmmagic.pragma.Uninterruptible in project JikesRVM by JikesRVM.
the class RuntimeEntrypoints method aastoreUninterruptible.
@Entrypoint
@Uninterruptible
static void aastoreUninterruptible(Object[] arrayRef, int index, Object value) {
if (VM.VerifyAssertions) {
int nelts = ObjectModel.getArrayLength(arrayRef);
VM._assert(index >= 0 && index < nelts);
}
Services.setArrayUninterruptible(arrayRef, index, value);
}
use of org.vmmagic.pragma.Uninterruptible in project JikesRVM by JikesRVM.
the class StackTrace method countFramesUninterruptible.
/**
* Walk the stack counting the number of stack frames encountered.
* The stack being walked is our stack, so code is Uninterruptible to stop the
* stack moving.
*
* @param stackTraceThread the thread whose stack is walked
* @return number of stack frames encountered
*/
@Uninterruptible
@NoInline
private int countFramesUninterruptible(RVMThread stackTraceThread) {
int stackFrameCount = 0;
Address fp;
/* Stack trace for the thread */
if (stackTraceThread == RVMThread.getCurrentThread()) {
fp = Magic.getFramePointer();
} else {
AbstractRegisters contextRegisters = stackTraceThread.getContextRegisters();
fp = contextRegisters.getInnermostFramePointer();
}
fp = Magic.getCallerFramePointer(fp);
while (Magic.getCallerFramePointer(fp).NE(StackFrameLayout.getStackFrameSentinelFP())) {
int compiledMethodId = Magic.getCompiledMethodID(fp);
if (compiledMethodId != StackFrameLayout.getInvisibleMethodID()) {
CompiledMethod compiledMethod = CompiledMethods.getCompiledMethod(compiledMethodId);
if ((compiledMethod.getCompilerType() != CompiledMethod.TRAP) && compiledMethod.hasBridgeFromNativeAnnotation()) {
// skip native frames, stopping at last native frame preceeding the
// Java To C transition frame
fp = RuntimeEntrypoints.unwindNativeStackFrame(fp);
}
}
stackFrameCount++;
fp = Magic.getCallerFramePointer(fp);
}
// VM.sysWriteln("stack frame count = ",stackFrameCount);
return stackFrameCount;
}
use of org.vmmagic.pragma.Uninterruptible in project JikesRVM by JikesRVM.
the class ThinLock method biasBitsToThinBits.
@Inline
@Uninterruptible
private static Word biasBitsToThinBits(Word bits) {
int lockOwner = getLockOwner(bits);
Word changed = bits.and(TL_UNLOCK_MASK).or(TL_STAT_THIN);
if (lockOwner != 0) {
int recCount = getRecCount(bits);
changed = changed.or(Word.fromIntZeroExtend(lockOwner)).or(Word.fromIntZeroExtend(recCount - 1).lsh(TL_LOCK_COUNT_SHIFT));
}
return changed;
}
Aggregations