changeset 8210:c64ecb1ef1a9

Create LIRGenerator.emitOverflowCheckBranch in preparation for emitDeoptimizeOnOverflow removal
author Gilles Duboscq <duboscq@ssw.jku.at>
date Mon, 11 Mar 2013 18:41:46 +0100
parents 5ceaf43459b5
children 74896b25297a
files graal/com.oracle.graal.compiler.amd64/src/com/oracle/graal/compiler/amd64/AMD64LIRGenerator.java graal/com.oracle.graal.compiler.ptx/src/com/oracle/graal/compiler/ptx/PTXLIRGenerator.java graal/com.oracle.graal.compiler.sparc/src/com/oracle/graal/compiler/sparc/SPARCLIRGenerator.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/LIRGenerator.java
diffstat 4 files changed, 29 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.compiler.amd64/src/com/oracle/graal/compiler/amd64/AMD64LIRGenerator.java	Mon Mar 11 13:06:14 2013 +0100
+++ b/graal/com.oracle.graal.compiler.amd64/src/com/oracle/graal/compiler/amd64/AMD64LIRGenerator.java	Mon Mar 11 18:41:46 2013 +0100
@@ -279,6 +279,11 @@
     }
 
     @Override
+    public void emitOverflowCheckBranch(LabelRef destination, LIRFrameState info, boolean negated) {
+        append(new BranchOp(negated ? ConditionFlag.NoOverflow : ConditionFlag.Overflow, destination, info));
+    }
+
+    @Override
     public void emitIntegerTestBranch(Value left, Value right, boolean negated, LabelRef label, LIRFrameState info) {
         emitIntegerTest(left, right);
         append(new BranchOp(negated ? Condition.NE : Condition.EQ, label, info));
--- a/graal/com.oracle.graal.compiler.ptx/src/com/oracle/graal/compiler/ptx/PTXLIRGenerator.java	Mon Mar 11 13:06:14 2013 +0100
+++ b/graal/com.oracle.graal.compiler.ptx/src/com/oracle/graal/compiler/ptx/PTXLIRGenerator.java	Mon Mar 11 18:41:46 2013 +0100
@@ -200,6 +200,11 @@
     }
 
     @Override
+    public void emitOverflowCheckBranch(LabelRef label, LIRFrameState info, boolean negated) {
+        throw new InternalError("NYI");
+    }
+
+    @Override
     public void emitIntegerTestBranch(Value left, Value right, boolean negated, LabelRef label, LIRFrameState info) {
         throw new InternalError("NYI");
     }
--- a/graal/com.oracle.graal.compiler.sparc/src/com/oracle/graal/compiler/sparc/SPARCLIRGenerator.java	Mon Mar 11 13:06:14 2013 +0100
+++ b/graal/com.oracle.graal.compiler.sparc/src/com/oracle/graal/compiler/sparc/SPARCLIRGenerator.java	Mon Mar 11 18:41:46 2013 +0100
@@ -76,6 +76,12 @@
     }
 
     @Override
+    public void emitOverflowCheckBranch(LabelRef label, LIRFrameState info, boolean negated) {
+        // SPARC: Auto-generated method stub
+
+    }
+
+    @Override
     public void emitIntegerTestBranch(Value left, Value right, boolean negated, LabelRef label, LIRFrameState info) {
         // SPARC: Auto-generated method stub
 
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/LIRGenerator.java	Mon Mar 11 13:06:14 2013 +0100
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/LIRGenerator.java	Mon Mar 11 18:41:46 2013 +0100
@@ -641,6 +641,17 @@
         }
     }
 
+    public void emitOverflowCheckBranch(LabelRef noOverflowBlock, LabelRef overflowBlock, LIRFrameState info) {
+        if (overflowBlock != null) {
+            emitOverflowCheckBranch(overflowBlock, info, false);
+            if (noOverflowBlock != null) {
+                emitJump(noOverflowBlock, null);
+            }
+        } else {
+            emitOverflowCheckBranch(noOverflowBlock, info, true);
+        }
+    }
+
     public void emitIntegerTestBranch(IntegerTestNode test, LabelRef trueSuccessorBlock, LabelRef falseSuccessorBlock, LIRFrameState info) {
         if (falseSuccessorBlock != null) {
             emitIntegerTestBranch(operand(test.x()), operand(test.y()), true, falseSuccessorBlock, info);
@@ -687,6 +698,8 @@
 
     public abstract void emitCompareBranch(Value left, Value right, Condition cond, boolean unorderedIsTrue, LabelRef label, LIRFrameState info);
 
+    public abstract void emitOverflowCheckBranch(LabelRef label, LIRFrameState info, boolean negated);
+
     public abstract void emitIntegerTestBranch(Value left, Value right, boolean negated, LabelRef label, LIRFrameState info);
 
     public abstract Variable emitConditionalMove(Value leftVal, Value right, Condition cond, boolean unorderedIsTrue, Value trueValue, Value falseValue);