# HG changeset patch # User Peter Hofer # Date 1309342966 -7200 # Node ID 8551bcfbba9e4d84fc7fc13d66fa5ef1d28c66e2 # Parent f34c90b89f5462bc677ad563005539208d7f007a IdealGraphVisualizer: add another filter that hides slots with no connections diff -r f34c90b89f54 -r 8551bcfbba9e src/share/tools/IdealGraphVisualizer/Graal/src/com/sun/hotspot/igv/graal/filters/GraalSlotFilter.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/share/tools/IdealGraphVisualizer/Graal/src/com/sun/hotspot/igv/graal/filters/GraalSlotFilter.java Wed Jun 29 12:22:46 2011 +0200 @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ +package com.sun.hotspot.igv.graal.filters; + +import com.sun.hotspot.igv.filter.AbstractFilter; +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 com.sun.hotspot.igv.graph.Slot; +import java.util.ArrayList; +import java.util.List; + +/** + * Filter that hides slots with no connections. + */ +public class GraalSlotFilter extends AbstractFilter { + + public GraalSlotFilter() { + } + + public String getName() { + return "Graal Slot Filter"; + } + + public void apply(Diagram d) { + List
figures = d.getFigures(); + for (Figure f : figures) { + List remove = new ArrayList(); + for (InputSlot is : f.getInputSlots()) { + if (is.getConnections().isEmpty()) { + remove.add(is); + } + } + for (OutputSlot os : f.getOutputSlots()) { + if (os.getConnections().isEmpty()) { + remove.add(os); + } + } + for (Slot s : remove) { + f.removeSlot(s); + } + } + } +} diff -r f34c90b89f54 -r 8551bcfbba9e src/share/tools/IdealGraphVisualizer/Graal/src/com/sun/hotspot/igv/graal/filters/slots.filter --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/share/tools/IdealGraphVisualizer/Graal/src/com/sun/hotspot/igv/graal/filters/slots.filter Wed Jun 29 12:22:46 2011 +0200 @@ -0,0 +1,2 @@ +var f = new com.sun.hotspot.igv.graal.filters.GraalSlotFilter(); +f.apply(graph); diff -r f34c90b89f54 -r 8551bcfbba9e src/share/tools/IdealGraphVisualizer/Graal/src/com/sun/hotspot/igv/graal/layer.xml --- a/src/share/tools/IdealGraphVisualizer/Graal/src/com/sun/hotspot/igv/graal/layer.xml Tue Jun 28 19:54:51 2011 +0200 +++ b/src/share/tools/IdealGraphVisualizer/Graal/src/com/sun/hotspot/igv/graal/layer.xml Wed Jun 29 12:22:46 2011 +0200 @@ -9,5 +9,9 @@ + + + +