private final static void insertCBSChecks(OPT_IR ir, HashMap origToDupMap, HashSet exceptionHandlerBlocks){
private final void insertCBSChecks(OPT_IR ir, HashMap origToDupMap, HashSet exceptionHandlerBlocks){
  private final static void insertCBSChecks(OPT_IR ir, HashMap origToDupMap, HashSet exceptionHandlerBlocks){        // Iterate through the basic blocks in the original code    Iterator origBlocks = origToDupMap.keySet().iterator();    while (origBlocks.hasNext()) {      OPT_BasicBlock bb = (OPT_BasicBlock) origBlocks.next();            OPT_BasicBlock dup = (OPT_BasicBlock) origToDupMap.get(bb);      if (dup == null) {        // Getting here means that for some reason the block was not duplicated.          if (DEBUG)           VM.sysWrite("Debug: block " + bb + " was not duplicated\n");        continue;      }      // If you have a yieldpoint, or if you are the predecessor of a      // split exception handler when duplicating code) then insert a      // check       if (getFirstInstWithYieldPoint(bb) != null ||   // contains yieldpoint          exceptionHandlerBlocks.contains(bb)) { // is exception handler        OPT_BasicBlock checkBB = null;        OPT_BasicBlock prev = bb.prevBasicBlockInCodeOrder();        // Entry has been split, so any node containing a yieldpoint        // should not be first        if (VM.VerifyAssertions)           VM._assert(prev != null);                  // Make a new BB that contains the check itself (it needs to        // be a basic block because the duplicated code branches back        // to it).          checkBB = new OPT_BasicBlock(-1,null,ir.cfg);        // Break the code to insert the check logic        ir.cfg.breakCodeOrder(prev, bb);        ir.cfg.linkInCodeOrder(prev, checkBB);        ir.cfg.linkInCodeOrder(checkBB, bb);                if (DEBUG)          VM.sysWrite("Creating check " + checkBB +                       " to preceed " + bb +" \n");                // Step 2, Make all of bb's predecessors point to the check instead        for (OPT_BasicBlockEnumeration preds = bb.getIn();             preds.hasMoreElements();) {          OPT_BasicBlock pred = preds.next();             pred.redirectOuts(bb,checkBB,ir);        }        // Insert the check logic        createCheck(checkBB,bb,dup,false,ir);      }    }  }