# HG changeset patch # User Doug Simon # Date 1382435658 -7200 # Node ID a7d44c1399482ef83b96e4ae6f0ae278e3c76312 # Parent 8c64f10f86b772feb16533296a890e1011a31662# Parent 9e33b386281ecb09df78f8a903ff354d50758936 Merge. diff -r 8c64f10f86b7 -r a7d44c139948 graal/com.oracle.graal.graph/src/com/oracle/graal/graph/NodeClass.java --- 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; } diff -r 8c64f10f86b7 -r a7d44c139948 graal/com.oracle.graal.printer/src/com/oracle/graal/printer/BinaryGraphPrinter.java --- 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 entry : props.entrySet()) { String key = entry.getKey().toString(); @@ -414,54 +415,42 @@ writePropertyObject(entry.getValue()); } // inputs - Collection 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 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 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); } } diff -r 8c64f10f86b7 -r a7d44c139948 src/share/vm/graal/graalGlobals.hpp --- 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, \