use of org.vmmagic.pragma.Inline in project JikesRVM by JikesRVM.
the class MonotonePageResource method releasePages.
/**
* Release all pages associated with this page resource, optionally
* zeroing on release and optionally memory protecting on release.
*/
@Inline
private void releasePages() {
if (contiguous) {
// TODO: We will perform unnecessary zeroing if the nursery size has decreased.
if (zeroConcurrent) {
// Wait for current zeroing to finish.
while (zeroingCursor.LT(zeroingSentinel)) {
}
}
// Reset zeroing region.
if (cursor.GT(zeroingSentinel)) {
zeroingSentinel = cursor;
}
zeroingCursor = start;
cursor = start;
currentChunk = Conversions.chunkAlign(start, true);
} else {
/* Not contiguous */
if (!cursor.isZero()) {
do {
Extent bytes = cursor.diff(currentChunk).toWord().toExtent();
releasePages(currentChunk, bytes);
} while (moveToNextChunk());
currentChunk = Address.zero();
sentinel = Address.zero();
cursor = Address.zero();
space.releaseAllChunks();
}
}
}
use of org.vmmagic.pragma.Inline in project JikesRVM by JikesRVM.
the class RuntimeEntrypoints method checkstore.
@Entrypoint
@Inline
static void checkstore(Object array, Object arrayElement) throws ArrayStoreException {
if (arrayElement == null) {
// null may be assigned to any type
return;
}
RVMType lhsType = Magic.getObjectType(array);
RVMType elmType = lhsType.asArray().getElementType();
if (elmType == RVMType.JavaLangObjectType) {
// array of Object can receive anything
return;
}
RVMType rhsType = Magic.getObjectType(arrayElement);
if (elmType == rhsType) {
// exact type match
return;
}
if (isAssignableWith(elmType, rhsType)) {
return;
}
throw new ArrayStoreException();
}
use of org.vmmagic.pragma.Inline in project JikesRVM by JikesRVM.
the class ThinLock method inlineLock.
@Inline
@NoNullCheck
@Unpreemptible
@Entrypoint
public static void inlineLock(Object o, Offset lockOffset) {
// FIXME: bad for PPC?
Word old = Magic.prepareWord(o, lockOffset);
Word id = old.and(TL_THREAD_ID_MASK.or(TL_STAT_MASK));
Word tid = Word.fromIntSignExtend(RVMThread.getCurrentThread().getLockingId());
if (id.EQ(tid)) {
Word changed = old.plus(TL_LOCK_COUNT_UNIT);
if (!changed.and(TL_LOCK_COUNT_MASK).isZero()) {
setDedicatedU16(o, lockOffset, changed);
Magic.combinedLoadBarrier();
return;
}
} else if (id.EQ(TL_STAT_THIN)) {
// lock is thin and not held by anyone
if (Magic.attemptWord(o, lockOffset, old, old.or(tid))) {
if (!VM.MagicAttemptImpliesStoreLoadBarrier)
Magic.fence();
return;
}
}
lock(o, lockOffset);
}
use of org.vmmagic.pragma.Inline 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;
}
use of org.vmmagic.pragma.Inline in project JikesRVM by JikesRVM.
the class BumpPointer method linearScan.
/**
* Perform a linear scan through the objects allocated by this bump pointer.
*
* @param scanner The scan object to delegate scanning to.
*/
@Inline
public final void linearScan(LinearScan scanner) {
if (VM.VERIFY_ASSERTIONS)
VM.assertions._assert(allowScanning);
/* Has this allocator ever allocated anything? */
if (initialRegion.isZero())
return;
/* Loop through active regions or until the last region */
Address start = initialRegion;
while (!start.isZero()) {
// Scan this region
scanRegion(scanner, start);
// Move on to next
start = getNextRegion(start);
}
}
Aggregations