asm.emitLAddr(SECOND_OS_PARAMETER_GPR, VM_Entrypoints.classForTypeField.getOffset(),
asm.emitLAddr(SECOND_OS_PARAMETER_GPR, VM_Entrypoints.classForTypeField.getOffsetAsInt(),
  private static void storeParameters(VM_Assembler asm, int frameSize,                                       VM_Method method, VM_Class klass) {    int nextOSArgReg, nextOSArgFloatReg, nextVMArgReg, nextVMArgFloatReg;         // offset to the spill area in the callee (OS frame):    int spillOffsetOS;    if (VM.BuildForPowerOpenABI || VM.BuildForMachOABI) {      // 1st spill = JNIEnv, 2nd spill = class      spillOffsetOS = NATIVE_FRAME_HEADER_SIZE + 2*BYTES_IN_STACKSLOT;    } else if (VM.BuildForSVR4ABI) {      spillOffsetOS = NATIVE_FRAME_HEADER_SIZE;    } else {        if (VM.VerifyAssertions) VM._assert(VM.NOT_REACHED);    }        // offset to the spill area in the caller (RVM frame), relative to the callee's FP    int spillOffsetVM = frameSize + STACKFRAME_HEADER_SIZE;    // does NOT include implicit this or class ptr        VM_TypeReference[] types = method.getParameterTypes();        // Set up the Reference table for GC    // PR <- JREFS array base    asm.emitLAddr(PROCESSOR_REGISTER, VM_Entrypoints.JNIRefsField.getOffset(), S0);    // TI <- JREFS current top     asm.emitLInt(KLUDGE_TI_REG, VM_Entrypoints.JNIRefsTopField.getOffset(), S0);   // JREFS offset for current TOP     asm.emitADD(KLUDGE_TI_REG, PROCESSOR_REGISTER, KLUDGE_TI_REG);                // convert into address    // TODO - count number of refs    // TODO - emit overflow check for JNIRefs array        // start a new JNIRefs frame on each transition from Java to native C    // push current SavedFP ptr onto top of JNIRefs stack (use available S1 reg as a temp)    // and make current TOP the new savedFP    //    asm.emitLInt  (S1, VM_Entrypoints.JNIRefsSavedFPField.getOffset(), S0);    asm.emitSTWU (S1, BYTES_IN_ADDRESS, KLUDGE_TI_REG);                           // push prev frame ptr onto JNIRefs array         asm.emitSUBFC(S1, PROCESSOR_REGISTER, KLUDGE_TI_REG);          // compute offset for new TOP    asm.emitSTW  (S1, VM_Entrypoints.JNIRefsSavedFPField.getOffset(), S0);  // save new TOP as new frame ptr in JNIEnv    // for static methods: caller has placed args in r3,r4,...     // for non-static methods:"this" ptr is in r3, and args start in r4,r5,...    //     // for static methods:                for nonstatic methods:           //  Java caller     OS callee         Java caller     OS callee        //  -----------     ----------          -----------     ----------      //  spill = arg11 -> new spill          spill = arg11 -> new spill      //  spill = arg10 -> new spill          spill = arg10 -> new spill      //                                      spill = arg9  -> new spill      //  spill = arg9  -> new spill                                          //  spill = arg8  -> new spill          spill = arg8  -> new spill      //    R10 = arg7  -> new spill          spill = arg7  -> new spill      //    R9  = arg6  -> new spill            R10 = arg6  -> new spill      //                                                                 //    R8  = arg5  -> R10                  R9  = arg5  -> R10             //    R7  = arg4  -> R9                   R8  = arg4  -> R9              //    R6  = arg3  -> R8                   R7  = arg3  -> R8              //    R5  = arg2  -> R7                   R6  = arg2  -> R7              //    R4  = arg1  -> R6                   R5  = arg1  -> R6              //    R3  = arg0  -> R5                   R4  = arg0  -> R5              //                   R4 = class           R3  = this  -> R4             //                   R3 = JNIenv                         R3 = JNIenv    //    nextOSArgFloatReg = FIRST_OS_PARAMETER_FPR;    nextVMArgFloatReg = FIRST_VOLATILE_FPR;    nextOSArgReg      = FIRST_OS_PARAMETER_GPR + 2;   // 1st reg = JNIEnv, 2nd reg = class/this    if (method.isStatic()) {      nextVMArgReg = FIRST_VOLATILE_GPR;                  } else {      nextVMArgReg = FIRST_VOLATILE_GPR+1; // 1st reg = this, to be processed separately    }    // The loop below assumes the following relationship:    if (VM.VerifyAssertions) VM._assert(FIRST_OS_PARAMETER_FPR==FIRST_VOLATILE_FPR);    if (VM.VerifyAssertions) VM._assert(LAST_OS_PARAMETER_FPR<=LAST_VOLATILE_FPR);    if (VM.VerifyAssertions) VM._assert(FIRST_OS_PARAMETER_GPR==FIRST_VOLATILE_GPR);    if (VM.VerifyAssertions) VM._assert(LAST_OS_PARAMETER_GPR<=LAST_VOLATILE_GPR);    generateParameterPassingCode(asm, types,                                 nextVMArgReg, nextVMArgFloatReg, spillOffsetVM,                                 nextOSArgReg, nextOSArgFloatReg, spillOffsetOS                                 );    // Now add the 2 JNI parameters:  JNI environment and Class or "this" object        // if static method, append ref for class, else append ref for "this"    // and pass offset in JNIRefs array in r4 (as second arg to called native code)    int SECOND_OS_PARAMETER_GPR = FIRST_OS_PARAMETER_GPR+1;    if (method.isStatic()) {      klass.getClassForType();     // ensure the Java class object is created      // ASSMPTION: JTOC saved above in JNIEnv is still valid,      // used by following emitLAddrToc      asm.emitLAddrToc(SECOND_OS_PARAMETER_GPR, klass.getTibOffset());  // r4 <= TIB      asm.emitLAddr(SECOND_OS_PARAMETER_GPR, TIB_TYPE_INDEX, SECOND_OS_PARAMETER_GPR); // r4 <= VM_Type      asm.emitLAddr(SECOND_OS_PARAMETER_GPR, VM_Entrypoints.classForTypeField.getOffset(),                    SECOND_OS_PARAMETER_GPR); // r4 <- java.lang.Class      asm.emitSTAddrU (SECOND_OS_PARAMETER_GPR, BYTES_IN_ADDRESS, KLUDGE_TI_REG);                 // append class ptr to end of JNIRefs array      asm.emitSUBFC(SECOND_OS_PARAMETER_GPR, PROCESSOR_REGISTER, KLUDGE_TI_REG);  // pass offset in bytes    } else {      asm.emitSTAddrU(T0, BYTES_IN_ADDRESS, KLUDGE_TI_REG);                 // append this ptr to end of JNIRefs array      asm.emitSUBFC(SECOND_OS_PARAMETER_GPR, PROCESSOR_REGISTER, KLUDGE_TI_REG);  // pass offset in bytes    }        // store the new JNIRefs array TOP back into JNIEnv     asm.emitSUBFC(KLUDGE_TI_REG, PROCESSOR_REGISTER, KLUDGE_TI_REG);     // compute offset for the current TOP    asm.emitSTW(KLUDGE_TI_REG, VM_Entrypoints.JNIRefsTopField.getOffset(), S0);  }