Mercurial > hg > graal-compiler
diff graal/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/ReplaceTest.java @ 14628:a08b8694f556
Truffle: Node API changes
deprecate adoptChild, no longer needed in constructor
add Node#insert for inserting new nodes into the tree (previously adoptChild)
add Node#adoptChildren() helper method that adopts all (direct and indirect) children of a node, automatically called in TruffleRuntime#createCallTarget
author | Andreas Woess <andreas.woess@jku.at> |
---|---|
date | Wed, 19 Mar 2014 23:11:46 +0100 |
parents | df1d665ca846 |
children | 1cde96b96673 |
line wrap: on
line diff
--- a/graal/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/ReplaceTest.java Thu Mar 20 00:16:39 2014 +0100 +++ b/graal/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/ReplaceTest.java Wed Mar 19 23:11:46 2014 +0100 @@ -59,13 +59,13 @@ UnresolvedNode leftChild = new UnresolvedNode("20"); UnresolvedNode rightChild = new UnresolvedNode("22"); TestRootNode rootNode = new TestRootNode(new ValueNode[]{leftChild, rightChild}); + CallTarget target = runtime.createCallTarget(rootNode); assertEquals(rootNode, leftChild.getParent()); assertEquals(rootNode, rightChild.getParent()); Iterator<Node> iterator = rootNode.getChildren().iterator(); Assert.assertEquals(leftChild, iterator.next()); Assert.assertEquals(rightChild, iterator.next()); Assert.assertFalse(iterator.hasNext()); - CallTarget target = runtime.createCallTarget(rootNode); Object result = target.call(); assertEquals(42, result); assertEquals(42, target.call()); @@ -85,7 +85,7 @@ public TestRootNode(ValueNode[] children) { super(null); - this.children = adoptChildren(children); + this.children = children; } @Override