changeset 3125:a2b425ca743e

fixed outdated asserts.
author Thomas Wuerthinger <thomas@wuerthinger.net>
date Thu, 30 Jun 2011 18:45:44 +0200
parents 573c8e2917ab
children e8ae455bb538
files graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/alloc/EdgeMoveOptimizer.java
diffstat 1 files changed, 10 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/alloc/EdgeMoveOptimizer.java	Thu Jun 30 18:39:13 2011 +0200
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/alloc/EdgeMoveOptimizer.java	Thu Jun 30 18:45:44 2011 +0200
@@ -136,8 +136,12 @@
                 return;
             }
 
+            if (predInstructions.get(predInstructions.size() - 1).code == LIROpcode.Xir) {
+                return;
+            }
+
             assert pred.suxAt(0) == block : "invalid control flow";
-            assert predInstructions.get(predInstructions.size() - 1).code == LIROpcode.Branch : "block with successor must end with branch";
+            assert predInstructions.get(predInstructions.size() - 1).code == LIROpcode.Branch : "block with successor must end with branch" + predInstructions.get(predInstructions.size() - 1);
             assert predInstructions.get(predInstructions.size() - 1) instanceof LIRBranch : "branch must be LIROpBranch";
             assert ((LIRBranch) predInstructions.get(predInstructions.size() - 1)).cond() == Condition.TRUE : "block must end with unconditional branch";
 
@@ -191,6 +195,11 @@
 
         assert numSux == 2 : "method should not be called otherwise";
 
+        if (instructions.get(instructions.size() - 1).code == LIROpcode.Xir) {
+            // cannot optimize when last instruction is Xir.
+            return;
+        }
+
         assert instructions.get(instructions.size() - 1).code == LIROpcode.Branch : "block with successor must end with branch block=B" + block.blockID();
         assert instructions.get(instructions.size() - 1) instanceof LIRBranch : "branch must be LIROpBranch";
         assert ((LIRBranch) instructions.get(instructions.size() - 1)).cond() == Condition.TRUE : "block must end with unconditional branch";