private void collectNodes(final ControlFlowNode node) { if (node == end || node == newEnd) { throw new IllegalStateException("Unexpected cycle involving finally constructs!"); } if (oldToNew.containsKey(node)) { return; } final int newBlockIndex = _nodes.size(); final ControlFlowNode copy; switch (node.getNodeType()) { case Normal: copy = new ControlFlowNode(newBlockIndex, node.getStart(), node.getEnd()); break; case FinallyHandler: copy = new ControlFlowNode(newBlockIndex, node.getExceptionHandler(), node.getEndFinallyNode()); break; default: throw ContractUtils.unsupported(); } copy.setCopyFrom(node); _nodes.add(copy); oldToNew.put(node, copy); if (node != start) { for (final ControlFlowNode predecessor : node.getPredecessors()) { collectNodes(predecessor); } } }
final ControlFlowNode copyFinallySubGraph() { for (final ControlFlowNode node : end.getPredecessors()) { collectNodes(node); } for (final ControlFlowNode old : oldToNew.keySet()) { reconstructEdges(old, oldToNew.get(old)); } return getNew(start); }
private void collectNodes(final ControlFlowNode node) { if (node == end || node == newEnd) { throw new IllegalStateException("Unexpected cycle involving finally constructs!"); } if (oldToNew.containsKey(node)) { return; } final int newBlockIndex = _nodes.size(); final ControlFlowNode copy; switch (node.getNodeType()) { case Normal: copy = new ControlFlowNode(newBlockIndex, node.getStart(), node.getEnd()); break; case FinallyHandler: copy = new ControlFlowNode(newBlockIndex, node.getExceptionHandler(), node.getEndFinallyNode()); break; default: throw ContractUtils.unsupported(); } copy.setCopyFrom(node); _nodes.add(copy); oldToNew.put(node, copy); if (node != start) { for (final ControlFlowNode predecessor : node.getPredecessors()) { collectNodes(predecessor); } } }
private void collectNodes(final ControlFlowNode node) { if (node == end || node == newEnd) { throw new IllegalStateException("Unexpected cycle involving finally constructs!"); } if (oldToNew.containsKey(node)) { return; } final int newBlockIndex = _nodes.size(); final ControlFlowNode copy; switch (node.getNodeType()) { case Normal: copy = new ControlFlowNode(newBlockIndex, node.getStart(), node.getEnd()); break; case FinallyHandler: copy = new ControlFlowNode(newBlockIndex, node.getExceptionHandler(), node.getEndFinallyNode()); break; default: throw ContractUtils.unsupported(); } copy.setCopyFrom(node); _nodes.add(copy); oldToNew.put(node, copy); if (node != start) { for (final ControlFlowNode predecessor : node.getPredecessors()) { collectNodes(predecessor); } } }
private ControlFlowNode copyFinallySubGraph(final ControlFlowNode start, final ControlFlowNode end, final ControlFlowNode newEnd) { return new CopyFinallySubGraphLogic(start, end, newEnd).copyFinallySubGraph(); }
private ControlFlowNode copyFinallySubGraph(final ControlFlowNode start, final ControlFlowNode end, final ControlFlowNode newEnd) { return new CopyFinallySubGraphLogic(start, end, newEnd).copyFinallySubGraph(); }
private ControlFlowNode copyFinallySubGraph(final ControlFlowNode start, final ControlFlowNode end, final ControlFlowNode newEnd) { return new CopyFinallySubGraphLogic(start, end, newEnd).copyFinallySubGraph(); }
private void reconstructEdges(final ControlFlowNode oldNode, final ControlFlowNode newNode) { for (final ControlFlowEdge oldEdge : oldNode.getOutgoing()) { createEdge(newNode, getNew(oldEdge.getTarget()), oldEdge.getType()); } }
private void reconstructEdges(final ControlFlowNode oldNode, final ControlFlowNode newNode) { for (final ControlFlowEdge oldEdge : oldNode.getOutgoing()) { createEdge(newNode, getNew(oldEdge.getTarget()), oldEdge.getType()); } }
private void reconstructEdges(final ControlFlowNode oldNode, final ControlFlowNode newNode) { for (final ControlFlowEdge oldEdge : oldNode.getOutgoing()) { createEdge(newNode, getNew(oldEdge.getTarget()), oldEdge.getType()); } }
final ControlFlowNode copyFinallySubGraph() { for (final ControlFlowNode node : end.getPredecessors()) { collectNodes(node); } for (final ControlFlowNode old : oldToNew.keySet()) { reconstructEdges(old, oldToNew.get(old)); } return getNew(start); }
final ControlFlowNode copyFinallySubGraph() { for (final ControlFlowNode node : end.getPredecessors()) { collectNodes(node); } for (final ControlFlowNode old : oldToNew.keySet()) { reconstructEdges(old, oldToNew.get(old)); } return getNew(start); }