# HG changeset patch # User never # Date 1225411728 25200 # Node ID cd3234c89e5912ffb36b38a0207f4f7066345ed1 # Parent 3fd9157e5e3ce513db8d2472304bde0192c9f05c 6764622: IdealGraphVisualizer fixes Reviewed-by: rasbold, jrose diff -r 3fd9157e5e3c -r cd3234c89e59 hotspot/src/share/tools/IdealGraphVisualizer/Bytecodes/src/com/sun/hotspot/igv/bytecodes/BytecodeViewTopComponent.java --- a/hotspot/src/share/tools/IdealGraphVisualizer/Bytecodes/src/com/sun/hotspot/igv/bytecodes/BytecodeViewTopComponent.java Tue Oct 28 18:02:09 2008 -0700 +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Bytecodes/src/com/sun/hotspot/igv/bytecodes/BytecodeViewTopComponent.java Thu Oct 30 17:08:48 2008 -0700 @@ -28,6 +28,7 @@ import com.sun.hotspot.igv.data.services.InputGraphProvider; import java.awt.BorderLayout; import java.io.Serializable; +import javax.swing.SwingUtilities; import org.openide.ErrorManager; import org.openide.explorer.ExplorerManager; import org.openide.explorer.ExplorerUtils; @@ -151,14 +152,18 @@ } public void resultChanged(LookupEvent lookupEvent) { - InputGraphProvider p = Lookup.getDefault().lookup(InputGraphProvider.class); + final InputGraphProvider p = Lookup.getDefault().lookup(InputGraphProvider.class); if (p != null) { + SwingUtilities.invokeLater(new Runnable() { + public void run() { InputGraph graph = p.getGraph(); if (graph != null) { Group g = graph.getGroup(); rootNode.update(graph, g.getMethod()); } } + }); + } } final static class ResolvableHelper implements Serializable { diff -r 3fd9157e5e3c -r cd3234c89e59 hotspot/src/share/tools/IdealGraphVisualizer/ControlFlow/src/com/sun/hotspot/igv/controlflow/ControlFlowScene.java --- a/hotspot/src/share/tools/IdealGraphVisualizer/ControlFlow/src/com/sun/hotspot/igv/controlflow/ControlFlowScene.java Tue Oct 28 18:02:09 2008 -0700 +++ b/hotspot/src/share/tools/IdealGraphVisualizer/ControlFlow/src/com/sun/hotspot/igv/controlflow/ControlFlowScene.java Thu Oct 30 17:08:48 2008 -0700 @@ -33,7 +33,7 @@ import java.awt.Rectangle; import java.util.ArrayList; import java.util.HashSet; -import java.util.Hashtable; +import java.util.HashMap; import java.util.Set; import javax.swing.BorderFactory; import org.netbeans.api.visual.action.ActionFactory; @@ -44,7 +44,6 @@ import org.netbeans.api.visual.action.WidgetAction; import org.netbeans.api.visual.anchor.AnchorFactory; import org.netbeans.api.visual.anchor.AnchorShape; -import com.sun.hotspot.igv.controlflow.HierarchicalGraphLayout; import org.netbeans.api.visual.layout.LayoutFactory; import org.netbeans.api.visual.router.RouterFactory; import org.netbeans.api.visual.widget.LayerWidget; @@ -61,8 +60,8 @@ */ public class ControlFlowScene extends GraphScene implements SelectProvider, MoveProvider, RectangularSelectDecorator, RectangularSelectProvider { - private Set selection; - private Hashtable blockMap; + private HashSet selection; + private HashMap blockMap; private InputGraph oldGraph; private LayerWidget edgeLayer; private LayerWidget mainLayer; diff -r 3fd9157e5e3c -r cd3234c89e59 hotspot/src/share/tools/IdealGraphVisualizer/ControlFlow/src/com/sun/hotspot/igv/controlflow/ControlFlowTopComponent.java --- a/hotspot/src/share/tools/IdealGraphVisualizer/ControlFlow/src/com/sun/hotspot/igv/controlflow/ControlFlowTopComponent.java Tue Oct 28 18:02:09 2008 -0700 +++ b/hotspot/src/share/tools/IdealGraphVisualizer/ControlFlow/src/com/sun/hotspot/igv/controlflow/ControlFlowTopComponent.java Thu Oct 30 17:08:48 2008 -0700 @@ -28,6 +28,7 @@ import java.awt.BorderLayout; import java.io.Serializable; import javax.swing.JScrollPane; +import javax.swing.SwingUtilities; import org.openide.ErrorManager; import org.openide.util.Lookup; import org.openide.util.LookupEvent; @@ -143,13 +144,17 @@ public void resultChanged(LookupEvent lookupEvent) { - InputGraphProvider p = Lookup.getDefault().lookup(InputGraphProvider.class); + final InputGraphProvider p = Lookup.getDefault().lookup(InputGraphProvider.class); if (p != null) { + SwingUtilities.invokeLater(new Runnable() { + public void run() { InputGraph g = p.getGraph(); if (g != null) { scene.setGraph(g); } } + }); + } } @Override diff -r 3fd9157e5e3c -r cd3234c89e59 hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/FolderNode.java --- a/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/FolderNode.java Tue Oct 28 18:02:09 2008 -0700 +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/FolderNode.java Thu Oct 30 17:08:48 2008 -0700 @@ -24,6 +24,7 @@ package com.sun.hotspot.igv.coordinator; import com.sun.hotspot.igv.coordinator.actions.RemoveCookie; +import com.sun.hotspot.igv.data.ChangedListener; import com.sun.hotspot.igv.data.Group; import com.sun.hotspot.igv.data.services.GroupOrganizer; import com.sun.hotspot.igv.data.InputGraph; @@ -50,17 +51,24 @@ private List subFolders; private FolderChildren children; - private static class FolderChildren extends Children.Keys { + private static class FolderChildren extends Children.Keys implements ChangedListener { private FolderNode parent; + private List registeredGroups; public void setParent(FolderNode parent) { this.parent = parent; + this.registeredGroups = new ArrayList(); } @Override protected Node[] createNodes(Object arg0) { + for(Group g : registeredGroups) { + g.getChangedEvent().removeListener(this); + } + registeredGroups.clear(); + Pair> p = (Pair>) arg0; if (p.getLeft().length() == 0) { @@ -69,6 +77,8 @@ for (InputGraph graph : g.getGraphs()) { curNodes.add(new GraphNode(graph)); } + g.getChangedEvent().addListener(this); + registeredGroups.add(g); } Node[] result = new Node[curNodes.size()]; @@ -85,7 +95,13 @@ @Override public void addNotify() { this.setKeys(parent.structure); + } + public void changed(Group source) { + List>> newStructure = new ArrayList>>(); + for(Pair> p : parent.structure) { + refreshKey(p); + } } } diff -r 3fd9157e5e3c -r cd3234c89e59 hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/GraphDocument.java --- a/hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/GraphDocument.java Tue Oct 28 18:02:09 2008 -0700 +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/GraphDocument.java Thu Oct 30 17:08:48 2008 -0700 @@ -31,7 +31,7 @@ * * @author Thomas Wuerthinger */ -public class GraphDocument extends Properties.Object implements ChangedEventProvider { +public class GraphDocument extends Properties.Entity implements ChangedEventProvider { private List groups; private ChangedEvent changedEvent; diff -r 3fd9157e5e3c -r cd3234c89e59 hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/Group.java --- a/hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/Group.java Tue Oct 28 18:02:09 2008 -0700 +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/Group.java Thu Oct 30 17:08:48 2008 -0700 @@ -37,7 +37,7 @@ * * @author Thomas Wuerthinger */ -public class Group extends Properties.Object implements ChangedEventProvider { +public class Group extends Properties.Entity implements ChangedEventProvider { private List graphs; private transient ChangedEvent changedEvent; diff -r 3fd9157e5e3c -r cd3234c89e59 hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/InputGraph.java --- a/hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/InputGraph.java Tue Oct 28 18:02:09 2008 -0700 +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/InputGraph.java Thu Oct 30 17:08:48 2008 -0700 @@ -23,26 +23,25 @@ */ package com.sun.hotspot.igv.data; -import com.sun.hotspot.igv.data.Properties; +import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.HashSet; -import java.util.Hashtable; +import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Set; /** * * @author Thomas Wuerthinger */ -public class InputGraph extends Properties.Object { +public class InputGraph extends Properties.Entity { - private Map nodes; - private Set edges; + private HashMap nodes; + private ArrayList edges; private Group parent; - private Map blocks; - private Map nodeToBlock; + private HashMap blocks; + private HashMap nodeToBlock; private boolean isDifferenceGraph; public InputGraph(Group parent) { @@ -61,10 +60,10 @@ public InputGraph(Group parent, InputGraph last, String name) { this.parent = parent; setName(name); - nodes = new Hashtable(); - edges = new HashSet(); - blocks = new Hashtable(); - nodeToBlock = new Hashtable(); + nodes = new HashMap(); + edges = new ArrayList(); + blocks = new HashMap(); + nodeToBlock = new HashMap(); if (last != null) { for (InputNode n : last.getNodes()) { @@ -182,8 +181,8 @@ return nodes.remove(index); } - public Set getEdges() { - return Collections.unmodifiableSet(edges); + public Collection getEdges() { + return Collections.unmodifiableList(edges); } public void removeEdge(InputEdge c) { diff -r 3fd9157e5e3c -r cd3234c89e59 hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/InputMethod.java --- a/hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/InputMethod.java Tue Oct 28 18:02:09 2008 -0700 +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/InputMethod.java Thu Oct 30 17:08:48 2008 -0700 @@ -32,7 +32,7 @@ * * @author Thomas Wuerthinger */ -public class InputMethod extends Properties.Object { +public class InputMethod extends Properties.Entity { private String name; private int bci; diff -r 3fd9157e5e3c -r cd3234c89e59 hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/InputNode.java --- a/hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/InputNode.java Tue Oct 28 18:02:09 2008 -0700 +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/InputNode.java Thu Oct 30 17:08:48 2008 -0700 @@ -27,7 +27,7 @@ * * @author Thomas Wuerthinger */ -public class InputNode extends Properties.Object { +public class InputNode extends Properties.Entity { private int id; diff -r 3fd9157e5e3c -r cd3234c89e59 hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/Properties.java --- a/hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/Properties.java Tue Oct 28 18:02:09 2008 -0700 +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/Properties.java Thu Oct 30 17:08:48 2008 -0700 @@ -26,24 +26,22 @@ import java.io.Serializable; import java.util.ArrayList; import java.util.Collection; -import java.util.Collections; -import java.util.HashMap; +import java.util.Iterator; import java.util.List; -import java.util.Map; import java.util.regex.Matcher; import java.util.regex.Pattern; + /** * * @author Thomas Wuerthinger */ -public class Properties implements Serializable { +public class Properties implements Serializable, Iterable { public static final long serialVersionUID = 1L; - private Map map; + private String[] map = new String[4]; public Properties() { - map = new HashMap(5); } @Override @@ -54,10 +52,7 @@ Properties p = (Properties) o; - if (getProperties().size() != p.getProperties().size()) { - return false; - } - for (Property prop : getProperties()) { + for (Property prop : this) { String value = p.get(prop.getName()); if (value == null || !value.equals(prop.getValue())) { return false; @@ -75,32 +70,33 @@ public Properties(String name, String value) { this(); - this.add(new Property(name, value)); + this.setProperty(name, value); } public Properties(String name, String value, String name1, String value1) { this(name, value); - this.add(new Property(name1, value1)); + this.setProperty(name1, value1); } public Properties(String name, String value, String name1, String value1, String name2, String value2) { this(name, value, name1, value1); - this.add(new Property(name2, value2)); + this.setProperty(name2, value2); } public Properties(Properties p) { - map = new HashMap(p.map); + map = new String[p.map.length]; + System.arraycopy(map, 0, p.map, 0, p.map.length); } - public static class Object implements Provider { + public static class Entity implements Provider { private Properties properties; - public Object() { + public Entity() { properties = new Properties(); } - public Object(Properties.Object object) { + public Entity(Properties.Entity object) { properties = new Properties(object.getProperties()); } @@ -109,6 +105,14 @@ } } + private String getProperty(String key) { + for (int i = 0; i < map.length; i += 2) + if (map[i] != null && map[i].equals(key)) { + return map[i + 1]; + } + return null; + } + public interface PropertyMatcher { String getName(); @@ -173,13 +177,15 @@ } public Property selectSingle(PropertyMatcher matcher) { - - Property p = this.map.get(matcher.getName()); - if (p == null) { - return null; + String value = null; + for (int i = 0; i < map.length; i += 2) { + if (map[i] != null && matcher.getName().equals(map[i])) { + value = map[i + 1]; + break; + } } - if (matcher.match(p.getValue())) { - return p; + if (value != null && matcher.match(value)) { + return new Property(matcher.getName(), value); } else { return null; } @@ -194,8 +200,11 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("["); - for (Property p : map.values()) { - sb.append(p.toString()); + for (int i = 0; i < map.length; i += 2) { + if (map[i + 1] != null) { + String p = map[i + 1]; + sb.append(map[i] + " = " + map[i + 1] + "; "); + } } return sb.append("]").toString(); } @@ -241,41 +250,51 @@ } public String get(String key) { - Property p = map.get(key); - if (p == null) { - return null; - } else { - return p.getValue(); + for (int i = 0; i < map.length; i += 2) { + if (map[i] != null && map[i].equals(key)) { + return map[i + 1]; + } } - } - - public String getProperty(String string) { - return get(string); + return null; } - public Property setProperty(String name, String value) { - + public void setProperty(String name, String value) { + for (int i = 0; i < map.length; i += 2) { + if (map[i] != null && map[i].equals(name)) { + String p = map[i + 1]; + if (value == null) { + // remove this property + map[i] = null; + map[i + 1] = null; + } else { + map[i + 1] = value; + } + return; + } + } if (value == null) { - // remove this property - return map.remove(name); - } else { - Property p = map.get(name); - if (p == null) { - p = new Property(name, value); - map.put(name, p); - } else { - p.setValue(value); + return; + } + for (int i = 0; i < map.length; i += 2) { + if (map[i] == null) { + map[i] = name; + map[i + 1] = value; + return; } - return p; } + String[] newMap = new String[map.length + 4]; + System.arraycopy(map, 0, newMap, 0, map.length); + newMap[map.length] = name; + newMap[map.length + 1] = value; + map = newMap; } - public Collection getProperties() { - return Collections.unmodifiableCollection(map.values()); + public Iterator getProperties() { + return iterator(); } public void add(Properties properties) { - for (Property p : properties.getProperties()) { + for (Property p : properties) { add(p); } } @@ -283,6 +302,35 @@ public void add(Property property) { assert property.getName() != null; assert property.getValue() != null; - map.put(property.getName(), property); + setProperty(property.getName(), property.getValue()); + } + class PropertiesIterator implements Iterator, Iterable { + public Iterator iterator() { + return this; + } + + int index; + + public boolean hasNext() { + while (index < map.length && map[index + 1] == null) + index += 2; + return index < map.length; + } + + public Property next() { + if (index < map.length) { + index += 2; + return new Property(map[index - 2], map[index - 1]); + } + return null; + } + + public void remove() { + throw new UnsupportedOperationException("Not supported yet."); + } + + } + public Iterator iterator() { + return new PropertiesIterator(); } } diff -r 3fd9157e5e3c -r cd3234c89e59 hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/Property.java --- a/hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/Property.java Tue Oct 28 18:02:09 2008 -0700 +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/Property.java Thu Oct 30 17:08:48 2008 -0700 @@ -32,18 +32,19 @@ public class Property implements Serializable { public static final long serialVersionUID = 1L; + private String name; private String value; - public Property() { + private Property() { this(null, null); } - public Property(Property p) { + private Property(Property p) { this(p.getName(), p.getValue()); } - public Property(String name) { + private Property(String name) { this(name, null); } @@ -60,16 +61,19 @@ return value; } - public void setName(String s) { - this.name = s; - } - - public void setValue(String s) { - this.value = s; - } - @Override public String toString() { return name + " = " + value + "; "; } + + @Override + public boolean equals(Object o) { + if (!(o instanceof Property)) return false; + Property p2 = (Property)o; + return name.equals(p2.name) && value.equals(p2.value); + } + @Override + public int hashCode() { + return name.hashCode() + value == null ? 0 : value.hashCode(); + } } diff -r 3fd9157e5e3c -r cd3234c89e59 hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/serialization/Parser.java --- a/hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/serialization/Parser.java Tue Oct 28 18:02:09 2008 -0700 +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/serialization/Parser.java Thu Oct 30 17:08:48 2008 -0700 @@ -38,6 +38,7 @@ import com.sun.hotspot.igv.data.serialization.XMLParser.ParseMonitor; import com.sun.hotspot.igv.data.serialization.XMLParser.TopElementHandler; import java.io.IOException; +import java.util.HashMap; import org.xml.sax.InputSource; import org.xml.sax.SAXException; import org.xml.sax.XMLReader; @@ -88,6 +89,18 @@ private TopElementHandler xmlDocument = new TopElementHandler(); private boolean difference; private GroupCallback groupCallback; + private HashMap idCache = new HashMap(); + private int maxId = 0; + + private int lookupID(String i) { + Integer id = idCache.get(i); + if (id == null) { + id = maxId++; + idCache.put(i, id); + } + return id.intValue(); + } + // private ElementHandler topHandler = new ElementHandler(TOP_ELEMENT) { @@ -187,13 +200,13 @@ previous = null; } InputGraph curGraph = new InputGraph(getParentObject(), previous, name); - getParentObject().addGraph(curGraph); this.graph = curGraph; return curGraph; } @Override protected void end(String text) throws SAXException { + getParentObject().addGraph(graph); graph.resolveBlockLinks(); } }; @@ -207,7 +220,7 @@ @Override protected InputBlock start() throws SAXException { InputGraph graph = getParentObject(); - String name = readRequiredAttribute(BLOCK_NAME_PROPERTY); + String name = readRequiredAttribute(BLOCK_NAME_PROPERTY).intern(); InputBlock b = new InputBlock(getParentObject(), name); graph.addBlock(b); return b; @@ -224,7 +237,7 @@ int id = 0; try { - id = Integer.parseInt(s); + id = lookupID(s); } catch (NumberFormatException e) { throw new SAXException(e); } @@ -252,7 +265,7 @@ String s = readRequiredAttribute(NODE_ID_PROPERTY); int id = 0; try { - id = Integer.parseInt(s); + id = lookupID(s); } catch (NumberFormatException e) { throw new SAXException(e); } @@ -269,7 +282,7 @@ String s = readRequiredAttribute(NODE_ID_PROPERTY); int id = 0; try { - id = Integer.parseInt(s); + id = lookupID(s); } catch (NumberFormatException e) { throw new SAXException(e); } @@ -280,7 +293,7 @@ private HandoverElementHandler edgesHandler = new HandoverElementHandler(EDGES_ELEMENT); // Local class for edge elements - private static class EdgeElementHandler extends ElementHandler { + private class EdgeElementHandler extends ElementHandler { public EdgeElementHandler(String name) { super(name); @@ -298,8 +311,8 @@ toIndex = Integer.parseInt(toIndexString); } - from = Integer.parseInt(readRequiredAttribute(FROM_PROPERTY)); - to = Integer.parseInt(readRequiredAttribute(TO_PROPERTY)); + from = lookupID(readRequiredAttribute(FROM_PROPERTY)); + to = lookupID(readRequiredAttribute(TO_PROPERTY)); } catch (NumberFormatException e) { throw new SAXException(e); } @@ -344,18 +357,16 @@ } }; // - private ElementHandler propertyHandler = new XMLParser.ElementHandler(PROPERTY_ELEMENT, true) { + private ElementHandler propertyHandler = new XMLParser.ElementHandler(PROPERTY_ELEMENT, true) { @Override - public Property start() throws SAXException { - String value = ""; - String name = readRequiredAttribute(PROPERTY_NAME_PROPERTY).intern(); - return getParentObject().getProperties().setProperty(name, value); + public String start() throws SAXException { + return readRequiredAttribute(PROPERTY_NAME_PROPERTY).intern(); } @Override public void end(String text) { - getObject().setValue(text.trim().intern()); + getParentObject().getProperties().setProperty(getObject(), text.trim().intern()); } }; diff -r 3fd9157e5e3c -r cd3234c89e59 hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/serialization/Printer.java --- a/hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/serialization/Printer.java Tue Oct 28 18:02:09 2008 -0700 +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/serialization/Printer.java Thu Oct 30 17:08:48 2008 -0700 @@ -67,7 +67,7 @@ private void export(XMLWriter writer, Group g) throws IOException { Properties attributes = new Properties(); - attributes.add(new Property("difference", Boolean.toString(true))); + attributes.setProperty("difference", Boolean.toString(true)); writer.startTag(Parser.GROUP_ELEMENT, attributes); writer.writeProperties(g.getProperties()); diff -r 3fd9157e5e3c -r cd3234c89e59 hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/serialization/XMLParser.java --- a/hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/serialization/XMLParser.java Tue Oct 28 18:02:09 2008 -0700 +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/serialization/XMLParser.java Thu Oct 30 17:08:48 2008 -0700 @@ -25,7 +25,7 @@ import com.sun.hotspot.igv.data.Property; import com.sun.hotspot.igv.data.Properties; -import java.util.Hashtable; +import java.util.HashMap; import java.util.Stack; import org.xml.sax.Attributes; import org.xml.sax.ContentHandler; @@ -89,7 +89,7 @@ private Attributes attr; private StringBuilder currentText; private ParseMonitor monitor; - private Hashtable> hashtable; + private HashMap> hashtable; private boolean needsText; private ElementHandler parentElement; @@ -110,7 +110,7 @@ } public ElementHandler(String name, boolean needsText) { - this.hashtable = new Hashtable>(); + this.hashtable = new HashMap>(); this.name = name; this.needsText = needsText; } @@ -153,7 +153,7 @@ for (int i = 0; i < length; i++) { String val = attr.getValue(i).intern(); String localName = attr.getLocalName(i).intern(); - p.add(new Property(val, localName)); + p.setProperty(val, localName); } } diff -r 3fd9157e5e3c -r cd3234c89e59 hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/serialization/XMLWriter.java --- a/hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/serialization/XMLWriter.java Tue Oct 28 18:02:09 2008 -0700 +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/serialization/XMLWriter.java Thu Oct 30 17:08:48 2008 -0700 @@ -89,7 +89,7 @@ inner.write("<" + name); elementStack.push(name); - for (Property p : attributes.getProperties()) { + for (Property p : attributes) { inner.write(" " + p.getName() + "=\""); write(p.getValue().toCharArray()); inner.write("\""); @@ -101,7 +101,7 @@ public void simpleTag(String name, Properties attributes) throws IOException { inner.write("<" + name); - for (Property p : attributes.getProperties()) { + for (Property p : attributes) { inner.write(" " + p.getName() + "=\""); write(p.getValue().toCharArray()); inner.write("\""); @@ -111,13 +111,13 @@ } public void writeProperties(Properties props) throws IOException { - if (props.getProperties().size() == 0) { + if (props.getProperties().hasNext() == false) { return; } startTag(Parser.PROPERTIES_ELEMENT); - for (Property p : props.getProperties()) { + for (Property p : props) { startTag(Parser.PROPERTY_ELEMENT, new Properties(Parser.PROPERTY_NAME_PROPERTY, p.getName())); this.write(p.getValue().toCharArray()); endTag(); diff -r 3fd9157e5e3c -r cd3234c89e59 hotspot/src/share/tools/IdealGraphVisualizer/Difference/src/com/sun/hotspot/igv/difference/Difference.java --- a/hotspot/src/share/tools/IdealGraphVisualizer/Difference/src/com/sun/hotspot/igv/difference/Difference.java Tue Oct 28 18:02:09 2008 -0700 +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Difference/src/com/sun/hotspot/igv/difference/Difference.java Thu Oct 30 17:08:48 2008 -0700 @@ -29,6 +29,7 @@ import com.sun.hotspot.igv.data.InputGraph; import com.sun.hotspot.igv.data.InputNode; import com.sun.hotspot.igv.data.Property; +import java.util.Collection; import java.util.HashMap; import java.util.HashSet; import java.util.Map; @@ -124,8 +125,8 @@ inputNodeMap.put(n, n2); } - Set edgesA = a.getEdges(); - Set edgesB = b.getEdges(); + Collection edgesA = a.getEdges(); + Collection edgesB = b.getEdges(); Set newEdges = new HashSet(); @@ -182,7 +183,7 @@ public double getValue() { double result = 0.0; - for (Property p : n1.getProperties().getProperties()) { + for (Property p : n1.getProperties()) { double faktor = 1.0; for (String forbidden : IGNORE_PROPERTIES) { if (p.getName().equals(forbidden)) { @@ -287,34 +288,34 @@ private static void markAsChanged(InputNode n, InputNode firstNode, InputNode otherNode) { boolean difference = false; - for (Property p : otherNode.getProperties().getProperties()) { - String s = firstNode.getProperties().getProperty(p.getName()); + for (Property p : otherNode.getProperties()) { + String s = firstNode.getProperties().get(p.getName()); if (!p.getValue().equals(s)) { difference = true; - n.getProperties().add(new Property(OLD_PREFIX + p.getName(), p.getValue())); + n.getProperties().setProperty(OLD_PREFIX + p.getName(), p.getValue()); } } - for (Property p : firstNode.getProperties().getProperties()) { - String s = otherNode.getProperties().getProperty(p.getName()); + for (Property p : firstNode.getProperties()) { + String s = otherNode.getProperties().get(p.getName()); if (s == null && p.getValue().length() > 0) { difference = true; - n.getProperties().add(new Property(OLD_PREFIX + p.getName(), "")); + n.getProperties().setProperty(OLD_PREFIX + p.getName(), ""); } } if (difference) { - n.getProperties().add(new Property(PROPERTY_STATE, VALUE_CHANGED)); + n.getProperties().setProperty(PROPERTY_STATE, VALUE_CHANGED); } else { - n.getProperties().add(new Property(PROPERTY_STATE, VALUE_SAME)); + n.getProperties().setProperty(PROPERTY_STATE, VALUE_SAME); } } private static void markAsDeleted(InputNode n) { - n.getProperties().add(new Property(PROPERTY_STATE, VALUE_DELETED)); + n.getProperties().setProperty(PROPERTY_STATE, VALUE_DELETED); } private static void markAsNew(InputNode n) { - n.getProperties().add(new Property(PROPERTY_STATE, VALUE_NEW)); + n.getProperties().setProperty(PROPERTY_STATE, VALUE_NEW); } } diff -r 3fd9157e5e3c -r cd3234c89e59 hotspot/src/share/tools/IdealGraphVisualizer/Filter/manifest.mf --- a/hotspot/src/share/tools/IdealGraphVisualizer/Filter/manifest.mf Tue Oct 28 18:02:09 2008 -0700 +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Filter/manifest.mf Thu Oct 30 17:08:48 2008 -0700 @@ -1,6 +1,6 @@ -Manifest-Version: 1.0 -OpenIDE-Module: com.sun.hotspot.igv.filter -OpenIDE-Module-Layer: com/sun/hotspot/igv/filter/layer.xml -OpenIDE-Module-Localizing-Bundle: com/sun/hotspot/igv/filter/Bundle.properties -OpenIDE-Module-Specification-Version: 1.0 - +Manifest-Version: 1.0 +OpenIDE-Module: com.sun.hotspot.igv.filter +OpenIDE-Module-Layer: com/sun/hotspot/igv/filter/layer.xml +OpenIDE-Module-Localizing-Bundle: com/sun/hotspot/igv/filter/Bundle.properties +OpenIDE-Module-Specification-Version: 1.0 + diff -r 3fd9157e5e3c -r cd3234c89e59 hotspot/src/share/tools/IdealGraphVisualizer/Filter/src/com/sun/hotspot/igv/filter/CustomFilter.java --- a/hotspot/src/share/tools/IdealGraphVisualizer/Filter/src/com/sun/hotspot/igv/filter/CustomFilter.java Tue Oct 28 18:02:09 2008 -0700 +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Filter/src/com/sun/hotspot/igv/filter/CustomFilter.java Thu Oct 30 17:08:48 2008 -0700 @@ -25,7 +25,6 @@ package com.sun.hotspot.igv.filter; import com.sun.hotspot.igv.graph.Diagram; -import com.sun.hotspot.igv.data.Property; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; @@ -56,7 +55,7 @@ public CustomFilter(String name, String code) { this.name = name; this.code = code; - getProperties().add(new Property("name", name)); + getProperties().setProperty("name", name); } public String getName() { diff -r 3fd9157e5e3c -r cd3234c89e59 hotspot/src/share/tools/IdealGraphVisualizer/Filter/src/com/sun/hotspot/igv/filter/SplitFilter.java --- a/hotspot/src/share/tools/IdealGraphVisualizer/Filter/src/com/sun/hotspot/igv/filter/SplitFilter.java Tue Oct 28 18:02:09 2008 -0700 +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Filter/src/com/sun/hotspot/igv/filter/SplitFilter.java Thu Oct 30 17:08:48 2008 -0700 @@ -56,8 +56,8 @@ for (OutputSlot os : f.getOutputSlots()) { for (Connection c : os.getConnections()) { InputSlot is = c.getInputSlot(); - is.setName(f.getProperties().getProperty("dump_spec")); - String s = f.getProperties().getProperty("short_name"); + is.setName(f.getProperties().get("dump_spec")); + String s = f.getProperties().get("short_name"); if (s != null) { is.setShortName(s); } diff -r 3fd9157e5e3c -r cd3234c89e59 hotspot/src/share/tools/IdealGraphVisualizer/Graph/src/com/sun/hotspot/igv/graph/Diagram.java --- a/hotspot/src/share/tools/IdealGraphVisualizer/Graph/src/com/sun/hotspot/igv/graph/Diagram.java Tue Oct 28 18:02:09 2008 -0700 +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Graph/src/com/sun/hotspot/igv/graph/Diagram.java Thu Oct 30 17:08:48 2008 -0700 @@ -35,7 +35,7 @@ import java.util.Comparator; import java.util.HashMap; import java.util.HashSet; -import java.util.Hashtable; +import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Set; @@ -126,7 +126,7 @@ d.updateBlocks(); Collection nodes = graph.getNodes(); - Hashtable figureHash = new Hashtable(); + HashMap figureHash = new HashMap(); for (InputNode n : nodes) { Figure f = d.createFigure(); f.getSource().addSourceNode(n); diff -r 3fd9157e5e3c -r cd3234c89e59 hotspot/src/share/tools/IdealGraphVisualizer/Graph/src/com/sun/hotspot/igv/graph/Figure.java --- a/hotspot/src/share/tools/IdealGraphVisualizer/Graph/src/com/sun/hotspot/igv/graph/Figure.java Tue Oct 28 18:02:09 2008 -0700 +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Graph/src/com/sun/hotspot/igv/graph/Figure.java Thu Oct 30 17:08:48 2008 -0700 @@ -42,7 +42,7 @@ * * @author Thomas Wuerthinger */ -public class Figure extends Properties.Object implements Source.Provider, Vertex { +public class Figure extends Properties.Entity implements Source.Provider, Vertex { public static final int INSET = 6; public static final int SLOT_WIDTH = 10; diff -r 3fd9157e5e3c -r cd3234c89e59 hotspot/src/share/tools/IdealGraphVisualizer/HierarchicalLayout/src/com/sun/hotspot/igv/hierarchicallayout/Graph.java --- a/hotspot/src/share/tools/IdealGraphVisualizer/HierarchicalLayout/src/com/sun/hotspot/igv/hierarchicallayout/Graph.java Tue Oct 28 18:02:09 2008 -0700 +++ b/hotspot/src/share/tools/IdealGraphVisualizer/HierarchicalLayout/src/com/sun/hotspot/igv/hierarchicallayout/Graph.java Thu Oct 30 17:08:48 2008 -0700 @@ -26,7 +26,7 @@ import java.util.ArrayList; import java.util.Collection; import java.util.Collections; -import java.util.Hashtable; +import java.util.HashMap; import java.util.LinkedList; import java.util.List; import java.util.Queue; @@ -37,13 +37,13 @@ */ public class Graph { - private Hashtable> nodes; - private Hashtable> edges; + private HashMap> nodes; + private HashMap> edges; private List> nodeList; public Graph() { - nodes = new Hashtable>(); - edges = new Hashtable>(); + nodes = new HashMap>(); + edges = new HashMap>(); nodeList = new ArrayList>(); } diff -r 3fd9157e5e3c -r cd3234c89e59 hotspot/src/share/tools/IdealGraphVisualizer/HierarchicalLayout/src/com/sun/hotspot/igv/hierarchicallayout/HierarchicalClusterLayoutManager.java --- a/hotspot/src/share/tools/IdealGraphVisualizer/HierarchicalLayout/src/com/sun/hotspot/igv/hierarchicallayout/HierarchicalClusterLayoutManager.java Tue Oct 28 18:02:09 2008 -0700 +++ b/hotspot/src/share/tools/IdealGraphVisualizer/HierarchicalLayout/src/com/sun/hotspot/igv/hierarchicallayout/HierarchicalClusterLayoutManager.java Thu Oct 30 17:08:48 2008 -0700 @@ -25,7 +25,7 @@ import java.awt.Point; import java.awt.Rectangle; -import java.util.Hashtable; +import java.util.HashMap; import java.util.List; import java.util.Set; import java.util.ArrayList; @@ -69,19 +69,19 @@ assert graph.verify(); - Hashtable> lists = new Hashtable>(); - Hashtable> listsConnection = new Hashtable>(); - Hashtable> clusterInputSlotHash = new Hashtable>(); - Hashtable> clusterOutputSlotHash = new Hashtable>(); + HashMap> lists = new HashMap>(); + HashMap> listsConnection = new HashMap>(); + HashMap> clusterInputSlotHash = new HashMap>(); + HashMap> clusterOutputSlotHash = new HashMap>(); - Hashtable clusterNodes = new Hashtable(); - Hashtable> clusterInputSlotSet = new Hashtable>(); - Hashtable> clusterOutputSlotSet = new Hashtable>(); + HashMap clusterNodes = new HashMap(); + HashMap> clusterInputSlotSet = new HashMap>(); + HashMap> clusterOutputSlotSet = new HashMap>(); Set clusterEdges = new HashSet(); Set interClusterEdges = new HashSet(); - Hashtable linkClusterOutgoingConnection = new Hashtable(); - Hashtable linkInterClusterConnection = new Hashtable(); - Hashtable linkClusterIngoingConnection = new Hashtable(); + HashMap linkClusterOutgoingConnection = new HashMap(); + HashMap linkInterClusterConnection = new HashMap(); + HashMap linkClusterIngoingConnection = new HashMap(); Set clusterNodeSet = new HashSet(); Set cluster = graph.getClusters(); @@ -89,8 +89,8 @@ for (Cluster c : cluster) { lists.put(c, new ArrayList()); listsConnection.put(c, new ArrayList()); - clusterInputSlotHash.put(c, new Hashtable()); - clusterOutputSlotHash.put(c, new Hashtable()); + clusterInputSlotHash.put(c, new HashMap()); + clusterOutputSlotHash.put(c, new HashMap()); clusterOutputSlotSet.put(c, new TreeSet()); clusterInputSlotSet.put(c, new TreeSet()); ClusterNode cn = new ClusterNode(c, "" + z); diff -r 3fd9157e5e3c -r cd3234c89e59 hotspot/src/share/tools/IdealGraphVisualizer/Layout/src/com/sun/hotspot/igv/layout/LayoutGraph.java --- a/hotspot/src/share/tools/IdealGraphVisualizer/Layout/src/com/sun/hotspot/igv/layout/LayoutGraph.java Tue Oct 28 18:02:09 2008 -0700 +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Layout/src/com/sun/hotspot/igv/layout/LayoutGraph.java Thu Oct 30 17:08:48 2008 -0700 @@ -24,7 +24,7 @@ package com.sun.hotspot.igv.layout; import java.util.HashSet; -import java.util.Hashtable; +import java.util.HashMap; import java.util.Set; import java.util.SortedSet; import java.util.TreeSet; @@ -37,9 +37,9 @@ private Set links; private SortedSet vertices; - private Hashtable> inputPorts; - private Hashtable> outputPorts; - private Hashtable> portLinks; + private HashMap> inputPorts; + private HashMap> outputPorts; + private HashMap> portLinks; public LayoutGraph(Set links) { this(links, new HashSet()); @@ -50,9 +50,9 @@ assert verify(); vertices = new TreeSet(); - portLinks = new Hashtable>(); - inputPorts = new Hashtable>(); - outputPorts = new Hashtable>(); + portLinks = new HashMap>(); + inputPorts = new HashMap>(); + outputPorts = new HashMap>(); for (Link l : links) { Port p = l.getFrom(); diff -r 3fd9157e5e3c -r cd3234c89e59 hotspot/src/share/tools/IdealGraphVisualizer/README --- a/hotspot/src/share/tools/IdealGraphVisualizer/README Tue Oct 28 18:02:09 2008 -0700 +++ b/hotspot/src/share/tools/IdealGraphVisualizer/README Thu Oct 30 17:08:48 2008 -0700 @@ -5,21 +5,16 @@ was the primary target of the tool. The tool itself is fairly general with only a few modules that contain C2 specific elements. -The tool is built on top of the NetBeans 6.0 rich client +The tool is built on top of the NetBeans 6.1 rich client infrastructure and so requires NetBeans to build. It currently requires Java 6 to run as it needs support for JavaScript for its filtering mechanism and assumes it's built into the platform. It -should build out of the box whit NetBeans 6 and Java 6 or later. It's -possible to run it on 1.5 by including Rhino on the classpath though -that currently isn't working correctly. Support for exporting graphs -as SVG can be enabled by adding batik to the classpath which isn't -included by default. - -It can be built on top of NetBeans 6.1 if you change the required -modules to be platform8 instead of platform7. The tool could run on -JDK 1.5 with some reworking of the how the JavaScript support is -enabled but currently it requires some tweaking of the setup. This -will be fixed in a later setup. +should build out of the box with NetBeans 6.1 and Java 6 or later. +It's possible to run it on 1.5 by including Rhino on the classpath +though that currently isn't working correctly. Support for exporting +graphs as SVG can be enabled by adding batik to the classpath which +isn't included by default. It can be built on top of NetBeans 6.0 if +you change the required modules to be platform7 instead of platform8. The JVM support is controlled by the flag -XX:PrintIdealGraphLevel=# where # is: diff -r 3fd9157e5e3c -r cd3234c89e59 hotspot/src/share/tools/IdealGraphVisualizer/Util/src/com/sun/hotspot/igv/util/PropertiesSheet.java --- a/hotspot/src/share/tools/IdealGraphVisualizer/Util/src/com/sun/hotspot/igv/util/PropertiesSheet.java Tue Oct 28 18:02:09 2008 -0700 +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Util/src/com/sun/hotspot/igv/util/PropertiesSheet.java Thu Oct 30 17:08:48 2008 -0700 @@ -36,11 +36,11 @@ */ public class PropertiesSheet { - public static void initializeSheet(Properties properties, Sheet s) { + public static void initializeSheet(final Properties properties, Sheet s) { Sheet.Set set1 = Sheet.createPropertiesSet(); set1.setDisplayName("Properties"); - for (final Property p : properties.getProperties()) { + for (final Property p : properties) { Node.Property prop = new Node.Property(String.class) { @Override @@ -60,7 +60,7 @@ @Override public void setValue(String arg0) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException { - p.setValue(arg0); + properties.setProperty(p.getName(), arg0); } }; prop.setName(p.getName()); diff -r 3fd9157e5e3c -r cd3234c89e59 hotspot/src/share/tools/IdealGraphVisualizer/Util/src/com/sun/hotspot/igv/util/RangeSliderModel.java --- a/hotspot/src/share/tools/IdealGraphVisualizer/Util/src/com/sun/hotspot/igv/util/RangeSliderModel.java Tue Oct 28 18:02:09 2008 -0700 +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Util/src/com/sun/hotspot/igv/util/RangeSliderModel.java Thu Oct 30 17:08:48 2008 -0700 @@ -65,13 +65,19 @@ public RangeSliderModel(List positions) { assert positions.size() > 0; - this.positions = positions; this.changedEvent = new ChangedEvent(this); this.colorChangedEvent = new ChangedEvent(this); + setPositions(positions); + } + + protected void setPositions(List positions) { + this.positions = positions; colors = new ArrayList(); for (int i = 0; i < positions.size(); i++) { colors.add(Color.black); } + changedEvent.fire(); + colorChangedEvent.fire(); } public void setColors(List colors) { diff -r 3fd9157e5e3c -r cd3234c89e59 hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/DiagramScene.java --- a/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/DiagramScene.java Tue Oct 28 18:02:09 2008 -0700 +++ b/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/DiagramScene.java Thu Oct 30 17:08:48 2008 -0700 @@ -63,7 +63,7 @@ import java.util.Collection; import java.util.HashMap; import java.util.HashSet; -import java.util.Hashtable; +import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Set; @@ -104,10 +104,10 @@ */ public class DiagramScene extends Scene implements ChangedListener { - private Hashtable figureWidgets; - private Hashtable slotWidgets; - private Hashtable connectionWidgets; - private Hashtable blockWidgets; + private HashMap figureWidgets; + private HashMap slotWidgets; + private HashMap connectionWidgets; + private HashMap blockWidgets; private Widget hoverWidget; private WidgetAction hoverAction; private List selectedWidgets; @@ -414,7 +414,7 @@ this.addChild(selectLayer); this.getActions().addAction(ActionFactory.createRectangularSelectAction(rectangularSelectDecorator, selectLayer, rectangularSelectProvider)); - blockWidgets = new Hashtable(); + blockWidgets = new HashMap(); boolean b = this.getUndoRedoEnabled(); this.setUndoRedoEnabled(false); @@ -543,9 +543,9 @@ blockLayer.removeChildren(); blockWidgets.clear(); - figureWidgets = new Hashtable(); - slotWidgets = new Hashtable(); - connectionWidgets = new Hashtable(); + figureWidgets = new HashMap(); + slotWidgets = new HashMap(); + connectionWidgets = new HashMap(); WidgetAction selectAction = new ExtendedSelectAction(selectProvider); Diagram d = getModel().getDiagramToView(); diff -r 3fd9157e5e3c -r cd3234c89e59 hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/DiagramViewModel.java --- a/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/DiagramViewModel.java Tue Oct 28 18:02:09 2008 -0700 +++ b/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/DiagramViewModel.java Thu Oct 30 17:08:48 2008 -0700 @@ -55,6 +55,7 @@ private FilterChain filterChain; private FilterChain sequenceFilterChain; private Diagram diagram; + private ChangedEvent groupChangedEvent; private ChangedEvent diagramChangedEvent; private ChangedEvent viewChangedEvent; private ChangedEvent viewPropertiesChangedEvent; @@ -67,6 +68,7 @@ } }; + @Override public DiagramViewModel copy() { DiagramViewModel result = new DiagramViewModel(group, filterChain, sequenceFilterChain); result.setData(this); @@ -79,6 +81,7 @@ boolean viewChanged = false; boolean viewPropertiesChanged = false; + boolean groupChanged = (group == newModel.group); this.group = newModel.group; diagramChanged |= (filterChain != newModel.filterChain); this.filterChain = newModel.filterChain; @@ -97,6 +100,10 @@ viewPropertiesChanged |= (showNodeHull != newModel.showNodeHull); this.showNodeHull = newModel.showNodeHull; + if(groupChanged) { + groupChangedEvent.fire(); + } + if (diagramChanged) { diagramChangedEvent.fire(); } @@ -143,11 +150,38 @@ diagramChangedEvent = new ChangedEvent(this); viewChangedEvent = new ChangedEvent(this); viewPropertiesChangedEvent = new ChangedEvent(this); + groupChangedEvent = new ChangedEvent(this); + groupChangedEvent.addListener(groupChangedListener); + groupChangedEvent.fire(); filterChain.getChangedEvent().addListener(filterChainChangedListener); sequenceFilterChain.getChangedEvent().addListener(filterChainChangedListener); } + private final ChangedListener groupChangedListener = new ChangedListener() { + + private Group oldGroup; + + public void changed(DiagramViewModel source) { + if(oldGroup != null) { + oldGroup.getChangedEvent().removeListener(groupContentChangedListener); + } + group.getChangedEvent().addListener(groupContentChangedListener); + oldGroup = group; + } + }; + + + private final ChangedListener groupContentChangedListener = new ChangedListener() { + + public void changed(Group source) { + assert source == group; + setPositions(calculateStringList(source)); + setSelectedNodes(selectedNodes); + } + + }; + public ChangedEvent getDiagramChangedEvent() { return diagramChangedEvent; } @@ -268,7 +302,10 @@ } public InputGraph getSecondGraph() { - return group.getGraphs().get(getSecondPosition()); + List graphs = group.getGraphs(); + if (graphs.size() >= getSecondPosition()) + return group.getGraphs().get(getSecondPosition()); + return getFirstGraph(); } public void selectGraph(InputGraph g) { diff -r 3fd9157e5e3c -r cd3234c89e59 hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/FindPanel.java --- a/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/FindPanel.java Tue Oct 28 18:02:09 2008 -0700 +++ b/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/FindPanel.java Thu Oct 30 17:08:48 2008 -0700 @@ -67,7 +67,7 @@ for (Figure f : figures) { Properties prop = f.getProperties(); - for (Property p : prop.getProperties()) { + for (Property p : prop) { if (!propertyNames.contains(p.getName())) { propertyNames.add(p.getName()); } diff -r 3fd9157e5e3c -r cd3234c89e59 hotspot/src/share/tools/IdealGraphVisualizer/nbproject/platform.properties --- a/hotspot/src/share/tools/IdealGraphVisualizer/nbproject/platform.properties Tue Oct 28 18:02:09 2008 -0700 +++ b/hotspot/src/share/tools/IdealGraphVisualizer/nbproject/platform.properties Thu Oct 30 17:08:48 2008 -0700 @@ -1,16 +1,16 @@ # Deprecated since 5.0u1; for compatibility with 5.0: disabled.clusters=\ apisupport1,\ + gsf1,\ harness,\ - ide8,\ - java1,\ - nb6.0,\ - profiler2 + ide9,\ + java2,\ + nb6.1,\ + profiler3 disabled.modules=\ org.netbeans.core.execution,\ org.netbeans.core.multiview,\ org.netbeans.core.output2,\ - org.netbeans.modules.applemenu,\ org.netbeans.modules.autoupdate.services,\ org.netbeans.modules.autoupdate.ui,\ org.netbeans.modules.core.kit,\ @@ -24,6 +24,6 @@ org.openide.execution,\ org.openide.util.enumerations enabled.clusters=\ - platform7 + platform8 nbjdk.active=default nbplatform.active=default diff -r 3fd9157e5e3c -r cd3234c89e59 hotspot/src/share/tools/IdealGraphVisualizer/nbproject/project.properties --- a/hotspot/src/share/tools/IdealGraphVisualizer/nbproject/project.properties Tue Oct 28 18:02:09 2008 -0700 +++ b/hotspot/src/share/tools/IdealGraphVisualizer/nbproject/project.properties Thu Oct 30 17:08:48 2008 -0700 @@ -15,7 +15,6 @@ ${project.com.sun.hotspot.igv.difference}:\ ${project.com.sun.hotspot.igv.settings}:\ ${project.com.sun.hotspot.igv.util}:\ - ${project.com.sun.hotspot.igv.rhino}:\ ${project.com.sun.hotspot.igv.svg}:\ ${project.com.sun.hotspot.connection}:\ ${project.com.sun.hotspot.igv.servercompilerscheduler}:\ @@ -31,10 +30,10 @@ project.com.sun.hotspot.igv.graph=Graph project.com.sun.hotspot.igv.hierarchicallayout=HierarchicalLayout project.com.sun.hotspot.igv.layout=Layout -project.com.sun.hotspot.igv.rhino=RhinoScriptEngineProxy project.com.sun.hotspot.igv.servercompilerscheduler=ServerCompiler project.com.sun.hotspot.igv.settings=Settings project.com.sun.hotspot.igv.svg=BatikSVGProxy project.com.sun.hotspot.igv.view=View project.com.sun.hotspot.igv.util=Util -run.args = -server -J-Xms64m -J-Xmx512m -J-da +run.args = -J-server -J-Xms64m -J-Xmx1g -J-da +run.args.extra = -J-server -J-Xms64m -J-Xmx1g -J-da diff -r 3fd9157e5e3c -r cd3234c89e59 hotspot/src/share/vm/adlc/output_h.cpp --- a/hotspot/src/share/vm/adlc/output_h.cpp Tue Oct 28 18:02:09 2008 -0700 +++ b/hotspot/src/share/vm/adlc/output_h.cpp Thu Oct 30 17:08:48 2008 -0700 @@ -377,7 +377,7 @@ ++i; } else if (!strcmp(ideal_type, "ConN")) { - fprintf(fp," _c%d->dump();\n", i); + fprintf(fp," _c%d->dump_on(st);\n", i); ++i; } else if (!strcmp(ideal_type, "ConL")) { diff -r 3fd9157e5e3c -r cd3234c89e59 hotspot/src/share/vm/opto/compile.cpp --- a/hotspot/src/share/vm/opto/compile.cpp Tue Oct 28 18:02:09 2008 -0700 +++ b/hotspot/src/share/vm/opto/compile.cpp Thu Oct 30 17:08:48 2008 -0700 @@ -551,7 +551,7 @@ rethrow_exceptions(kit.transfer_exceptions_into_jvms()); } - print_method("Before RemoveUseless"); + print_method("Before RemoveUseless", 3); // Remove clutter produced by parsing. if (!failing()) { diff -r 3fd9157e5e3c -r cd3234c89e59 hotspot/src/share/vm/opto/type.cpp --- a/hotspot/src/share/vm/opto/type.cpp Tue Oct 28 18:02:09 2008 -0700 +++ b/hotspot/src/share/vm/opto/type.cpp Thu Oct 30 17:08:48 2008 -0700 @@ -3541,7 +3541,7 @@ #ifndef PRODUCT void TypeNarrowOop::dump2( Dict & d, uint depth, outputStream *st ) const { - tty->print("narrowoop: "); + st->print("narrowoop: "); _ooptype->dump2(d, depth, st); } #endif diff -r 3fd9157e5e3c -r cd3234c89e59 hotspot/src/share/vm/runtime/frame.cpp --- a/hotspot/src/share/vm/runtime/frame.cpp Tue Oct 28 18:02:09 2008 -0700 +++ b/hotspot/src/share/vm/runtime/frame.cpp Thu Oct 30 17:08:48 2008 -0700 @@ -83,12 +83,12 @@ intptr_t* src = (intptr_t*) location(r); if (src != NULL) { - r->print(); - tty->print(" [" INTPTR_FORMAT "] = ", src); + r->print_on(st); + st->print(" [" INTPTR_FORMAT "] = ", src); if (((uintptr_t)src & (sizeof(*src)-1)) != 0) { - tty->print_cr(""); + st->print_cr(""); } else { - tty->print_cr(INTPTR_FORMAT, *src); + st->print_cr(INTPTR_FORMAT, *src); } } }