public final void computeDominanceFrontier() { resetVisited(); getEntryPoint().traversePostOrder( new Function<ControlFlowNode, Iterable<ControlFlowNode>>() { @Override public final Iterable<ControlFlowNode> apply(final ControlFlowNode input) { return input.getDominatorTreeChildren(); } }, new Block<ControlFlowNode>() { @Override public void accept(final ControlFlowNode n) { final Set<ControlFlowNode> dominanceFrontier = n.getDominanceFrontier(); dominanceFrontier.clear(); for (final ControlFlowNode s : n.getSuccessors()) { if (s.getImmediateDominator() != n) { dominanceFrontier.add(s); } } for (final ControlFlowNode child : n.getDominatorTreeChildren()) { for (final ControlFlowNode p : child.getDominanceFrontier()) { if (p.getImmediateDominator() != n) { dominanceFrontier.add(p); } } } } } ); }
public final void computeDominanceFrontier() { resetVisited(); getEntryPoint().traversePostOrder( new Function<ControlFlowNode, Iterable<ControlFlowNode>>() { @Override public final Iterable<ControlFlowNode> apply(final ControlFlowNode input) { return input.getDominatorTreeChildren(); } }, new Block<ControlFlowNode>() { @Override public void accept(final ControlFlowNode n) { final Set<ControlFlowNode> dominanceFrontier = n.getDominanceFrontier(); dominanceFrontier.clear(); for (final ControlFlowNode s : n.getSuccessors()) { if (s.getImmediateDominator() != n) { dominanceFrontier.add(s); } } for (final ControlFlowNode child : n.getDominatorTreeChildren()) { for (final ControlFlowNode p : child.getDominanceFrontier()) { if (p.getImmediateDominator() != n) { dominanceFrontier.add(p); } } } } } ); }
public final void computeDominanceFrontier() { resetVisited(); getEntryPoint().traversePostOrder( new Function<ControlFlowNode, Iterable<ControlFlowNode>>() { @Override public final Iterable<ControlFlowNode> apply(final ControlFlowNode input) { return input.getDominatorTreeChildren(); } }, new Block<ControlFlowNode>() { @Override public void accept(final ControlFlowNode n) { final Set<ControlFlowNode> dominanceFrontier = n.getDominanceFrontier(); dominanceFrontier.clear(); for (final ControlFlowNode s : n.getSuccessors()) { if (s.getImmediateDominator() != n) { dominanceFrontier.add(s); } } for (final ControlFlowNode child : n.getDominatorTreeChildren()) { for (final ControlFlowNode p : child.getDominanceFrontier()) { if (p.getImmediateDominator() != n) { dominanceFrontier.add(p); } } } } } ); }
public final void findConditions(final Block block) { final List<Node> body = block.getBody(); if (body.isEmpty() || block.getEntryGoto() == null) { return; } final ControlFlowGraph graph = buildGraph(body, (Label) block.getEntryGoto().getOperand()); graph.computeDominance(); graph.computeDominanceFrontier(); final Set<ControlFlowNode> cfNodes = new LinkedHashSet<>(); final List<ControlFlowNode> graphNodes = graph.getNodes(); for (int i = 3; i < graphNodes.size(); i++) { cfNodes.add(graphNodes.get(i)); } final List<Node> newBody = findConditions(cfNodes, graph.getEntryPoint()); block.getBody().clear(); block.getBody().addAll(newBody); }
public final void findLoops(final Block block) { final List<Node> body = block.getBody(); if (body.isEmpty() || block.getEntryGoto() == null) { return; } final ControlFlowGraph graph = buildGraph(body, (Label) block.getEntryGoto().getOperand()); graph.computeDominance(); graph.computeDominanceFrontier(); final Set<ControlFlowNode> cfNodes = new LinkedHashSet<>(); final List<ControlFlowNode> graphNodes = graph.getNodes(); for (int i = 3; i < graphNodes.size(); i++) { cfNodes.add(graphNodes.get(i)); } final List<Node> newBody = findLoops(cfNodes, graph.getEntryPoint(), false); block.getBody().clear(); block.getBody().addAll(newBody); }
public final void findLoops(final Block block) { final List<Node> body = block.getBody(); if (body.isEmpty() || block.getEntryGoto() == null) { return; } final ControlFlowGraph graph = buildGraph(body, (Label) block.getEntryGoto().getOperand()); graph.computeDominance(); graph.computeDominanceFrontier(); final Set<ControlFlowNode> cfNodes = new LinkedHashSet<>(); final List<ControlFlowNode> graphNodes = graph.getNodes(); for (int i = 3; i < graphNodes.size(); i++) { cfNodes.add(graphNodes.get(i)); } final List<Node> newBody = findLoops(cfNodes, graph.getEntryPoint(), false); block.getBody().clear(); block.getBody().addAll(newBody); }
public final void findConditions(final Block block) { final List<Node> body = block.getBody(); if (body.isEmpty() || block.getEntryGoto() == null) { return; } final ControlFlowGraph graph = buildGraph(body, (Label) block.getEntryGoto().getOperand()); graph.computeDominance(); graph.computeDominanceFrontier(); final Set<ControlFlowNode> cfNodes = new LinkedHashSet<>(); final List<ControlFlowNode> graphNodes = graph.getNodes(); for (int i = 3; i < graphNodes.size(); i++) { cfNodes.add(graphNodes.get(i)); } final List<Node> newBody = findConditions(cfNodes, graph.getEntryPoint()); block.getBody().clear(); block.getBody().addAll(newBody); }
public final void findConditions(final Block block) { final List<Node> body = block.getBody(); if (body.isEmpty() || block.getEntryGoto() == null) { return; } final ControlFlowGraph graph = buildGraph(body, (Label) block.getEntryGoto().getOperand()); graph.computeDominance(); graph.computeDominanceFrontier(); final Set<ControlFlowNode> cfNodes = new LinkedHashSet<>(); final List<ControlFlowNode> graphNodes = graph.getNodes(); for (int i = 3; i < graphNodes.size(); i++) { cfNodes.add(graphNodes.get(i)); } final List<Node> newBody = findConditions(cfNodes, graph.getEntryPoint()); block.getBody().clear(); block.getBody().addAll(newBody); }
public final void findLoops(final Block block) { final List<Node> body = block.getBody(); if (body.isEmpty() || block.getEntryGoto() == null) { return; } final ControlFlowGraph graph = buildGraph(body, (Label) block.getEntryGoto().getOperand()); graph.computeDominance(); graph.computeDominanceFrontier(); final Set<ControlFlowNode> cfNodes = new LinkedHashSet<>(); final List<ControlFlowNode> graphNodes = graph.getNodes(); for (int i = 3; i < graphNodes.size(); i++) { cfNodes.add(graphNodes.get(i)); } final List<Node> newBody = findLoops(cfNodes, graph.getEntryPoint(), false); block.getBody().clear(); block.getBody().addAll(newBody); }
public ControlFlowGraph(final ControlFlowNode... nodes) { _nodes = ArrayUtilities.asUnmodifiableList(VerifyArgument.noNullElements(nodes, "nodes")); assert nodes.length >= 3; assert getEntryPoint().getNodeType() == ControlFlowNodeType.EntryPoint; assert getRegularExit().getNodeType() == ControlFlowNodeType.RegularExit; assert getExceptionalExit().getNodeType() == ControlFlowNodeType.ExceptionalExit; }
public ControlFlowGraph(final ControlFlowNode... nodes) { _nodes = ArrayUtilities.asUnmodifiableList(VerifyArgument.noNullElements(nodes, "nodes")); assert nodes.length >= 3; assert getEntryPoint().getNodeType() == ControlFlowNodeType.EntryPoint; assert getRegularExit().getNodeType() == ControlFlowNodeType.RegularExit; assert getExceptionalExit().getNodeType() == ControlFlowNodeType.ExceptionalExit; }
public ControlFlowGraph(final ControlFlowNode... nodes) { _nodes = ArrayUtilities.asUnmodifiableList(VerifyArgument.noNullElements(nodes, "nodes")); assert nodes.length >= 3; assert getEntryPoint().getNodeType() == ControlFlowNodeType.EntryPoint; assert getRegularExit().getNodeType() == ControlFlowNodeType.RegularExit; assert getExceptionalExit().getNodeType() == ControlFlowNodeType.ExceptionalExit; }
public final void computeDominance(final BooleanBox cancelled) { final ControlFlowNode entryPoint = getEntryPoint();
public final void computeDominance(final BooleanBox cancelled) { final ControlFlowNode entryPoint = getEntryPoint();
public final void computeDominance(final BooleanBox cancelled) { final ControlFlowNode entryPoint = getEntryPoint();
builder.createEdge(cfg.getEntryPoint(), handlerStartNode, JumpType.Normal);
builder.createEdge(cfg.getEntryPoint(), handlerStartNode, JumpType.Normal);
builder.createEdge(cfg.getEntryPoint(), handlerStartNode, JumpType.Normal);