boolean copyRequested = false;
  private void patchPEIgeneratedValues () {    // this only applies if there are exception handlers    if (!ir.hasReachableExceptionHandlers()) return;    HashSet needed = new HashSet(4);    OPT_BasicBlockEnumeration blocks = ir.getBasicBlocks();    while (blocks.hasMoreElements()) {      OPT_BasicBlock block = blocks.next();      if (block.getExceptionalOut().hasMoreElements()) {        OPT_Instruction pei = block.lastRealInstruction();        if (pei != null && pei.isPEI() && ResultCarrier.conforms(pei)) {          boolean copyNeeded = false;          OPT_RegisterOperand v = ResultCarrier.getResult(pei);          // void calls and the like... :(          if (v != null) {            OPT_Register orig = v.register;            {              OPT_BasicBlockEnumeration out =                 block.getApplicableExceptionalOut(pei);              while (out.hasMoreElements()) {                OPT_BasicBlock exp = out.next();                OPT_LiveSet explive = live.getLiveInfo(exp).in();                if (explive.contains(orig)) {                  copyNeeded = true;                  break;                }              }            }             if (copyNeeded) {              boolean copyRequested = false;              OPT_BasicBlockEnumeration out =                 block.getApplicableExceptionalOut(pei);              while (out.hasMoreElements()) {                OPT_BasicBlock exp = out.next();                needed.add(new OPT_Pair(exp, v));              }            }          }        }      }    }    // having determine where copies should be inserted, now insert them.    Iterator copies = needed.iterator();    while (copies.hasNext()) {      OPT_Pair copy = (OPT_Pair)copies.next();      OPT_BasicBlock inBlock = (OPT_BasicBlock)copy.first;      OPT_RegisterOperand registerOp = (OPT_RegisterOperand)copy.second;      VM_TypeReference type = registerOp.type;      OPT_Register register = registerOp.register;      OPT_Register temp = ir.regpool.getReg(register);      inBlock.prependInstruction(OPT_SSA.makeMoveInstruction(ir, register,                                                              temp, type));      OPT_LiveAnalysis.BBLiveElement inl = live.getLiveInfo(inBlock);      inl.gen().add(new OPT_RegisterOperand(temp, type));      inl.in().add(new OPT_RegisterOperand(temp, type));      OPT_BasicBlockEnumeration outBlocks = inBlock.getIn();      while (outBlocks.hasMoreElements()) {        OPT_BasicBlock outBlock = outBlocks.next();        OPT_Instruction x = OPT_SSA.makeMoveInstruction(ir, temp, register,                                                         type);        OPT_SSA.addAtEnd(ir, outBlock, x, true);        OPT_LiveAnalysis.BBLiveElement ol = live.getLiveInfo(outBlock);        ol.BBKillSet().add(new OPT_RegisterOperand(temp, type));      }    }  }