Search in sources :

Example 31 with ForwardReference

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);
}
Also used : ForwardReference(org.jikesrvm.compilers.common.assembler.ForwardReference)

Example 32 with ForwardReference

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);
}
Also used : ForwardReference(org.jikesrvm.compilers.common.assembler.ForwardReference)

Example 33 with ForwardReference

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);
}
Also used : ForwardReference(org.jikesrvm.compilers.common.assembler.ForwardReference)

Example 34 with ForwardReference

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);
}
Also used : ForwardReference(org.jikesrvm.compilers.common.assembler.ForwardReference)

Example 35 with ForwardReference

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);
}
Also used : ForwardReference(org.jikesrvm.compilers.common.assembler.ForwardReference)

Aggregations

ForwardReference (org.jikesrvm.compilers.common.assembler.ForwardReference)71 Offset (org.vmmagic.unboxed.Offset)13 TypeReference (org.jikesrvm.classloader.TypeReference)5 RVMClass (org.jikesrvm.classloader.RVMClass)4 Assembler (org.jikesrvm.compilers.common.assembler.ppc.Assembler)4 RVMMethod (org.jikesrvm.classloader.RVMMethod)3 GPR (org.jikesrvm.ia32.RegisterConstants.GPR)3 XMM (org.jikesrvm.ia32.RegisterConstants.XMM)3 InterfaceMethodSignature (org.jikesrvm.classloader.InterfaceMethodSignature)2 RVMArray (org.jikesrvm.classloader.RVMArray)2 Assembler (org.jikesrvm.compilers.common.assembler.ia32.Assembler)2 FloatingPointMachineRegister (org.jikesrvm.ia32.RegisterConstants.FloatingPointMachineRegister)2 JNICompiledMethod (org.jikesrvm.jni.JNICompiledMethod)2 Entrypoint (org.vmmagic.pragma.Entrypoint)2 Inline (org.vmmagic.pragma.Inline)2 Address (org.vmmagic.unboxed.Address)2 Atom (org.jikesrvm.classloader.Atom)1 FieldReference (org.jikesrvm.classloader.FieldReference)1 MethodReference (org.jikesrvm.classloader.MethodReference)1 RVMType (org.jikesrvm.classloader.RVMType)1