Mercurial > hg > graal-compiler
comparison graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/nodes/IfNode.java @ 9222:aa9ffb3a715e
Updated Truffle-SL to new codegen API.
author | Christian Humer <christian.humer@gmail.com> |
---|---|
date | Sat, 20 Apr 2013 12:17:27 +0200 |
parents | 5e3d1a68664e |
children | 79041ab43660 |
comparison
equal
deleted
inserted
replaced
9221:67bee207f20c | 9222:aa9ffb3a715e |
---|---|
23 package com.oracle.truffle.sl.nodes; | 23 package com.oracle.truffle.sl.nodes; |
24 | 24 |
25 import com.oracle.truffle.api.codegen.*; | 25 import com.oracle.truffle.api.codegen.*; |
26 import com.oracle.truffle.api.frame.*; | 26 import com.oracle.truffle.api.frame.*; |
27 | 27 |
28 @ExecuteChildren("conditionNode") | 28 @NodeChild(value = "conditionNode", type = ConditionNode.class) |
29 public abstract class IfNode extends StatementNode { | 29 public abstract class IfNode extends StatementNode { |
30 | 30 |
31 @Child protected ConditionNode conditionNode; | |
32 | |
33 @Child private StatementNode thenPartNode; | 31 @Child private StatementNode thenPartNode; |
34 | |
35 @Child private StatementNode elsePartNode; | 32 @Child private StatementNode elsePartNode; |
36 | 33 |
37 public IfNode(ConditionNode condition, StatementNode thenPart, StatementNode elsePart) { | 34 public IfNode(StatementNode thenPart, StatementNode elsePart) { |
38 this.conditionNode = adoptChild(condition); | |
39 this.thenPartNode = adoptChild(thenPart); | 35 this.thenPartNode = adoptChild(thenPart); |
40 this.elsePartNode = adoptChild(elsePart); | 36 this.elsePartNode = adoptChild(elsePart); |
41 } | 37 } |
42 | 38 |
43 protected IfNode(IfNode node) { | 39 protected IfNode(IfNode node) { |
44 this(node.conditionNode, node.thenPartNode, node.elsePartNode); | 40 this(node.thenPartNode, node.elsePartNode); |
45 } | 41 } |
46 | 42 |
47 @Specialization | 43 @Specialization |
48 public void doVoid(VirtualFrame frame, boolean condition) { | 44 public void doVoid(VirtualFrame frame, boolean condition) { |
49 if (condition) { | 45 if (condition) { |