use of org.vmmagic.pragma.NoInline in project JikesRVM by JikesRVM.
the class PostThreadSwitch method postProcess.
/* This method must be inlined to keep the correctness
* This method is called at the end of threadSwitch, the caller
* is threadSwitchFrom<...>
*/
@NoInline
public static void postProcess(RVMThread myThread) {
/* We need to generate thread specific code and install new code.
* We have to make sure that no GC happens from here and before
* the new code get executed.
*/
// add branch instruction from CTR.
CodeArray bridge = myThread.bridgeInstructions;
Address bridgeaddr = Magic.objectAsAddress(bridge);
Offset offset = myThread.fooFPOffset.plus(STACKFRAME_RETURN_ADDRESS_OFFSET);
Magic.objectAsAddress(myThread.getStack()).store(bridgeaddr, offset);
myThread.fooFPOffset = Offset.zero();
myThread.isWaitingForOsr = false;
myThread.bridgeInstructions = null;
}
use of org.vmmagic.pragma.NoInline in project JikesRVM by JikesRVM.
the class RVMThread method transferExecutionToNewStack.
@NoInline
@BaselineNoRegisters
private static // --> non-volatiles not restored!
void transferExecutionToNewStack(byte[] newStack, AbstractRegisters exceptionRegisters) {
// prevent opt compiler from inlining a method that contains a magic
// (returnToNewStack) that it does not implement.
RVMThread myThread = getCurrentThread();
byte[] myStack = myThread.stack;
// initialize new stack with live portion of stack we're
// currently running on
//
// lo-mem hi-mem
// |<---myDepth----|
// +----------+---------------+
// | empty | live |
// +----------+---------------+
// ^myStack ^myFP ^myTop
//
// +-------------------+---------------+
// | empty | live |
// +-------------------+---------------+
// ^newStack ^newFP ^newTop
//
Address myTop = Magic.objectAsAddress(myStack).plus(myStack.length);
Address newTop = Magic.objectAsAddress(newStack).plus(newStack.length);
Address myFP = Magic.getFramePointer();
Offset myDepth = myTop.diff(myFP);
Address newFP = newTop.minus(myDepth);
// The frame pointer addresses the top of the frame on powerpc and
// the bottom
// on intel. if we copy the stack up to the current
// frame pointer in here, the
// copy will miss the header of the intel frame. Thus we make another
// call
// to force the copy. A more explicit way would be to up to the
// frame pointer
// and the header for intel.
Offset delta = copyStack(newStack);
//
if (exceptionRegisters != null) {
adjustRegisters(exceptionRegisters, delta);
}
adjustStack(newStack, newFP, delta);
// install new stack
//
myThread.stack = newStack;
myThread.stackLimit = Magic.objectAsAddress(newStack).plus(StackFrameLayout.getStackSizeGuard());
//
if (VM.BuildForPowerPC) {
Magic.returnToNewStack(Magic.getCallerFramePointer(newFP));
} else if (VM.BuildForIA32) {
Magic.returnToNewStack(newFP);
}
if (VM.VerifyAssertions)
VM._assert(VM.NOT_REACHED);
}
use of org.vmmagic.pragma.NoInline in project JikesRVM by JikesRVM.
the class RVMThread method yieldpointFromBackedge.
/**
* Yieldpoint taken on backedge.
*/
@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 yieldpointFromBackedge() {
Address fp = Magic.getFramePointer();
yieldpoint(BACKEDGE, fp);
}
use of org.vmmagic.pragma.NoInline in project JikesRVM by JikesRVM.
the class DynamicLinkerHelper method getReceiverObject.
/**
* Reach up two stack frames into a frame that is compiled
* with the DynamicBridge register protocol and grap
* the receiver object of the invoke (ie the first param).
* NOTE: assumes that caller has disabled GC.
*/
@NoInline
public static Object getReceiverObject() {
// reach into register save area and fetch "this" parameter
Address callingFrame = Magic.getCallerFramePointer(Magic.getFramePointer());
callingFrame = Magic.getCallerFramePointer(callingFrame);
callingFrame = Magic.getCallerFramePointer(callingFrame);
Address location = callingFrame.minus((LAST_NONVOLATILE_FPR.value() - FIRST_VOLATILE_FPR.value() + 1) * BYTES_IN_DOUBLE + (LAST_NONVOLATILE_GPR.value() - FIRST_VOLATILE_GPR.value() + 1) * BYTES_IN_ADDRESS);
return Magic.addressAsObject(location.loadAddress());
}
use of org.vmmagic.pragma.NoInline in project JikesRVM by JikesRVM.
the class RVMThread method yieldpointFromEpilogue.
/**
* Yieldpoint taken in epilogue.
*/
@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 yieldpointFromEpilogue() {
Address fp = Magic.getFramePointer();
yieldpoint(EPILOGUE, fp);
}
Aggregations