callSpillLoc += 4;
callSpillLoc += BYTES_IN_ADDRESS;
  private static void callExpand(OPT_Instruction s, OPT_IR ir) {    int NumberParams = MIR_Call.getNumberOfParams(s);    int int_index = 0;          // points to the first integer volatile    int double_index = 0;       // poinst to the first f.p.    volatile    int callSpillLoc = STACKFRAME_HEADER_SIZE;    OPT_PhysicalRegisterSet phys = ir.regpool.getPhysicalRegisterSet();    OPT_Instruction prev = s.prevInstructionInCodeOrder();    OPT_Register FP = phys.getFP();    OPT_Register JTOC = phys.getJTOC();    boolean isSysCall = ir.stackManager.isSysCall(s);    boolean firstLongHalf = false;    // (1) Expand parameters    for (int opNum = 0; opNum < NumberParams; opNum++) {      OPT_Operand param = MIR_Call.getClearParam(s, opNum);      OPT_RegisterOperand Reg = (OPT_RegisterOperand)param;      // as part of getting into MIR, we make sure all params are in registers.      OPT_Register reg = Reg.register;      if (Reg.type.isFloatType()) {        if (double_index < NUMBER_DOUBLE_PARAM) {       // register copy          OPT_Register real = phys.get(FIRST_DOUBLE_PARAM + (double_index++));          s.insertBack(MIR_Move.create(PPC_FMR, F(real), Reg));          Reg = F(real);          // Record that the call now has a use of the real reg          // This is to ensure liveness is correct          MIR_Call.setParam(s, opNum, Reg);        } else {                  // spill to memory          OPT_Instruction p = prev.nextInstructionInCodeOrder();          p.insertBack(MIR_Store.create(PPC_STFS, F(reg), R(FP), I(callSpillLoc)));          callSpillLoc += 4;          // We don't have uses of the heap at MIR, so null it out          MIR_Call.setParam(s, opNum, null);        }      } else if (Reg.type.isDoubleType()) {        if (double_index < NUMBER_DOUBLE_PARAM) {     // register copy          OPT_Register real = phys.get(FIRST_DOUBLE_PARAM + (double_index++));          s.insertBack(MIR_Move.create(PPC_FMR, D(real), Reg));          Reg = D(real);          // Record that the call now has a use of the real reg          // This is to ensure liveness is correct          MIR_Call.setParam(s, opNum, Reg);        } else {                  // spill to memory          OPT_Instruction p = prev.nextInstructionInCodeOrder();          p.insertBack(MIR_Store.create(PPC_STFD, D(reg), R(FP), I(callSpillLoc)));          callSpillLoc += 8;          // We don't have uses of the heap at MIR, so null it out          MIR_Call.setParam(s, opNum, null);        }      } else {                    // IntType (or half of long) or reference        //-#if RVM_FOR_LINUX        /* NOTE: following adjustment is not stated in SVR4 ABI, but          * was implemented in GCC.         */        if (isSysCall && Reg.type.isLongType()) {          if (firstLongHalf)            firstLongHalf = false;          else {            int true_index = FIRST_INT_PARAM + int_index;            int_index += (true_index + 1) & 0x01; // if gpr is even, gpr += 1            firstLongHalf = true;          }        }        //-#endif        if (int_index < NUMBER_INT_PARAM) {             // register copy          OPT_Register real = phys.get(FIRST_INT_PARAM + (int_index++));          OPT_RegisterOperand Real = new OPT_RegisterOperand(real, Reg.type);          s.insertBack(MIR_Move.create(PPC_MOVE, Real, Reg));          Reg = new OPT_RegisterOperand(real, Reg.type);          // Record that the call now has a use of the real reg          // This is to ensure liveness is correct          MIR_Call.setParam(s, opNum, Reg);        } else {                  // spill to memory          OPT_Instruction p = prev.nextInstructionInCodeOrder();          p.insertBack(MIR_Store.create(PPC_STW,                                         new OPT_RegisterOperand(reg, Reg.type),                                         R(FP), I(callSpillLoc)));          callSpillLoc += 4;          // We don't have uses of the heap at MIR, so null it out          MIR_Call.setParam(s, opNum, null);        }      }    }    // If we needed to pass arguments on the stack,     // then make sure we have a big enough stack     if (callSpillLoc != STACKFRAME_HEADER_SIZE)      ir.stackManager.allocateParameterSpace(callSpillLoc);    // (2) expand result    OPT_RegisterOperand callResult = null;    OPT_Instruction lastCallSeqInstr = s;    if (MIR_Call.hasResult2(s)) {      OPT_RegisterOperand result2 = MIR_Call.getClearResult2(s);      OPT_RegisterOperand physical = new OPT_RegisterOperand(phys.get                                                             (FIRST_INT_RETURN                                                               + 1),                                                              result2.type);      OPT_Instruction tmp = MIR_Move.create(PPC_MOVE, result2, physical);      lastCallSeqInstr.insertFront(tmp);      lastCallSeqInstr = tmp;      MIR_Call.setResult2(s, null);    }    if (MIR_Call.hasResult(s)) {      OPT_RegisterOperand result1 = MIR_Call.getClearResult(s);      callResult = result1;      if (result1.type.isFloatType() || result1.type.isDoubleType()) {        OPT_RegisterOperand physical = new           OPT_RegisterOperand(phys.get(FIRST_DOUBLE_RETURN),                               result1.type);        OPT_Instruction tmp = MIR_Move.create(PPC_FMR, result1, physical);        lastCallSeqInstr.insertFront(tmp);        lastCallSeqInstr = tmp;        MIR_Call.setResult(s, null);      } else {        OPT_RegisterOperand physical = new           OPT_RegisterOperand(phys.get(FIRST_INT_RETURN),                               result1.type);        OPT_Instruction tmp = MIR_Move.create(PPC_MOVE, result1, physical);        lastCallSeqInstr.insertFront(tmp);        lastCallSeqInstr = tmp;        MIR_Call.setResult(s, null);      }    }  }