changeset 14941:8c3d77087894

Code cleanup in FrameStateAssignmentPhase.
author Roland Schatz <roland.schatz@oracle.com>
date Tue, 01 Apr 2014 15:49:08 +0200
parents 82971f397b94
children 13a8c3454e76
files graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/FrameStateAssignmentPhase.java
diffstat 1 files changed, 9 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/FrameStateAssignmentPhase.java	Wed Apr 02 14:19:38 2014 +0200
+++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/FrameStateAssignmentPhase.java	Tue Apr 01 15:49:08 2014 +0200
@@ -36,7 +36,7 @@
 /**
  * This phase transfers {@link FrameState} nodes from {@link StateSplit} nodes to
  * {@link DeoptimizingNode DeoptimizingNodes}.
- * 
+ *
  * This allow to enter the {@link GuardsStage#AFTER_FSA AFTER_FSA} stage of the graph where no new
  * node that may cause deoptimization can be introduced anymore.
  * <p>
@@ -48,7 +48,8 @@
     private static class FrameStateAssignmentClosure extends NodeIteratorClosure<FrameState> {
 
         @Override
-        protected FrameState processNode(FixedNode node, FrameState currentState) {
+        protected FrameState processNode(FixedNode node, FrameState previousState) {
+            FrameState currentState = previousState;
             if (node instanceof DeoptimizingNode.DeoptBefore) {
                 DeoptimizingNode.DeoptBefore deopt = (DeoptimizingNode.DeoptBefore) node;
                 if (deopt.canDeoptimize() && deopt.stateBefore() == null) {
@@ -57,12 +58,11 @@
                 }
             }
 
-            FrameState newState = currentState;
             if (node instanceof StateSplit) {
                 StateSplit stateSplit = (StateSplit) node;
                 FrameState stateAfter = stateSplit.stateAfter();
                 if (stateAfter != null) {
-                    newState = stateAfter;
+                    currentState = stateAfter;
                     stateSplit.setStateAfter(null);
                 }
             }
@@ -70,20 +70,20 @@
             if (node instanceof DeoptimizingNode.DeoptDuring) {
                 DeoptimizingNode.DeoptDuring deopt = (DeoptimizingNode.DeoptDuring) node;
                 if (deopt.canDeoptimize()) {
-                    GraalInternalError.guarantee(newState != null, "no FrameState at DeoptimizingNode %s", deopt);
-                    deopt.computeStateDuring(newState);
+                    GraalInternalError.guarantee(currentState != null, "no FrameState at DeoptimizingNode %s", deopt);
+                    deopt.computeStateDuring(currentState);
                 }
             }
 
             if (node instanceof DeoptimizingNode.DeoptAfter) {
                 DeoptimizingNode.DeoptAfter deopt = (DeoptimizingNode.DeoptAfter) node;
                 if (deopt.canDeoptimize() && deopt.stateAfter() == null) {
-                    GraalInternalError.guarantee(newState != null, "no FrameState at DeoptimizingNode %s", deopt);
-                    deopt.setStateAfter(newState);
+                    GraalInternalError.guarantee(currentState != null, "no FrameState at DeoptimizingNode %s", deopt);
+                    deopt.setStateAfter(currentState);
                 }
             }
 
-            return newState;
+            return currentState;
         }
 
         @Override