File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
graalpython/com.oracle.graal.python/src/com/oracle/graal/python/nodes/control Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change 28
28
import com .oracle .graal .python .nodes .expression .CoerceToBooleanNode ;
29
29
import com .oracle .graal .python .nodes .statement .StatementNode ;
30
30
import com .oracle .truffle .api .frame .VirtualFrame ;
31
+ import com .oracle .truffle .api .profiles .ConditionProfile ;
31
32
32
33
public final class IfNode extends StatementNode {
33
34
34
35
@ Child private CoerceToBooleanNode condition ;
35
36
@ Child private StatementNode then ;
36
37
@ Child private StatementNode orelse ;
38
+ private final ConditionProfile conditionProfile = ConditionProfile .createCountingProfile ();
37
39
38
40
public IfNode (CoerceToBooleanNode condition , StatementNode then , StatementNode orelse ) {
39
41
this .condition = condition ;
@@ -55,7 +57,7 @@ public StatementNode getElse() {
55
57
56
58
@ Override
57
59
public void executeVoid (VirtualFrame frame ) {
58
- if (condition .executeBoolean (frame )) {
60
+ if (conditionProfile . profile ( condition .executeBoolean (frame ) )) {
59
61
then .executeVoid (frame );
60
62
} else if (orelse != null ) {
61
63
orelse .executeVoid (frame );
You can’t perform that action at this time.
0 commit comments