Mercurial > hg > graal-compiler
changeset 2559:46eab5817cc2
Modified assert in NodeArray.set method (also helps with a compilation issue in ECJ)
author | Gilles Duboscq <gilles.duboscq@oracle.com> |
---|---|
date | Fri, 29 Apr 2011 11:16:06 +0200 |
parents | 98eef19a381c |
children | 8902c4c20c69 491896f81cae |
files | graal/GraalGraph/src/com/oracle/graal/graph/Node.java graal/GraalGraph/test/com/oracle/graal/graph/NodeTest.java |
diffstat | 2 files changed, 7 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/graal/GraalGraph/src/com/oracle/graal/graph/Node.java Thu Apr 28 18:58:35 2011 +0200 +++ b/graal/GraalGraph/src/com/oracle/graal/graph/Node.java Fri Apr 29 11:16:06 2011 +0200 @@ -139,6 +139,11 @@ return 0; } + @Override + public String toString() { + return this.getClass().getSimpleName() + "-" + this.id(); + } + public class NodeArray extends AbstractList<Node> { private final Node[] nodes; @@ -156,7 +161,7 @@ } public Node set(int index, Node node) { - assert node.graph == self().graph; + assert node == Null || node.graph == self().graph; Node old = nodes[index]; if (old != node) {
--- a/graal/GraalGraph/test/com/oracle/graal/graph/NodeTest.java Thu Apr 28 18:58:35 2011 +0200 +++ b/graal/GraalGraph/test/com/oracle/graal/graph/NodeTest.java Fri Apr 29 11:16:06 2011 +0200 @@ -58,6 +58,7 @@ assertFalse(o3.inputs().contains(o2)); assertTrue(o3.inputs().contains(o4)); + assertTrue(o4.usages().contains(o3)); } private static class DummyNode extends Node {