comparison graal/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/LoopNode.java @ 18794:e688e42b41e3

Truffle: LoopNode: child field type can be RepeatingNode now
author Andreas Woess <andreas.woess@jku.at>
date Mon, 05 Jan 2015 19:01:01 +0100
parents 865628e59c55
children 2727a2be2391
comparison
equal deleted inserted replaced
18792:7bb1abca2c0d 18794:e688e42b41e3
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 /* 34 @Child protected RepeatingNode repeatingNode;
35 * TODO Unfortunately we cannot yet use interface typed fields as child fields.
36 */
37 @Child protected Node repeatingNode;
38 35
39 public LoopNode(RepeatingNode repeatingNode) { 36 public LoopNode(RepeatingNode repeatingNode) {
40 this.repeatingNode = (Node) repeatingNode; 37 this.repeatingNode = repeatingNode;
41 } 38 }
42 39
43 public abstract void executeLoop(VirtualFrame frame); 40 public abstract void executeLoop(VirtualFrame frame);
44 41
45 protected final boolean executeRepeatingNode(VirtualFrame frame) { 42 protected final boolean executeRepeatingNode(VirtualFrame frame) {
46 return getRepeatingNode().executeRepeating(frame); 43 return getRepeatingNode().executeRepeating(frame);
47 } 44 }
48 45
49 public final RepeatingNode getRepeatingNode() { 46 public final RepeatingNode getRepeatingNode() {
50 return (RepeatingNode) repeatingNode; 47 return repeatingNode;
51 } 48 }
52 49
53 } 50 }