changeset 9387:da8823658fe0

Back out two changes around frame states.
author Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
date Sun, 28 Apr 2013 08:51:26 +0200
parents 4a9fd6d90284
children 1152c17b51dc
files graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/BeginNode.java graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/FrameStateAssignmentPhase.java
diffstat 2 files changed, 1 insertions(+), 51 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/BeginNode.java	Sun Apr 28 08:46:28 2013 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/BeginNode.java	Sun Apr 28 08:51:26 2013 +0200
@@ -73,8 +73,6 @@
             // This is the start node.
         } else if (prev instanceof ControlSplitNode) {
             // This begin node is necessary.
-        } else if (this.stateAfter() != null) {
-            // Begin node necessary to preserve state.
         } else {
             // This begin node can be removed and all guards moved up to the preceding begin node.
             prepareDelete();
--- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/FrameStateAssignmentPhase.java	Sun Apr 28 08:46:28 2013 +0200
+++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/FrameStateAssignmentPhase.java	Sun Apr 28 08:51:26 2013 +0200
@@ -24,8 +24,6 @@
 
 import java.util.*;
 
-import com.oracle.graal.api.meta.*;
-import com.oracle.graal.debug.*;
 import com.oracle.graal.graph.*;
 import com.oracle.graal.graph.iterators.*;
 import com.oracle.graal.nodes.*;
@@ -128,7 +126,7 @@
         return true;
     }
 
-    private static FrameState singleFrameState(MergeNode merge, List<FrameStateAssignmentState> states) {
+    private static FrameState singleFrameState(@SuppressWarnings("unused") MergeNode merge, List<FrameStateAssignmentState> states) {
         if (states.size() == 0) {
             return null;
         }
@@ -156,52 +154,6 @@
         if (singleState != null) {
             return singleState;
         }
-
-        if (singleBci != FrameState.INVALID_FRAMESTATE_BCI) {
-            FrameState outerState = firstState.outerFrameState();
-            boolean duringCall = firstState.duringCall();
-            boolean rethrowException = firstState.rethrowException();
-            int stackSize = firstState.stackSize();
-            int localsSize = firstState.localsSize();
-            ResolvedJavaMethod method = firstState.method();
-            FrameState newState = firstState.duplicate();
-            for (int i = 1; i < states.size(); ++i) {
-                FrameState curState = states.get(i).getFramestate();
-                assert curState.duringCall() == duringCall;
-                assert curState.rethrowException() == rethrowException;
-                assert curState.stackSize() == stackSize;
-                assert curState.localsSize() == localsSize;
-                assert curState.method() == method;
-                assert curState.outerFrameState() == outerState;
-
-                for (int j = 0; j < localsSize + stackSize; ++j) {
-                    ValueNode oldValue = newState.values().get(j);
-                    ValueNode curValue = curState.values().get(j);
-                    newState.values().set(j, merge(merge, oldValue, curValue, i));
-                }
-            }
-
-            Debug.log("Created artificial frame state with bci %d ", singleBci);
-            return newState;
-        }
         return null;
     }
-
-    private static ValueNode merge(MergeNode merge, ValueNode oldValue, ValueNode newValue, int processedPreds) {
-        if (oldValue == newValue) {
-            return oldValue;
-        }
-
-        if (oldValue instanceof PhiNode && ((PhiNode) oldValue).merge() == merge) {
-            ((PhiNode) oldValue).addInput(newValue);
-            return oldValue;
-        } else {
-            PhiNode newPhi = merge.graph().add(new PhiNode(oldValue.kind(), merge));
-            for (int i = 0; i < processedPreds; ++i) {
-                newPhi.addInput(oldValue);
-            }
-            newPhi.addInput(newValue);
-            return newPhi;
-        }
-    }
 }