# HG changeset patch # User Andreas Woess # Date 1396025506 -3600 # Node ID d786bfc78196ed6b5e3aba027e048e4955fff01d # Parent fdb912b1eb7bdfd85948262a3c11826e0d57ad74 IGV: repair Graal CFG only filter diff -r fdb912b1eb7b -r d786bfc78196 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 Fri Mar 28 15:44:10 2014 +0100 +++ b/src/share/tools/IdealGraphVisualizer/Graal/src/com/sun/hotspot/igv/graal/filters/GraalCFGFilter.java Fri Mar 28 17:51:46 2014 +0100 @@ -29,11 +29,12 @@ import com.sun.hotspot.igv.graph.Diagram; import com.sun.hotspot.igv.graph.Figure; import com.sun.hotspot.igv.graph.InputSlot; +import com.sun.hotspot.igv.graph.OutputSlot; import java.util.HashSet; import java.util.Set; public class GraalCFGFilter extends AbstractFilter { - + @Override public String getName() { return "Graal CFG Filter"; @@ -41,16 +42,8 @@ @Override public void apply(Diagram d) { - Set
figuresToRemove = new HashSet<>(); Set connectionsToRemove = new HashSet<>(); - 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; @@ -72,10 +65,25 @@ } } } - + for (Connection c : connectionsToRemove) { c.remove(); - System.out.println("rm " + c); } + + Set
figuresToRemove = new HashSet<>(); + next: for (Figure f : d.getFigures()) { + for (InputSlot is : f.getInputSlots()) { + if (!is.getConnections().isEmpty()) { + continue next; + } + } + for (OutputSlot os : f.getOutputSlots()) { + if (!os.getConnections().isEmpty()) { + continue next; + } + } + figuresToRemove.add(f); + } + d.removeAllFigures(figuresToRemove); } }