Mercurial > hg > graal-jvmci-8
changeset 23339:13d0e0a9410e
Add folder and graph property support to binary graphs in IGV
author | Tom Rodriguez <tom.rodriguez@oracle.com> |
---|---|
date | Thu, 31 Mar 2016 10:21:27 -0700 |
parents | a3471785190d |
children | 22c3bdf28fff |
files | src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/FolderNode.java src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/serialization/BinaryParser.java |
diffstat | 2 files changed, 23 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/FolderNode.java Fri Mar 25 14:08:23 2016 -0700 +++ b/src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/FolderNode.java Thu Mar 31 10:21:27 2016 -0700 @@ -25,11 +25,13 @@ import com.sun.hotspot.igv.coordinator.actions.RemoveCookie; import com.sun.hotspot.igv.data.*; +import com.sun.hotspot.igv.util.PropertiesSheet; import java.awt.Image; import java.util.List; import org.openide.nodes.AbstractNode; import org.openide.nodes.Children; import org.openide.nodes.Node; +import org.openide.nodes.Sheet; import org.openide.util.ImageUtilities; import org.openide.util.lookup.AbstractLookup; import org.openide.util.lookup.InstanceContent; @@ -75,6 +77,16 @@ } @Override + protected Sheet createSheet() { + Sheet s = super.createSheet(); + if (children.folder instanceof Properties.Entity) { + Properties.Entity p = (Properties.Entity) children.folder; + PropertiesSheet.initializeSheet(p.getProperties(), s); + } + return s; + } + + @Override public Image getIcon(int i) { return ImageUtilities.loadImage("com/sun/hotspot/igv/coordinator/images/folder.png"); }
--- a/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/serialization/BinaryParser.java Fri Mar 25 14:08:23 2016 -0700 +++ b/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/serialization/BinaryParser.java Thu Mar 31 10:21:27 2016 -0700 @@ -648,6 +648,7 @@ int bci = readInt(); Group group = new Group(parent); group.getProperties().setProperty("name", name); + parseProperties(group.getProperties()); if (method != null) { InputMethod inMethod = new InputMethod(group, method.name, shortName, bci); inMethod.setBytecodes("TODO"); @@ -686,8 +687,18 @@ return graph; } + private void parseProperties(Properties properties) throws IOException { + int propCount = readShort(); + for (int j = 0; j < propCount; j++) { + String key = readPoolObject(String.class); + Object value = readPropertyObject(); + properties.setProperty(key, value != null ? value.toString() : "null"); + } + } + private InputGraph parseGraph(String title) throws IOException { InputGraph graph = new InputGraph(title); + parseProperties(graph.getProperties()); parseNodes(graph); parseBlocks(graph); graph.ensureNodesInBlocks();