Mercurial > hg > truffle
comparison graal/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/LoopNode.java @ 19977:2727a2be2391
Truffle: simplify loop node implementation.
author | Christian Humer <christian.humer@oracle.com> |
---|---|
date | Fri, 20 Mar 2015 19:00:50 +0100 |
parents | e688e42b41e3 |
children |
comparison
equal
deleted
inserted
replaced
19976:596f6f9a7412 | 19977:2727a2be2391 |
---|---|
29 /** | 29 /** |
30 * Experimental API: may change significantly without notice. | 30 * Experimental API: may change significantly without notice. |
31 */ | 31 */ |
32 public abstract class LoopNode extends Node { | 32 public abstract class LoopNode extends Node { |
33 | 33 |
34 @Child protected RepeatingNode repeatingNode; | |
35 | |
36 public LoopNode(RepeatingNode repeatingNode) { | |
37 this.repeatingNode = repeatingNode; | |
38 } | |
39 | |
40 public abstract void executeLoop(VirtualFrame frame); | 34 public abstract void executeLoop(VirtualFrame frame); |
41 | 35 |
42 protected final boolean executeRepeatingNode(VirtualFrame frame) { | 36 public abstract RepeatingNode getRepeatingNode(); |
43 return getRepeatingNode().executeRepeating(frame); | |
44 } | |
45 | |
46 public final RepeatingNode getRepeatingNode() { | |
47 return repeatingNode; | |
48 } | |
49 | 37 |
50 } | 38 } |