< 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,30 ****
* 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.NodeSize.SIZE_2;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
--- 20,30 ----
* 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_1;
import static org.graalvm.compiler.nodeinfo.NodeSize.SIZE_2;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
*** 72,82 ****
/**
* 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")
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");
--- 72,82 ----
/**
* The {@code IfNode} represents a branch that can go one of two directions depending on the outcome
* of a comparison.
*/
! @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,383 ****
if (unbox == null || unboxCheck == null) {
return false;
}
// Falsify the reference check.
! setCondition(graph().addOrUnique(LogicConstantNode.contradiction()));
return true;
}
/**
--- 373,383 ----
if (unbox == null || unboxCheck == null) {
return false;
}
// Falsify the reference check.
! setCondition(graph().addOrUniqueWithInputs(LogicConstantNode.contradiction()));
return true;
}
/**
*** 724,737 ****
return false;
}
protected void removeThroughFalseBranch(SimplifierTool tool, AbstractMergeNode merge) {
AbstractBeginNode trueBegin = trueSuccessor();
graph().removeSplitPropagate(this, trueBegin);
tool.addToWorkList(trueBegin);
! if (condition() != null) {
! GraphUtil.tryKillUnused(condition());
}
if (merge.isAlive() && merge.forwardEndCount() > 1) {
for (FixedNode end : merge.forwardEnds()) {
Node cur = end;
while (cur != null && cur.predecessor() instanceof BeginNode) {
--- 724,738 ----
return false;
}
protected void removeThroughFalseBranch(SimplifierTool tool, AbstractMergeNode merge) {
AbstractBeginNode trueBegin = trueSuccessor();
+ LogicNode conditionNode = condition();
graph().removeSplitPropagate(this, trueBegin);
tool.addToWorkList(trueBegin);
! 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 >