# HG changeset patch # User Gilles Duboscq # Date 1321452809 -3600 # Node ID ce5841053fc9853d0de654a3b1c73160d1e21a6b # Parent d7e8627a10161ed6c7f19a1f351f682eb5340230 Make CFG filter work better in cooperation with Begin-End reduction diff -r d7e8627a1016 -r ce5841053fc9 src/share/tools/IdealGraphVisualizer/Graal/src/com/sun/hotspot/igv/graal/filters/GraalCFGFilter.java --- a/src/share/tools/IdealGraphVisualizer/Graal/src/com/sun/hotspot/igv/graal/filters/GraalCFGFilter.java Wed Nov 16 13:30:33 2011 +0100 +++ b/src/share/tools/IdealGraphVisualizer/Graal/src/com/sun/hotspot/igv/graal/filters/GraalCFGFilter.java Wed Nov 16 15:13:29 2011 +0100 @@ -41,28 +41,34 @@ } public void apply(Diagram d) { - List
figures = d.getFigures(); Set
figuresToRemove = new HashSet
(); Set connectionsToRemove = new HashSet(); - for (Figure f : figures) { - Properties p = f.getProperties(); - final String prop = p.get("probability"); + for (Figure f : d.getFigures()) { + final String prop = f.getProperties().get("probability"); if (prop == null) { figuresToRemove.add(f); } - + } + d.removeAllFigures(figuresToRemove); + + for (Figure f : d.getFigures()) { + Properties p = f.getProperties(); int predCount = Integer.parseInt(p.get("predecessorCount")); for (InputSlot is : f.getInputSlots()) { - Color color; - if (is.getPosition() >= predCount) { - connectionsToRemove.addAll(is.getConnections()); + if (is.getPosition() >= predCount && !"EndNode".equals(is.getProperties().get("class"))) { + for (Connection c : is.getConnections()) { + if (!"EndNode".equals(c.getOutputSlot().getFigure().getProperties().get("class"))) { + connectionsToRemove.add(c); + } + } } } } - d.removeAllFigures(figuresToRemove); + for (Connection c : connectionsToRemove) { c.remove(); + System.out.println("rm " + c); } } }