Mercurial > hg > truffle
changeset 10938:4c648c43150c
Fix bug in FixedGuardNode simplification.
author | Roland Schatz <roland.schatz@oracle.com> |
---|---|
date | Fri, 02 Aug 2013 16:21:02 +0200 |
parents | 87d9b5518065 |
children | 8ede7cd7318e |
files | graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/FixedGuardNode.java |
diffstat | 1 files changed, 9 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/FixedGuardNode.java Fri Aug 02 11:22:23 2013 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/FixedGuardNode.java Fri Aug 02 16:21:02 2013 +0200 @@ -84,16 +84,18 @@ public void simplify(SimplifierTool tool) { if (condition instanceof LogicConstantNode) { LogicConstantNode c = (LogicConstantNode) condition; - if (c.getValue() != negated) { - this.replaceAtUsages(BeginNode.prevBegin(this)); - graph().removeFixed(this); - } else { - FixedWithNextNode predecessor = (FixedWithNextNode) predecessor(); + if (c.getValue() == negated) { + FixedNode next = this.next(); + if (next != null) { + tool.deleteBranch(next); + } + DeoptimizeNode deopt = graph().add(new DeoptimizeNode(DeoptimizationAction.InvalidateRecompile, reason)); deopt.setDeoptimizationState(getDeoptimizationState()); - tool.deleteBranch(this); - predecessor.setNext(deopt); + setNext(deopt); } + this.replaceAtUsages(BeginNode.prevBegin(this)); + graph().removeFixed(this); } }