Mercurial > hg > graal-compiler
comparison graal/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/ThreadSafetyTest.java @ 15093:5634b199c4da
Truffle: API-change: renamed CallNode to DirectCallNode and added IndirectCallNode.
author | Christian Humer <christian.humer@gmail.com> |
---|---|
date | Mon, 14 Apr 2014 20:32:25 +0200 |
parents | f675818d9ad0 |
children | dcc0f31b2bfb |
comparison
equal
deleted
inserted
replaced
15092:c73ce0dd3583 | 15093:5634b199c4da |
---|---|
48 NodeUtil.verify(rootNode1); | 48 NodeUtil.verify(rootNode1); |
49 | 49 |
50 RecursiveCallNode callNode = new RecursiveCallNode(new ConstNode(42)); | 50 RecursiveCallNode callNode = new RecursiveCallNode(new ConstNode(42)); |
51 TestRootNode rootNode2 = new TestRootNode(new RewritingNode(new RewritingNode(new RewritingNode(new RewritingNode(new RewritingNode(callNode)))))); | 51 TestRootNode rootNode2 = new TestRootNode(new RewritingNode(new RewritingNode(new RewritingNode(new RewritingNode(new RewritingNode(callNode)))))); |
52 final CallTarget target2 = runtime.createCallTarget(rootNode2); | 52 final CallTarget target2 = runtime.createCallTarget(rootNode2); |
53 callNode.setCallNode(runtime.createCallNode(target2)); | 53 callNode.setCallNode(runtime.createDirectCallNode(target2)); |
54 NodeUtil.verify(rootNode2); | 54 NodeUtil.verify(rootNode2); |
55 | 55 |
56 testTarget(target1, 47, 1_000_000); | 56 testTarget(target1, 47, 1_000_000); |
57 testTarget(target2, 72, 1_000_000); | 57 testTarget(target2, 72, 1_000_000); |
58 } | 58 } |
163 return value; | 163 return value; |
164 } | 164 } |
165 } | 165 } |
166 | 166 |
167 static class RecursiveCallNode extends ValueNode { | 167 static class RecursiveCallNode extends ValueNode { |
168 @Child CallNode callNode; | 168 @Child DirectCallNode callNode; |
169 @Child private ValueNode valueNode; | 169 @Child private ValueNode valueNode; |
170 | 170 |
171 RecursiveCallNode(ValueNode value) { | 171 RecursiveCallNode(ValueNode value) { |
172 this.valueNode = value; | 172 this.valueNode = value; |
173 } | 173 } |
180 } else { | 180 } else { |
181 return valueNode.execute(frame); | 181 return valueNode.execute(frame); |
182 } | 182 } |
183 } | 183 } |
184 | 184 |
185 void setCallNode(CallNode callNode) { | 185 void setCallNode(DirectCallNode callNode) { |
186 this.callNode = insert(callNode); | 186 this.callNode = insert(callNode); |
187 } | 187 } |
188 } | 188 } |
189 } | 189 } |