# HG changeset patch # User Thomas Wuerthinger # Date 1367131886 -7200 # Node ID da8823658fe029365404f60efb04f7f36fdaaca9 # Parent 4a9fd6d90284e345fb6788a692d4d8ce86e1fb95 Back out two changes around frame states. diff -r 4a9fd6d90284 -r da8823658fe0 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/BeginNode.java --- 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(); diff -r 4a9fd6d90284 -r da8823658fe0 graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/FrameStateAssignmentPhase.java --- 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 states) { + private static FrameState singleFrameState(@SuppressWarnings("unused") MergeNode merge, List 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; - } - } }