pref.initialize(ir);
  void prepare(OPT_IR ir) {    // (1) if we haven't yet committed to a stack frame we     //     will look for operators that would require a stack frame    //        - LOWTABLESWITCH    //        - a GC Point, except for YieldPoints or IR_PROLOGUE     boolean preventYieldPointRemoval = false;    if (!frameRequired) {      for (OPT_Instruction s = ir.firstInstructionInCodeOrder();           s != null;           s = s.nextInstructionInCodeOrder()) {        if (s.operator() == LOWTABLESWITCH) {          // uses BL to get pc relative addressing.          frameRequired = true;          preventYieldPointRemoval = true;          break;        } else if (s.isGCPoint() && !s.isYieldPoint() &&                   s.operator() != IR_PROLOGUE) {          // frame required for GCpoints that are not yield points           //  or IR_PROLOGUE, which is the stack overflow check          frameRequired = true;          preventYieldPointRemoval = true;          break;        }      }      pref.initialize(ir);    }    // (2)     // In non-adaptive configurations we can omit the yieldpoint if     // the method contains exactly one basic block whose only successor     // is the exit node. (The method may contain calls, but we believe that     // in any program that isn't going to overflow its stack there must be     // some invoked method that contains more than 1 basic block, and     // we'll insert a yieldpoint in its prologue.)    // In adaptive configurations the only methods we eliminate yieldpoints     // from are those in which the yieldpoints are the only reason we would    // have to allocate a stack frame for the method.  Having more yieldpoints     // gets us better sampling behavior.  Thus, in the adaptive configuration     // we only omit the yieldpoint in leaf methods with no PEIs that contain     // exactly one basic block whose only successor is the exit node.    // TODO: We may want to force yieldpoints in "large" PEI-free     // single-block leaf methods (if any exist).    // TODO: This is a kludge. Removing the yieldpoint removes     //       the adaptive system's ability to accurately sample program     //       behavior.  Even if the method is absolutely trivial    //       eg boolean foo() { return false; }, we may still want to     //       sample it for the purposes of adaptive inlining.     //       On the other hand, the ability to do this inlining in some cases    //       may not be able to buy back having to create a stackframe     //       for all methods.    //    // Future feature: always insert a pseudo yield point that when taken will    //    create the stack frame on demand.    OPT_BasicBlock firstBB = ir.cfg.entry();    boolean isSingleBlock = firstBB.hasZeroIn() &&       firstBB.hasOneOut() && firstBB.pointsOut(ir.cfg.exit());    boolean removeYieldpoints = isSingleBlock && ! preventYieldPointRemoval;    //-#if RVM_WITH_ADAPTIVE_SYSTEM    // In adaptive systems if we require a frame, we don't remove     //  any yield poits    if (frameRequired) {      removeYieldpoints = false;    }    //-#endif    if (removeYieldpoints) {      for (OPT_Instruction s = ir.firstInstructionInCodeOrder();           s != null;           s = s.nextInstructionInCodeOrder()) {        if (s.isYieldPoint()) {          OPT_Instruction save = s;          // get previous instruction, so we can continue           // after we remove this instruction          s = s.prevInstructionInCodeOrder();          save.remove();          ir.MIRInfo.gcIRMap.delete(save);        }      }      prologueYieldpoint = false;    } else {      prologueYieldpoint = true;      frameRequired = true;    }    // (3) initialization     //initPools(ir);    this.ir = ir;    frameSize = spillPointer;    initForArch(ir);    // (4) save caughtExceptionOffset where the exception deliverer can find it    ir.compiledMethod.setUnsignedExceptionOffset(caughtExceptionOffset);    // (5) initialize the restrictions object    restrict = new OPT_RegisterRestrictions(ir.regpool.getPhysicalRegisterSet());  }