/** * @return iterator of the catch instructions in this IR */ public Iterator<SSAInstruction> iterateCatchInstructions() { return new CatchIterator(); }
@Override public SSAInstruction next() { ExceptionHandlerBasicBlock bb = (ExceptionHandlerBasicBlock) cfg.getNode(currentBlockIndex); SSAInstruction result = bb.getCatchInstruction(); advanceBlock(); return result; }
private void advanceBlock() { for (int i = currentBlockIndex + 1; i < cfg.getMaxNumber(); i++) { if (hasCatch(cfg.getNode(i))) { currentBlockIndex = i; return; } } currentBlockIndex = -1; } }
@Override public SSAInstruction next() { ExceptionHandlerBasicBlock bb = (ExceptionHandlerBasicBlock) cfg.getNode(currentBlockIndex); SSAInstruction result = bb.getCatchInstruction(); advanceBlock(); return result; }
CatchIterator() { currentBlockIndex = 0; if (!hasCatch(cfg.getNode(0))) { advanceBlock(); } }
/** * @return iterator of the catch instructions in this IR */ public Iterator<SSAInstruction> iterateCatchInstructions() { return new CatchIterator(); }
private void advanceBlock() { for (int i = currentBlockIndex + 1; i < cfg.getMaxNumber(); i++) { if (hasCatch(cfg.getNode(i))) { currentBlockIndex = i; return; } } currentBlockIndex = -1; } }
CatchIterator() { currentBlockIndex = 0; if (!hasCatch(cfg.getNode(0))) { advanceBlock(); } }