use of org.vmmagic.pragma.Entrypoint in project JikesRVM by JikesRVM.
the class OptSaveVolatile method yieldpointFromBackedge.
/**
* Handle timer interrupt taken on loop backedge.
* This method is identical to the yieldpointFromBackedge() method used
* method used by the baseline compiler, except in the OPT compiler world,
* we also save the volatile registers.
*/
@Entrypoint
public static void yieldpointFromBackedge() {
Address fp = Magic.getFramePointer();
RVMThread.yieldpoint(RVMThread.BACKEDGE, fp);
}
use of org.vmmagic.pragma.Entrypoint in project JikesRVM by JikesRVM.
the class OptSaveVolatile method yieldpointFromOsrOpt.
/**
* OSR invalidation being initiated.
*/
@Entrypoint
public static void yieldpointFromOsrOpt() {
Address fp = Magic.getFramePointer();
RVMThread.getCurrentThread().yieldToOSRRequested = true;
RVMThread.getCurrentThread().takeYieldpoint = 1;
RVMThread.yieldpoint(RVMThread.OSROPT, fp);
}
use of org.vmmagic.pragma.Entrypoint in project JikesRVM by JikesRVM.
the class ThinLock method inlineUnlock.
@Inline
@NoNullCheck
@Unpreemptible
@Entrypoint
public static void inlineUnlock(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)) {
if (!old.and(TL_LOCK_COUNT_MASK).isZero()) {
setDedicatedU16(o, lockOffset, old.minus(TL_LOCK_COUNT_UNIT));
Magic.fence();
return;
}
} else if (old.xor(tid).rshl(TL_LOCK_COUNT_SHIFT).EQ(TL_STAT_THIN.rshl(TL_LOCK_COUNT_SHIFT))) {
Magic.combinedLoadBarrier();
if (Magic.attemptWord(o, lockOffset, old, old.and(TL_UNLOCK_MASK).or(TL_STAT_THIN))) {
if (!VM.MagicAttemptImpliesStoreLoadBarrier)
Magic.fence();
return;
}
}
unlock(o, lockOffset);
}
use of org.vmmagic.pragma.Entrypoint in project JikesRVM by JikesRVM.
the class RVMThread method yieldpointFromPrologue.
/*
* Support for yieldpoints
*/
/**
* Yieldpoint taken in prologue.
*/
@BaselineSaveLSRegisters
// Save all non-volatile registers in prologue
@NoOptCompile
@NoInline
// TODO fix this -- related to SaveVolatile
@Entrypoint
@Unpreemptible("Becoming another thread interrupts the current thread, avoid preemption in the process")
public static void yieldpointFromPrologue() {
Address fp = Magic.getFramePointer();
yieldpoint(PROLOGUE, fp);
}
use of org.vmmagic.pragma.Entrypoint in project JikesRVM by JikesRVM.
the class RuntimeEntrypoints method checkcast.
/**
* Throw exception unless object is instance of target
* class/array or implements target interface.
* @param object object to be tested
* @param id of type reference corresponding to target class/array/interface
*/
@Entrypoint
static void checkcast(Object object, int id) throws ClassCastException, NoClassDefFoundError {
if (object == null) {
// null may be cast to any type
return;
}
TypeReference tRef = TypeReference.getTypeRef(id);
RVMType lhsType = tRef.peekType();
if (lhsType == null) {
lhsType = tRef.resolve();
}
RVMType rhsType = ObjectModel.getObjectType(object);
if (lhsType == rhsType) {
// exact match
return;
}
//
if (!isAssignableWith(lhsType, rhsType)) {
throw new ClassCastException("Cannot cast a(n) " + rhsType + " to a(n) " + lhsType);
}
}
Aggregations