VM_Entrypoints.activeThreadStackLimitField.getOffset());
VM_Entrypoints.activeThreadStackLimitField.getOffsetAsInt());
  private final void genPrologue () {    if (shouldPrint) asm.comment("prologue for " + method);    if (klass.isBridgeFromNative()) {      // replace the normal prologue with a special prolog      VM_JNICompiler.generateGlueCodeForJNIMethod (asm, method, compiledMethod.getId());      // set some constants for the code generation of the rest of the method      // firstLocalOffset is shifted down because more registers are saved      firstLocalOffset = STACKFRAME_BODY_OFFSET - (VM_JNICompiler.SAVED_GPRS_FOR_JNI<<LG_WORDSIZE) ;    } else {      /* paramaters are on the stack and/or in registers;  There is space       * on the stack for all the paramaters;  Parameter slots in the       * stack are such that the first paramater has the higher address,       * i.e., it pushed below all the other paramaters;  The return       * address is the topmost entry on the stack.  The frame pointer       * still addresses the previous frame.       * The first word of the header, currently addressed by the stack       * pointer, contains the return address.       */      /* establish a new frame:       * push the caller's frame pointer in the stack, and       * reset the frame pointer to the current stack top,       * ie, the frame pointer addresses directly the word       * that contains the previous frame pointer.       * The second word of the header contains the frame       * point of the caller.       * The third word of the header contains the compiled method id of the called method.       */      asm.emitPUSH_RegDisp   (PR, VM_Entrypoints.framePointerField.getOffset());        // store caller's frame pointer      VM_ProcessorLocalState.emitMoveRegToField(asm, VM_Entrypoints.framePointerField.getOffset(), SP); // establish new frame      /*       * NOTE: until the end of the prologue SP holds the framepointer.       */      asm.emitMOV_RegDisp_Imm(SP, STACKFRAME_METHOD_ID_OFFSET, compiledMethod.getId()); // 3rd word of header            /*       * save registers       */      asm.emitMOV_RegDisp_Reg (SP, JTOC_SAVE_OFFSET, JTOC);          // save nonvolatile JTOC register      asm.emitMOV_RegDisp_Reg (SP, EBX_SAVE_OFFSET, EBX);            // save nonvolatile EBX register          // establish the JTOC register      VM_ProcessorLocalState.emitMoveFieldToReg(asm, JTOC, VM_Entrypoints.jtocField.getOffset());      if (!VM.runningTool && ((VM_BaselineCompiledMethod)compiledMethod).hasCounterArray()) {        // use (nonvolatile) EBX to hold base of this methods counter array        asm.emitMOV_Reg_RegDisp(EBX, JTOC, VM_Entrypoints.edgeCountersField.getOffset());        asm.emitMOV_Reg_RegDisp(EBX, EBX, getEdgeCounterOffset());      }      int savedRegistersSize   = SAVED_GPRS<<LG_WORDSIZE;       // default      /* handle "dynamic brige" methods:       * save all registers except FP, SP, PR, S0 (scratch), and       * JTOC and EBX saved above.       */      // TODO: (SJF): When I try to reclaim ESI, I may have to save it here?      if (klass.isDynamicBridge()) {        savedRegistersSize += 2 << LG_WORDSIZE;        asm.emitMOV_RegDisp_Reg (SP, T0_SAVE_OFFSET,  T0);         asm.emitMOV_RegDisp_Reg (SP, T1_SAVE_OFFSET,  T1);         asm.emitFNSAVE_RegDisp  (SP, FPU_SAVE_OFFSET);        savedRegistersSize += FPU_STATE_SIZE;      }       // copy registers to callee's stackframe      firstLocalOffset         = STACKFRAME_BODY_OFFSET - savedRegistersSize;      int firstParameterOffset = (parameterWords << LG_WORDSIZE) + WORDSIZE;      genParameterCopy(firstParameterOffset, firstLocalOffset);      int emptyStackOffset = firstLocalOffset - (method.getLocalWords() << LG_WORDSIZE) + WORDSIZE;      asm.emitADD_Reg_Imm (SP, emptyStackOffset);               // set aside room for non parameter locals      //-#if RVM_WITH_OSR      /* defer generating code which may cause GC until        * locals were initialized. see emit_deferred_prologue       */      if (method.isForOsrSpecialization()) {        return;      }      //-#endif      /*       * generate stacklimit check       */      if (isInterruptible) {        // S0<-limit        VM_ProcessorLocalState.emitMoveFieldToReg(asm, S0,                                                  VM_Entrypoints.activeThreadStackLimitField.getOffset());        asm.emitSUB_Reg_Reg (S0, SP);                                           // space left        asm.emitADD_Reg_Imm (S0, method.getOperandWords() << LG_WORDSIZE);      // space left after this expression stack        VM_ForwardReference fr = asm.forwardJcc(asm.LT);        // Jmp around trap if OK        asm.emitINT_Imm ( VM_Runtime.TRAP_STACK_OVERFLOW + RVM_TRAP_BASE );     // trap        fr.resolve(asm);      } else {        // TODO!! make sure stackframe of uninterruptible method doesn't overflow guard page      }      if (method.isSynchronized()) genMonitorEnter();      genThreadSwitchTest(VM_Thread.PROLOGUE);    }  }