changeset 7917:1a83cef20ee5

Fix for the Graal CFG filter, be a bit more robust and accept graphs comming from the binary deserializer. Fixes GRAAL-127 Similarb change in the Graal edge color filter. Make it more robust.
author Gilles Duboscq <duboscq@ssw.jku.at>
date Mon, 04 Mar 2013 09:59:47 +0100
parents 3b5578749256
children 0dea5ef60303
files src/share/tools/IdealGraphVisualizer/Graal/src/com/sun/hotspot/igv/graal/filters/GraalCFGFilter.java src/share/tools/IdealGraphVisualizer/Graal/src/com/sun/hotspot/igv/graal/filters/GraalEdgeColorFilter.java
diffstat 2 files changed, 13 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/tools/IdealGraphVisualizer/Graal/src/com/sun/hotspot/igv/graal/filters/GraalCFGFilter.java	Sun Mar 03 10:56:18 2013 +0100
+++ b/src/share/tools/IdealGraphVisualizer/Graal/src/com/sun/hotspot/igv/graal/filters/GraalCFGFilter.java	Mon Mar 04 09:59:47 2013 +0100
@@ -45,7 +45,6 @@
         Set<Connection> connectionsToRemove = new HashSet<>();
         for (Figure f : d.getFigures()) {
             final String prop = f.getProperties().get("probability");
-            
             if (prop == null) {
                 figuresToRemove.add(f);
             }
@@ -54,7 +53,15 @@
         
         for (Figure f : d.getFigures()) {
             Properties p = f.getProperties();
-            int predCount = Integer.parseInt(p.get("predecessorCount"));
+            int predCount;
+            String predCountString = p.get("predecessorCount");
+            if (predCountString != null) {
+                predCount = Integer.parseInt(predCountString);
+            } else if (Boolean.parseBoolean(p.get("hasPredecessor"))) {
+                predCount = 1;
+            } else {
+                predCount = 0;
+            }
             for (InputSlot is : f.getInputSlots()) {
                 if (is.getPosition() >= predCount && !"EndNode".equals(is.getProperties().get("class"))) {
                     for (Connection c : is.getConnections()) {
--- a/src/share/tools/IdealGraphVisualizer/Graal/src/com/sun/hotspot/igv/graal/filters/GraalEdgeColorFilter.java	Sun Mar 03 10:56:18 2013 +0100
+++ b/src/share/tools/IdealGraphVisualizer/Graal/src/com/sun/hotspot/igv/graal/filters/GraalEdgeColorFilter.java	Mon Mar 04 09:59:47 2013 +0100
@@ -58,7 +58,10 @@
         for (Figure f : figures) {
             Properties p = f.getProperties();
             int predCount;
-            if (Boolean.parseBoolean(p.get("hasPredecessor"))) {
+            String predCountString = p.get("predecessorCount");
+            if (predCountString != null) {
+                predCount = Integer.parseInt(predCountString);
+            } else if (Boolean.parseBoolean(p.get("hasPredecessor"))) {
                 predCount = 1;
             } else {
                 predCount = 0;