VM_Entrypoints.JNIEnvSavedPRField.getOffset());
VM_Entrypoints.JNIEnvSavedPRField.getOffsetAsInt());
  public static void generateEpilogForJNIMethod(VM_Assembler asm, VM_Method method) {    // assume RVM PR regs still valid. potentially T1 & T0 contain return    // values and should not be modified. we use regs saved in prolog and restored    // before return to do whatever needs to be done.  does not assume JTOC is valid,    // and may use it as scratch reg.    // if returning long, switch the order of the hi/lo word in T0 and T1    if (method.getReturnType().isLongType()) {      asm.emitPUSH_Reg(T1);          asm.emitMOV_Reg_Reg(T1, T0);        asm.emitPOP_Reg(T0);          }    // current processor status is IN_JAVA, so we only GC at yieldpoints    // S0 <- VM_JNIEnvironment    VM_ProcessorLocalState.emitMoveFieldToReg(asm, S0, VM_Entrypoints.activeThreadField.getOffset());     asm.emitMOV_Reg_RegDisp(S0, S0, VM_Entrypoints.jniEnvField.getOffset());    // set jniEnv TopJavaFP using value saved in frame in prolog    asm.emitMOV_Reg_RegDisp(EDI, EBP, SAVED_JAVA_FP_OFFSET);      // JTOC<-saved TopJavaFP (offset)    asm.emitADD_Reg_Reg(EDI, EBP);                                // change offset from FP into address    asm.emitMOV_RegDisp_Reg (S0, VM_Entrypoints.JNITopJavaFPField.getOffset(), EDI); // jniEnv.TopJavaFP <- JTOC    // in case thread has migrated to different PR, reset saved PRs to current PR    VM_ProcessorLocalState.emitStoreProcessor(asm, S0,                                              VM_Entrypoints.JNIEnvSavedPRField.getOffset());    // change current processor status to IN_NATIVE    VM_ProcessorLocalState.emitMoveImmToField(asm, VM_Entrypoints.vpStatusField.getOffset(), VM_Processor.IN_NATIVE);    // reload native/C nonvolatile regs - saved in prolog    // what about FPRs    // TODO: DAVE we really don't need to do this.  C has no nonvols on Linux/x86    VM_ProcessorLocalState.emitPopProcessor(asm);    asm.emitPOP_Reg(S0);             asm.emitPOP_Reg(EBX);             asm.emitPOP_Reg(JTOC);     // NOTE: C expects the framepointer to be restored to EBP, so     //       the epilogue for the C to Java glue code must follow that     //       convention, not the RVM one!    //       Also note that RVM treats EBP is a nonvolatile, so we don't    //       explicitly save/restore it.    asm.emitMOV_Reg_Reg(SP, EBP); // discard current stack frame    asm.emitPOP_Reg(EBP);    asm.emitRET();                // return to caller  }