< prev index next >
src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/IfNode.java
Print this page
@@ -20,11 +20,11 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package org.graalvm.compiler.nodes;
-import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_2;
+import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_1;
import static org.graalvm.compiler.nodeinfo.NodeSize.SIZE_2;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
@@ -72,11 +72,11 @@
/**
* The {@code IfNode} represents a branch that can go one of two directions depending on the outcome
* of a comparison.
*/
-@NodeInfo(cycles = CYCLES_2, size = SIZE_2, sizeRationale = "2 jmps")
+@NodeInfo(cycles = CYCLES_1, size = SIZE_2, sizeRationale = "2 jmps")
public final class IfNode extends ControlSplitNode implements Simplifiable, LIRLowerable {
public static final NodeClass<IfNode> TYPE = NodeClass.create(IfNode.class);
private static final CounterKey CORRECTED_PROBABILITIES = DebugContext.counter("CorrectedProbabilities");
@@ -373,11 +373,11 @@
if (unbox == null || unboxCheck == null) {
return false;
}
// Falsify the reference check.
- setCondition(graph().addOrUnique(LogicConstantNode.contradiction()));
+ setCondition(graph().addOrUniqueWithInputs(LogicConstantNode.contradiction()));
return true;
}
/**
@@ -724,14 +724,15 @@
return false;
}
protected void removeThroughFalseBranch(SimplifierTool tool, AbstractMergeNode merge) {
AbstractBeginNode trueBegin = trueSuccessor();
+ LogicNode conditionNode = condition();
graph().removeSplitPropagate(this, trueBegin);
tool.addToWorkList(trueBegin);
- if (condition() != null) {
- GraphUtil.tryKillUnused(condition());
+ if (conditionNode != null) {
+ GraphUtil.tryKillUnused(conditionNode);
}
if (merge.isAlive() && merge.forwardEndCount() > 1) {
for (FixedNode end : merge.forwardEnds()) {
Node cur = end;
while (cur != null && cur.predecessor() instanceof BeginNode) {
< prev index next >