asm.emitFSTP_RegDisp_Reg(EBP, emptyStackOffset + (WORDSIZE*(2+ i)), FP0);
asm.emitFSTP_RegDisp_Reg(EBP, emptyStackOffset.add(WORDSIZE*(2+ i)), FP0);
  static void storeParametersForLintel(VM_Assembler asm, VM_Method method) {    VM_Class klass           = method.getDeclaringClass();    int parameterWords       = method.getParameterWords();    int savedRegistersSize   = SAVED_GPRS<<LG_WORDSIZE;    int firstLocalOffset     = STACKFRAME_BODY_OFFSET - savedRegistersSize ;    int emptyStackOffset     = firstLocalOffset - ((parameterWords+2) << LG_WORDSIZE) + WORDSIZE;    int firstParameterOffset = STACKFRAME_BODY_OFFSET + STACKFRAME_HEADER_SIZE + (parameterWords<<LG_WORDSIZE);    int firstActualParameter;    VM_TypeReference[] types = method.getParameterTypes();   // does NOT include implicit this or class ptr    int numArguments = types.length;                // number of arguments for this method    int numRefArguments = 1;                        // initialize with count of 1 for the JNI arg    int numFloats = 0;                              // number of float or double arguments    // quick count of number of references    for (int i=0; i<numArguments; i++) {      if (types[i].isReferenceType())        numRefArguments++;      if (types[i].isFloatType() || types[i].isDoubleType())        numFloats++;    }    // first push the parameters passed in registers back onto the caller frame    // to free up the registers for use    // The number of registers holding parameter is     // VM_RegisterConstants.NUM_PARAMETER_GPRS    // Their indices are in VM_RegisterConstants.VOLATILE_GPRS[]    int gpr = 0;    // note that firstParameterOffset does not include "this"    int parameterOffset = firstParameterOffset;       // handle the "this" parameter    if (!method.isStatic()) {      asm.emitMOV_RegDisp_Reg(EBP, firstParameterOffset+WORDSIZE,                               VOLATILE_GPRS[gpr]);      gpr++;    }        for (int i=0; i<numArguments && gpr<NUM_PARAMETER_GPRS; i++) {      if (types[i].isDoubleType()) {        parameterOffset -= 2*WORDSIZE;        continue;      } else if (types[i].isFloatType()) {        parameterOffset -= WORDSIZE;        continue;      } else if (types[i].isLongType()) {        if (gpr<NUM_PARAMETER_GPRS) {   // get the hi word          asm.emitMOV_RegDisp_Reg(EBP, parameterOffset, VOLATILE_GPRS[gpr]);          gpr++;          parameterOffset -= WORDSIZE;        }        if (gpr<NUM_PARAMETER_GPRS) {    // get the lo word          asm.emitMOV_RegDisp_Reg(EBP, parameterOffset, VOLATILE_GPRS[gpr]);          gpr++;          parameterOffset -= WORDSIZE;        }      } else {        if (gpr<NUM_PARAMETER_GPRS) {   // all other types fit in one word          asm.emitMOV_RegDisp_Reg(EBP, parameterOffset, VOLATILE_GPRS[gpr]);          gpr++;          parameterOffset -= WORDSIZE;        }      }    }    // bump SP to set aside room for the args + 2 additional JNI args    asm.emitADD_Reg_Imm (SP, emptyStackOffset);                           // SP should now point to the bottom of the argument stack,     // which is arg[n-1]        // Prepare the side stack to hold new refs    // Leave S0 holding the threads' VM_JNIEnvironment    VM_ProcessorLocalState.emitMoveFieldToReg(asm, S0,                                              VM_Entrypoints.activeThreadField.getOffsetAsInt());    asm.emitMOV_Reg_RegDisp (S0, S0, VM_Entrypoints.jniEnvField.getOffsetAsInt());        // S0 <- jniEnv    // save PR in the jniEnv for JNI call from native    VM_ProcessorLocalState.emitStoreProcessor(asm, S0, VM_Entrypoints.JNIEnvSavedPRField.getOffsetAsInt());    // save VM_JNIEnvironemt in stack frame so we can find it when we return    asm.emitMOV_RegDisp_Reg(EBP, VM_JNICompiler.JNI_ENV_OFFSET, S0);    // save FP for glue frame in JNI env - used by GC when in C    asm.emitMOV_RegDisp_Reg (S0, VM_Entrypoints.JNITopJavaFPField.getOffsetAsInt(), EBP);  // jniEnv.JNITopJavaFP <- FP    //********************************************    // Between HERE and THERE, S0 and T0 are in use    // S0 holds the VM_JNIEnvironemnt for the thread.    // T0 holds the address to TOP of JNIRefs stack    //    (set up by startJNIrefForProlog, used by pushJNIRef)    // >>>> HERE <<<<    startJNIrefForProlog(asm, numRefArguments);        // Insert the JNIEnv* arg at the first entry:      // This is an interior pointer to VM_JNIEnvironment, which is held in S0.    asm.emitMOV_Reg_Reg     (EBX, S0);    asm.emitADD_Reg_Imm     (EBX, VM_Entrypoints.JNIExternalFunctionsField.getOffsetAsInt());    asm.emitMOV_RegDisp_Reg (EBP, emptyStackOffset, EBX);                  // store as 1st arg    // Insert the JNI arg at the second entry: class or object as a jref index    // first reload JTOC,  baseline compiler assumes JTOC register -> jtoc    // TODO: DAVE: doesn't it already have the JTOC????    VM_ProcessorLocalState.emitMoveFieldToReg(asm, JTOC,                                              VM_Entrypoints.jtocField.getOffsetAsInt());    if (method.isStatic()) {      // For static method, push on arg stack the VM_Class object      //    jtoc[tibOffset] -> class TIB ptr -> first TIB entry -> class object -> classForType      klass.getClassForType();     // ensure the Java class object is created      int tibOffset = klass.getTibOffset().toInt();      asm.emitMOV_Reg_RegDisp (EBX, JTOC, tibOffset);      asm.emitMOV_Reg_RegInd  (EBX, EBX);      asm.emitMOV_Reg_RegDisp (EBX, EBX, VM_Entrypoints.classForTypeField.getOffsetAsInt());      firstActualParameter = 0;    } else {      // For nonstatic method, "this" pointer should be the first arg in the caller frame,      // make it the 2nd arg in the glue frame      asm.emitMOV_Reg_RegDisp (EBX, EBP, firstParameterOffset+WORDSIZE);      firstActualParameter = 1;    }    // Generate the code to push this pointer in ebx on to the JNIRefs stack     // and use the JREF index in its place    // Assume: S0 is the jniEnv pointer (left over from above)    //         T0 contains the address to TOP of JNIRefs stack    // Kill value in ebx    // On return, ebx contains the JREF index    pushJNIref(asm);    asm.emitMOV_RegDisp_Reg (EBP, emptyStackOffset + WORDSIZE, EBX);  // store as 2nd arg    // Now fill in the rest:  copy parameters from caller frame into glue frame     // in reverse order for C    int i=parameterWords - 1;       int fpr = numFloats-1;    for (int argIndex=numArguments-1; argIndex>=0; argIndex--) {      // for reference, substitute with a jref index      if (types[argIndex].isReferenceType()) {        asm.emitMOV_Reg_RegDisp (EBX, EBP, firstParameterOffset - (i*WORDSIZE));        asm.emitCMP_Reg_Imm(EBX, 0);        VM_ForwardReference beq = asm.forwardJcc(asm.EQ);        pushJNIref(asm);        beq.resolve(asm);        asm.emitMOV_RegDisp_Reg (EBP, emptyStackOffset + (WORDSIZE*(2+ i)), EBX);        i--;            // for float and double, the first NUM_PARAMETER_FPRS args have      // been loaded in the FPU stack, need to pop them from there      } else if (types[argIndex].isDoubleType()) {        if (fpr < NUM_PARAMETER_FPRS) {          // pop this 2-word arg from the FPU stack          asm.emitFSTP_RegDisp_Reg_Quad(EBP, emptyStackOffset + (WORDSIZE*(2+ i - 1)), FP0);            } else {          // copy this 2-word arg from the caller frame          asm.emitMOV_Reg_RegDisp (EBX, EBP, firstParameterOffset - (i*WORDSIZE));          asm.emitMOV_RegDisp_Reg (EBP, emptyStackOffset + (WORDSIZE*(2 + i -1)), EBX);          asm.emitMOV_Reg_RegDisp (EBX, EBP, firstParameterOffset - ((i-1)*WORDSIZE));          asm.emitMOV_RegDisp_Reg (EBP, emptyStackOffset + (WORDSIZE*(2 + i)), EBX);              }        i-=2;        fpr--;      } else if (types[argIndex].isFloatType()) {        if (fpr < NUM_PARAMETER_FPRS) {          // pop this 1-word arg from the FPU stack          asm.emitFSTP_RegDisp_Reg(EBP, emptyStackOffset + (WORDSIZE*(2+ i)), FP0);        } else {          // copy this 1-word arg from the caller frame          asm.emitMOV_Reg_RegDisp (EBX, EBP, firstParameterOffset - (i*WORDSIZE));          asm.emitMOV_RegDisp_Reg (EBP, emptyStackOffset + (WORDSIZE*(2+ i)), EBX);        }        i--;        fpr--;      } else if (types[argIndex].isLongType()) {        //  copy other 2-word parameters: observe the high/low order when moving        asm.emitMOV_Reg_RegDisp (EBX, EBP, firstParameterOffset - (i*WORDSIZE));        asm.emitMOV_RegDisp_Reg (EBP, emptyStackOffset + (WORDSIZE*(2 + i - 1)), EBX);        asm.emitMOV_Reg_RegDisp (EBX, EBP, firstParameterOffset - ((i-1)*WORDSIZE));        asm.emitMOV_RegDisp_Reg (EBP, emptyStackOffset + (WORDSIZE*(2 + i)), EBX);        i-=2;      } else {        // copy other 1-word parameters        asm.emitMOV_Reg_RegDisp (EBX, EBP, firstParameterOffset - (i*WORDSIZE));        asm.emitMOV_RegDisp_Reg (EBP, emptyStackOffset + (WORDSIZE*(2+ i)), EBX);        i--;      }    }    // >>>> THERE <<<<    // End use of T0 and S0  }