# HG changeset patch # User Gilles Duboscq # Date 1415796608 -3600 # Node ID 728637aa02e6757aca4c6bf12f8a5802b76bfe01 # Parent f7a98bf171854f5dab281330942e6e01e8c7c244 Rename GuardNode.negated to GuardNode.isNegated diff -r f7a98bf17185 -r 728637aa02e6 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/GuardNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/GuardNode.java Wed Nov 12 13:48:47 2014 +0100 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/GuardNode.java Wed Nov 12 13:50:08 2014 +0100 @@ -70,7 +70,7 @@ return condition; } - public boolean negated() { + public boolean isNegated() { return negated; } diff -r f7a98bf17185 -r 728637aa02e6 graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/ConditionalEliminationPhase.java --- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/ConditionalEliminationPhase.java Wed Nov 12 13:48:47 2014 +0100 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/ConditionalEliminationPhase.java Wed Nov 12 13:50:08 2014 +0100 @@ -449,7 +449,7 @@ private GuardedStamp computeGuardedStamp(GuardNode guard) { if (guard.condition() instanceof IntegerBelowNode) { - if (guard.negated()) { + if (guard.isNegated()) { // Not sure how to reason about negated guards return null; } @@ -523,7 +523,7 @@ return false; } // See if we can use the other guard - if (!guard.negated() && !cstamp.getGuard().negated() && yStamp.isPositive()) { + if (!guard.isNegated() && !cstamp.getGuard().isNegated() && yStamp.isPositive()) { if (xStamp.isPositive() && xStamp.upperBound() < yStamp.lowerBound()) { // Proven true existingGuard = cstamp.getGuard(); @@ -534,7 +534,7 @@ } } } - } else if (guard.condition() instanceof IntegerEqualsNode && guard.negated()) { + } else if (guard.condition() instanceof IntegerEqualsNode && guard.isNegated()) { IntegerEqualsNode equals = (IntegerEqualsNode) guard.condition(); GuardedStamp cstamp = state.valueConstraints.get(equals.getY()); if (cstamp != null && equals.getX().isConstant()) { @@ -556,7 +556,7 @@ } private boolean tryReplaceWithExistingGuard(GuardNode guard) { - GuardingNode existingGuard = guard.negated() ? state.falseConditions.get(guard.condition()) : state.trueConditions.get(guard.condition()); + GuardingNode existingGuard = guard.isNegated() ? state.falseConditions.get(guard.condition()) : state.trueConditions.get(guard.condition()); if (existingGuard != null && existingGuard != guard) { eliminateGuard(guard, existingGuard); return true; @@ -570,10 +570,10 @@ GuardedStamp other = state.valueConstraints.get(conditional.getValue()); if (other == null) { state.valueConstraints.put(conditional.getValue(), conditional); - } else if (guard.negated() != other.getGuard().negated()) { + } else if (guard.isNegated() != other.getGuard().isNegated()) { // This seems impossible // Debug.log("negated and !negated guards %1s %1s", guard, other.getGuard()); - } else if (!guard.negated()) { + } else if (!guard.isNegated()) { // two different constraints, pick the one with the tightest type // information Stamp result = conditional.getStamp().join(other.getStamp()); @@ -670,7 +670,7 @@ // to see if they can be deleted using type constraints. for (GuardNode guard : begin.guards().snapshot()) { if (provers.contains(guard) || !(tryReplaceWithExistingGuard(guard) || testImpliedGuard(guard))) { - registerCondition(!guard.negated(), guard.condition(), guard); + registerCondition(!guard.isNegated(), guard.condition(), guard); } } for (GuardNode guard : provers) { diff -r f7a98bf17185 -r 728637aa02e6 graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/GuardLoweringPhase.java --- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/GuardLoweringPhase.java Wed Nov 12 13:48:47 2014 +0100 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/GuardLoweringPhase.java Wed Nov 12 13:50:08 2014 +0100 @@ -121,7 +121,7 @@ private void processGuard(Node node) { GuardNode guard = (GuardNode) node; - if (guard.negated() && guard.condition() instanceof IsNullNode && (guard.getSpeculation() == null || guard.getSpeculation().equals(JavaConstant.NULL_OBJECT))) { + if (guard.isNegated() && guard.condition() instanceof IsNullNode && (guard.getSpeculation() == null || guard.getSpeculation().equals(JavaConstant.NULL_OBJECT))) { ValueNode obj = ((IsNullNode) guard.condition()).getValue(); nullGuarded.put(obj, guard); } @@ -168,7 +168,7 @@ BeginNode trueSuccessor; BeginNode falseSuccessor; insertLoopExits(deopt); - if (guard.negated()) { + if (guard.isNegated()) { trueSuccessor = deoptBranch; falseSuccessor = fastPath; } else { diff -r f7a98bf17185 -r 728637aa02e6 graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/LoweringPhase.java --- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/LoweringPhase.java Wed Nov 12 13:48:47 2014 +0100 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/LoweringPhase.java Wed Nov 12 13:50:08 2014 +0100 @@ -135,7 +135,7 @@ public GuardingNode createGuard(FixedNode before, LogicNode condition, DeoptimizationReason deoptReason, DeoptimizationAction action, boolean negated) { if (OptEliminateGuards.getValue()) { for (Node usage : condition.usages()) { - if (!activeGuards.isNew(usage) && activeGuards.isMarked(usage) && ((GuardNode) usage).negated() == negated) { + if (!activeGuards.isNew(usage) && activeGuards.isMarked(usage) && ((GuardNode) usage).isNegated() == negated) { return (GuardNode) usage; } } diff -r f7a98bf17185 -r 728637aa02e6 graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/OptimizeGuardAnchorsPhase.java --- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/OptimizeGuardAnchorsPhase.java Wed Nov 12 13:48:47 2014 +0100 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/OptimizeGuardAnchorsPhase.java Wed Nov 12 13:50:08 2014 +0100 @@ -110,7 +110,7 @@ if (otherGuards.size() == successorCount - 1) { BeginNode anchor = computeOptimalAnchor(cfg.get(), BeginNode.prevBegin(controlSplit)); - GuardNode newGuard = controlSplit.graph().unique(GuardNode.create(guard.condition(), anchor, guard.reason(), guard.action(), guard.negated(), guard.getSpeculation())); + GuardNode newGuard = controlSplit.graph().unique(GuardNode.create(guard.condition(), anchor, guard.reason(), guard.action(), guard.isNegated(), guard.getSpeculation())); for (GuardNode otherGuard : otherGuards) { otherGuard.replaceAndDelete(newGuard); } @@ -122,7 +122,7 @@ } private static boolean compatibleGuards(GuardNode guard, GuardNode conditonGuard) { - return conditonGuard.negated() == guard.negated() && conditonGuard.action() == guard.action() && conditonGuard.reason() == guard.reason() && + return conditonGuard.isNegated() == guard.isNegated() && conditonGuard.action() == guard.action() && conditonGuard.reason() == guard.reason() && conditonGuard.getSpeculation().equals(guard.getSpeculation()); }