changeset 12515:a7d44c139948

Merge.
author Doug Simon <doug.simon@oracle.com>
date Tue, 22 Oct 2013 11:54:18 +0200
parents 8c64f10f86b7 (current diff) 9e33b386281e (diff)
children 2ae286218721 cf6cfa79593d
files
diffstat 3 files changed, 33 insertions(+), 44 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.graph/src/com/oracle/graal/graph/NodeClass.java	Tue Oct 22 11:31:16 2013 +0200
+++ b/graal/com.oracle.graal.graph/src/com/oracle/graal/graph/NodeClass.java	Tue Oct 22 11:54:18 2013 +0200
@@ -1194,7 +1194,7 @@
                     }
 
                     public Position next() {
-                        Position pos = new Position(true, i, i >= directInputCount ? 0 : NOT_ITERABLE);
+                        Position pos = new Position(true, i, i >= directInputCount ? NODE_LIST : NOT_ITERABLE);
                         i++;
                         return pos;
                     }
@@ -1224,7 +1224,7 @@
                     }
 
                     public Position next() {
-                        Position pos = new Position(false, i, i >= directSuccessorCount ? 0 : NOT_ITERABLE);
+                        Position pos = new Position(false, i, i >= directSuccessorCount ? NODE_LIST : NOT_ITERABLE);
                         i++;
                         return pos;
                     }
--- a/graal/com.oracle.graal.printer/src/com/oracle/graal/printer/BinaryGraphPrinter.java	Tue Oct 22 11:31:16 2013 +0200
+++ b/graal/com.oracle.graal.printer/src/com/oracle/graal/printer/BinaryGraphPrinter.java	Tue Oct 22 11:54:18 2013 +0200
@@ -407,6 +407,7 @@
             writeInt(node.getId());
             writePoolObject(nodeClass);
             writeByte(node.predecessor() == null ? 0 : 1);
+            // properties
             writeShort((char) props.size());
             for (Entry<Object, Object> entry : props.entrySet()) {
                 String key = entry.getKey().toString();
@@ -414,54 +415,42 @@
                 writePropertyObject(entry.getValue());
             }
             // inputs
-            Collection<Position> directInputPositions = nodeClass.getFirstLevelInputPositions();
-            for (Position pos : directInputPositions) {
-                if (pos.subIndex == NodeClass.NOT_ITERABLE) {
-                    Node in = nodeClass.get(node, pos);
-                    if (in != null) {
-                        writeInt(in.getId());
-                    } else {
-                        writeInt(-1);
-                    }
+            writeEdges(node, nodeClass.getFirstLevelInputPositions());
+            // successors
+            writeEdges(node, nodeClass.getFirstLevelSuccessorPositions());
+
+            props.clear();
+        }
+    }
+
+    private void writeEdges(Node node, Collection<Position> positions) throws IOException {
+        NodeClass nodeClass = node.getNodeClass();
+        for (Position pos : positions) {
+            if (pos.subIndex == NodeClass.NOT_ITERABLE) {
+                Node edge = nodeClass.get(node, pos);
+                writeNodeRef(edge);
+            } else {
+                NodeList<?> list = nodeClass.getNodeList(node, pos);
+                if (list == null) {
+                    writeShort((char) 0);
                 } else {
-                    NodeList<?> list = nodeClass.getNodeList(node, pos);
                     int listSize = list.count();
                     assert listSize == ((char) listSize);
                     writeShort((char) listSize);
-                    for (Node in : list) {
-                        if (in != null) {
-                            writeInt(in.getId());
-                        } else {
-                            writeInt(-1);
-                        }
+                    for (Node edge : list) {
+                        writeNodeRef(edge);
                     }
                 }
             }
-            // successors
-            Collection<Position> directSuccessorPositions = nodeClass.getFirstLevelSuccessorPositions();
-            for (Position pos : directSuccessorPositions) {
-                if (pos.subIndex == NodeClass.NOT_ITERABLE) {
-                    Node sux = nodeClass.get(node, pos);
-                    if (sux != null) {
-                        writeInt(sux.getId());
-                    } else {
-                        writeInt(-1);
-                    }
-                } else {
-                    NodeList<?> list = nodeClass.getNodeList(node, pos);
-                    int listSize = list.count();
-                    assert listSize == ((char) listSize);
-                    writeShort((char) listSize);
-                    for (Node sux : list) {
-                        if (sux != null) {
-                            writeInt(sux.getId());
-                        } else {
-                            writeInt(-1);
-                        }
-                    }
-                }
-            }
-            props.clear();
+        }
+    }
+
+    @SuppressWarnings("deprecation")
+    private void writeNodeRef(Node edge) throws IOException {
+        if (edge != null) {
+            writeInt(edge.getId());
+        } else {
+            writeInt(-1);
         }
     }
 
--- a/src/share/vm/graal/graalGlobals.hpp	Tue Oct 22 11:31:16 2013 +0200
+++ b/src/share/vm/graal/graalGlobals.hpp	Tue Oct 22 11:54:18 2013 +0200
@@ -55,7 +55,7 @@
   product(intx, TraceGraal, 0,                                              \
           "Trace level for Graal")                                          \
                                                                             \
-  product(bool, GraalDeferredInitBarriers, true,                            \
+  product(bool, GraalDeferredInitBarriers, false,                           \
           "Defer write barriers of young objects")                          \
                                                                             \
   develop(bool, GraalUseFastLocking, true,                                  \