OPT_MemoryOperand.BD(R(ESP),Offset.fromIntSignExtend(offset),
OPT_MemoryOperand.BD(new OPT_RegisterOperand(ESP, VM_TypeReference.Int), Offset.fromIntSignExtend(offset),
  private void rewriteStackLocations() {    // ESP is initially 4 bytes above where the framepointer is going to be.    ESPOffset = getFrameFixedSize() + 4;    OPT_Register ESP = ir.regpool.getPhysicalRegisterSet().getESP();    boolean seenReturn = false;    for (OPT_InstructionEnumeration e = ir.forwardInstrEnumerator();          e.hasMoreElements();) {      OPT_Instruction s = e.next();            if (s.isReturn()) {        seenReturn = true;        continue;      }      if (s.isBranch()) {        // restore ESP to home location at end of basic block.        moveESPBefore(s, 0);        continue;      }              if (s.operator() == BBEND) {        if (seenReturn) {          // at a return ESP will be at FrameFixedSize,           seenReturn = false;          ESPOffset = 0;        } else {          moveESPBefore(s, 0);        }        continue;      }      if (s.operator() == ADVISE_ESP) {        ESPOffset = MIR_UnaryNoRes.getVal(s).asIntConstant().value;        continue;      }      if (s.operator() == REQUIRE_ESP) {        // ESP is required to be at the given offset from the bottom of the frame        moveESPBefore(s, MIR_UnaryNoRes.getVal(s).asIntConstant().value);        continue;      }      if (s.operator() == YIELDPOINT_PROLOGUE ||          s.operator() == YIELDPOINT_BACKEDGE ||          s.operator() == YIELDPOINT_EPILOGUE) {        moveESPBefore(s, 0);        continue;      }      if (s.operator() == IA32_MOV) {        rewriteMoveInstruction(s);      }      // pop computes the effective address of its operand after ESP      // is incremented.  Therefore update ESPOffset before rewriting       // stacklocation and memory operands.      if (s.operator() == IA32_POP) {        ESPOffset  += 4;       }       for (OPT_OperandEnumeration ops = s.getOperands(); ops.hasMoreElements(); ) {        OPT_Operand op = ops.next();        if (op instanceof OPT_StackLocationOperand) {          OPT_StackLocationOperand sop = (OPT_StackLocationOperand)op;          int offset = sop.getOffset();          if (sop.isFromTop()) {            offset = FPOffset2SPOffset(offset);          }          offset -= ESPOffset;          byte size = sop.getSize();          OPT_MemoryOperand M =             OPT_MemoryOperand.BD(R(ESP),Offset.fromIntSignExtend(offset),                                 size, null, null);           s.replaceOperand(op, M);        } else if (op instanceof OPT_MemoryOperand) {          OPT_MemoryOperand M = op.asMemory();          if ((M.base != null && M.base.register == ESP) ||              (M.index != null && M.index.register == ESP)) {            M.disp = M.disp.sub(ESPOffset);          }        }      }      // push computes the effective address of its operand after ESP      // is decremented.  Therefore update ESPOffset after rewriting       // stacklocation and memory operands.      if (s.operator() == IA32_PUSH) {        ESPOffset -= 4;      }    }  }