Mercurial > hg > truffle
comparison graal/com.oracle.graal.loop/src/com/oracle/graal/loop/LoopFragment.java @ 15146:65efd2eeea1b
Remove AbstractNodeIterable, move its methods to default methods on NodeIterable.
This allows to remove a number of duplicated methods in NodeList
NodeClassIterable is also interface instead of an abstract class.
author | Gilles Duboscq <duboscq@ssw.jku.at> |
---|---|
date | Mon, 14 Apr 2014 16:31:13 +0200 |
parents | df2ef5204f2b |
children | 1dc1af3bf402 |
comparison
equal
deleted
inserted
replaced
15145:df2ef5204f2b | 15146:65efd2eeea1b |
---|---|
252 notloopNodes.mark(n); | 252 notloopNodes.mark(n); |
253 return false; | 253 return false; |
254 } | 254 } |
255 | 255 |
256 public static NodeIterable<BeginNode> toHirBlocks(final Iterable<Block> blocks) { | 256 public static NodeIterable<BeginNode> toHirBlocks(final Iterable<Block> blocks) { |
257 return new AbstractNodeIterable<BeginNode>() { | 257 return new NodeIterable<BeginNode>() { |
258 | 258 |
259 public Iterator<BeginNode> iterator() { | 259 public Iterator<BeginNode> iterator() { |
260 final Iterator<Block> it = blocks.iterator(); | 260 final Iterator<Block> it = blocks.iterator(); |
261 return new Iterator<BeginNode>() { | 261 return new Iterator<BeginNode>() { |
262 | 262 |
277 | 277 |
278 }; | 278 }; |
279 } | 279 } |
280 | 280 |
281 public static NodeIterable<LoopExitNode> toHirExits(final Iterable<Block> blocks) { | 281 public static NodeIterable<LoopExitNode> toHirExits(final Iterable<Block> blocks) { |
282 return new AbstractNodeIterable<LoopExitNode>() { | 282 return new NodeIterable<LoopExitNode>() { |
283 | 283 |
284 public Iterator<LoopExitNode> iterator() { | 284 public Iterator<LoopExitNode> iterator() { |
285 final Iterator<Block> it = blocks.iterator(); | 285 final Iterator<Block> it = blocks.iterator(); |
286 return new Iterator<LoopExitNode>() { | 286 return new Iterator<LoopExitNode>() { |
287 | 287 |
339 /* | 339 /* |
340 * Using the old exit's state as the merge's state is necessary because some of the | 340 * Using the old exit's state as the merge's state is necessary because some of the |
341 * VirtualState nodes contained in the old exit's state may be shared by other | 341 * VirtualState nodes contained in the old exit's state may be shared by other |
342 * dominated VirtualStates. Those dominated virtual states need to see the | 342 * dominated VirtualStates. Those dominated virtual states need to see the |
343 * proxy->phi update that are applied below. | 343 * proxy->phi update that are applied below. |
344 * | 344 * |
345 * We now update the original fragment's nodes accordingly: | 345 * We now update the original fragment's nodes accordingly: |
346 */ | 346 */ |
347 state.applyToVirtual(new VirtualClosure() { | 347 state.applyToVirtual(new VirtualClosure() { |
348 public void apply(VirtualState node) { | 348 public void apply(VirtualState node) { |
349 original.nodes.clear(node); | 349 original.nodes.clear(node); |