use of org.jikesrvm.compilers.common.assembler.ForwardReference in project JikesRVM by JikesRVM.
the class Assembler method reserveForwardConditionalBranch.
/* call before emiting code for the branch */
void reserveForwardConditionalBranch(int where) {
emitNOP();
ForwardReference fr = new ForwardReference.ConditionalBranch(mIP, where);
forwardRefs = ForwardReference.enqueue(forwardRefs, fr);
}
use of org.jikesrvm.compilers.common.assembler.ForwardReference in project JikesRVM by JikesRVM.
the class Assembler method registerLoadReturnAddress.
public void registerLoadReturnAddress(int bReturn) {
ForwardReference r = new ForwardReference.LoadReturnAddress(mIP, bReturn);
forwardRefs = ForwardReference.enqueue(forwardRefs, r);
}
use of org.jikesrvm.compilers.common.assembler.ForwardReference in project JikesRVM by JikesRVM.
the class Assembler method reserveShortForwardConditionalBranch.
/* call before emiting code for the branch */
void reserveShortForwardConditionalBranch(int where) {
ForwardReference fr = new ForwardReference.ConditionalBranch(mIP, where);
forwardRefs = ForwardReference.enqueue(forwardRefs, fr);
}
use of org.jikesrvm.compilers.common.assembler.ForwardReference in project JikesRVM by JikesRVM.
the class Assembler method emitNativeStackOverflowCheck.
/**
* Emit baseline stack overflow instruction sequence for native method prolog.
* For the lowest Java to C transition frame in the stack, check that there is space of
* STACK_SIZE_NATIVE words available on the stack; enlarge stack if necessary.
* For subsequent Java to C transition frames, check for the requested size and don't resize
* the stack if overflow
* <pre>
* Before: FP is current (calling) frame
* TR is the current RVMThread
* After: R0, S0 destroyed
* </pre>
*
* @param frameSize the frame's size
*/
public void emitNativeStackOverflowCheck(int frameSize) {
emitLAddrOffset(S0, THREAD_REGISTER, // S0 := thread.jniEnv
Entrypoints.jniEnvField.getOffset());
// R0 := thread.jniEnv.JNIRefsTop
emitLIntOffset(GPR.R0, S0, Entrypoints.JNIRefsTopField.getOffset());
// check if S0 == 0 -> first native frame on stack
emitCMPI(GPR.R0, 0);
ForwardReference fr1 = emitForwardBC(EQ);
// check for enough space for requested frame size
emitLAddrOffset(GPR.R0, THREAD_REGISTER, // R0 := &stack guard page
Entrypoints.stackLimitField.getOffset());
// S0 := &new frame pointer
emitADDI(S0, -frameSize, FP);
// trap if new frame below guard page
emitTAddrLT(S0, GPR.R0);
ForwardReference fr2 = emitForwardB();
// check for enough space for STACK_SIZE_JNINATIVE
fr1.resolve(this);
emitLAddrOffset(GPR.R0, THREAD_REGISTER, // R0 := &stack guard page
Entrypoints.stackLimitField.getOffset());
emitLVAL(S0, STACK_SIZE_JNINATIVE);
// S0 := &new frame pointer
emitSUBFC(S0, S0, FP);
emitCMPLAddr(GPR.R0, S0);
ForwardReference fr3 = emitForwardBC(LE);
// trap if new frame pointer below guard page
emitTAddrWI(1);
fr2.resolve(this);
fr3.resolve(this);
}
use of org.jikesrvm.compilers.common.assembler.ForwardReference in project JikesRVM by JikesRVM.
the class Assembler method reserveForwardBranch.
/* call before emiting code for the branch */
void reserveForwardBranch(int where) {
ForwardReference fr = new ForwardReference.UnconditionalBranch(mIP, where);
forwardRefs = ForwardReference.enqueue(forwardRefs, fr);
}
Aggregations