use of org.vmmagic.pragma.BaselineNoRegisters 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);
}
Aggregations