changeset 19369:aac293bfdced

Fix an issue that could lead to scheduling problems of box nodes after recent graph builder changes.
author Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
date Sat, 14 Feb 2015 00:56:18 +0100
parents 4d9ff841882c
children fc104173384d
files graal/com.oracle.graal.java/src/com/oracle/graal/java/GraphBuilderPhase.java
diffstat 1 files changed, 9 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.java/src/com/oracle/graal/java/GraphBuilderPhase.java	Fri Feb 13 23:45:16 2015 +0100
+++ b/graal/com.oracle.graal.java/src/com/oracle/graal/java/GraphBuilderPhase.java	Sat Feb 14 00:56:18 2015 +0100
@@ -1274,8 +1274,7 @@
                      * this block again.
                      */
                     FixedNode targetNode;
-                    if (isGoto && (block.getPredecessorCount() == 1 || !controlFlowSplit) && !block.isLoopHeader && (currentBlock.loops & ~block.loops) == 0 &&
-                                    !(lastInstr instanceof AbstractMergeNode)) {
+                    if (isGoto && (block.getPredecessorCount() == 1 || !controlFlowSplit) && !block.isLoopHeader && (currentBlock.loops & ~block.loops) == 0) {
                         block.setFirstInstruction(operatingDimension, lastInstr);
                         lastInstr = null;
                     } else {
@@ -1389,11 +1388,15 @@
                     currentBlock = block;
 
                     if (lastInstr instanceof AbstractMergeNode) {
-                        int bci = block.startBci;
-                        if (block instanceof ExceptionDispatchBlock) {
-                            bci = ((ExceptionDispatchBlock) block).deoptBci;
+
+                        AbstractMergeNode abstractMergeNode = (AbstractMergeNode) lastInstr;
+                        if (abstractMergeNode.stateAfter() == null) {
+                            int bci = block.startBci;
+                            if (block instanceof ExceptionDispatchBlock) {
+                                bci = ((ExceptionDispatchBlock) block).deoptBci;
+                            }
+                            abstractMergeNode.setStateAfter(frameState.create(bci));
                         }
-                        ((AbstractMergeNode) lastInstr).setStateAfter(frameState.create(bci));
                     }
 
                     if (block == returnBlock) {