Mercurial > hg > truffle
changeset 18812:c9d5decf4c27
Remove GuardNode from iterable node types.
author | Thomas Wuerthinger <thomas.wuerthinger@oracle.com> |
---|---|
date | Sat, 10 Jan 2015 21:18:34 +0100 |
parents | d2ec5f50dcd0 |
children | 498a56d8bb9b |
files | graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/GuardNode.java graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/GuardLoweringPhase.java |
diffstat | 2 files changed, 11 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/GuardNode.java Sat Jan 10 13:44:47 2015 +0100 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/GuardNode.java Sat Jan 10 21:18:34 2015 +0100 @@ -42,7 +42,7 @@ * control flow would have reached the guarded node (without taking exceptions into account). */ @NodeInfo(nameTemplate = "Guard(!={p#negated}) {p#reason/s}", allowedUsageTypes = {InputType.Guard}) -public class GuardNode extends FloatingAnchoredNode implements Canonicalizable, IterableNodeType, GuardingNode { +public class GuardNode extends FloatingAnchoredNode implements Canonicalizable, GuardingNode { @Input(InputType.Condition) protected LogicNode condition; protected final DeoptimizationReason reason;
--- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/GuardLoweringPhase.java Sat Jan 10 13:44:47 2015 +0100 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/GuardLoweringPhase.java Sat Jan 10 21:18:34 2015 +0100 @@ -203,7 +203,16 @@ graph.setGuardsStage(GuardsStage.FIXED_DEOPTS); } - assert graph.getNodes(GuardNode.class).isEmpty(); + assert checkNoGuardsLeft(graph); + } + + private static boolean checkNoGuardsLeft(StructuredGraph graph) { + for (Node n : graph.getNodes()) { + if (n instanceof GuardNode) { + assert false : n; + } + } + return true; } private static void processBlock(Block block, SchedulePhase schedule, int implicitNullCheckLimit) {