changeset 21045:934c6ec83d62

support for DeoptBefore nodes in late lowered snippets
author Doug Simon <doug.simon@oracle.com>
date Mon, 20 Apr 2015 19:06:56 +0200
parents 5ea65fe64368
children d35d2ac04970
files graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/CollapseFrameForSingleSideEffectPhase.java
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/CollapseFrameForSingleSideEffectPhase.java	Mon Apr 20 18:27:46 2015 +0200
+++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/CollapseFrameForSingleSideEffectPhase.java	Mon Apr 20 19:06:56 2015 +0200
@@ -135,6 +135,8 @@
                         state = state.addSideEffect(stateSplit);
                     } else if (currentState.invalid) {
                         setStateAfter(node.graph(), stateSplit, INVALID_FRAMESTATE_BCI, false);
+                    } else if (stateSplit instanceof StartNode) {
+                        setStateAfter(node.graph(), stateSplit, BEFORE_BCI, false);
                     } else {
                         stateSplit.setStateAfter(null);
                         if (frameState.hasNoUsages()) {
@@ -219,13 +221,13 @@
          *
          * @param graph the graph context
          * @param node the node whose frame state is updated
-         * @param bci {@link BytecodeFrame#AFTER_BCI}, {@link BytecodeFrame#AFTER_EXCEPTION_BCI} or
+         * @param bci {@link BytecodeFrame#BEFORE_BCI}, {@link BytecodeFrame#AFTER_EXCEPTION_BCI} or
          *            {@link BytecodeFrame#INVALID_FRAMESTATE_BCI}
          * @param replaceOnly only perform the update if the node currently has a non-null frame
          *            state
          */
         private static void setStateAfter(StructuredGraph graph, StateSplit node, int bci, boolean replaceOnly) {
-            assert bci == AFTER_BCI || bci == AFTER_EXCEPTION_BCI || bci == INVALID_FRAMESTATE_BCI;
+            assert (bci == BEFORE_BCI && node instanceof StartNode) || bci == AFTER_BCI || bci == AFTER_EXCEPTION_BCI || bci == INVALID_FRAMESTATE_BCI;
             FrameState currentStateAfter = node.stateAfter();
             if (currentStateAfter != null || !replaceOnly) {
                 node.setStateAfter(graph.add(new FrameState(bci)));