while (instrs.hasNext()) {
Instr i = instrs.next();
if ((bb != exitBB) && (i instanceof ReturnBase) || (i instanceof BreakInstr)) {
// Add before the break/return
instrs.previous();
instrs.add(new PopBindingInstr());
instrs.add(new PopFrameInstr());
break;
}
}
if ((bb == exitBB) && !bb.isEmpty()) {
// Last instr could be a return -- so, move iterator one position back
if (instrs.hasPrevious()) instrs.previous();
instrs.add(new PopBindingInstr());
instrs.add(new PopFrameInstr());
}
if (bb == geb) {
// Add before throw-exception-instr which would be the last instr
instrs.previous();
instrs.add(new PopBindingInstr());
instrs.add(new PopFrameInstr());
}
}
}