# HG changeset patch # User Gilles Duboscq # Date 1363023706 -3600 # Node ID c64ecb1ef1a9d90303abf6f75caaf110450accb3 # Parent 5ceaf43459b5fe3fe0d960abbee5c3d3349d0382 Create LIRGenerator.emitOverflowCheckBranch in preparation for emitDeoptimizeOnOverflow removal diff -r 5ceaf43459b5 -r c64ecb1ef1a9 graal/com.oracle.graal.compiler.amd64/src/com/oracle/graal/compiler/amd64/AMD64LIRGenerator.java --- 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)); diff -r 5ceaf43459b5 -r c64ecb1ef1a9 graal/com.oracle.graal.compiler.ptx/src/com/oracle/graal/compiler/ptx/PTXLIRGenerator.java --- 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"); } diff -r 5ceaf43459b5 -r c64ecb1ef1a9 graal/com.oracle.graal.compiler.sparc/src/com/oracle/graal/compiler/sparc/SPARCLIRGenerator.java --- 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 diff -r 5ceaf43459b5 -r c64ecb1ef1a9 graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/LIRGenerator.java --- 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);