Mercurial > hg > graal-jvmci-8
changeset 16253:614d3b9ed188
let CanonicalizerPhase handle replacement with null in GuardNode.canonical
author | Lukas Stadler <lukas.stadler@oracle.com> |
---|---|
date | Thu, 26 Jun 2014 16:27:36 +0200 |
parents | a762ddb12b43 |
children | a56aabb15e98 |
files | graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/GuardNode.java |
diffstat | 1 files changed, 3 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/GuardNode.java Thu Jun 26 16:27:36 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/GuardNode.java Thu Jun 26 16:27:36 2014 +0200 @@ -65,11 +65,6 @@ return condition; } - public void setCondition(LogicNode x) { - updateUsages(condition, x); - condition = x; - } - public boolean negated() { return negated; } @@ -103,11 +98,11 @@ public Node canonical(CanonicalizerTool tool) { if (condition() instanceof LogicNegationNode) { LogicNegationNode negation = (LogicNegationNode) condition(); - return graph().unique(new GuardNode(negation.getValue(), getAnchor(), reason, action, !negated, speculation)); - } else if (condition() instanceof LogicConstantNode) { + return new GuardNode(negation.getValue(), getAnchor(), reason, action, !negated, speculation); + } + if (condition() instanceof LogicConstantNode) { LogicConstantNode c = (LogicConstantNode) condition(); if (c.getValue() != negated) { - this.replaceAtUsages(null); return null; } }