Mercurial > hg > truffle
diff graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/nodes/expression/SLDivNode.java @ 13882:afd6fa5e8229
SL: Feedback from reviewers
author | Christian Wimmer <christian.wimmer@oracle.com> |
---|---|
date | Wed, 05 Feb 2014 08:02:15 -0800 |
parents | 64c77f0577bb |
children | c929a4a3b6c5 |
line wrap: on
line diff
--- a/graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/nodes/expression/SLDivNode.java Wed Feb 05 15:50:36 2014 +0100 +++ b/graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/nodes/expression/SLDivNode.java Wed Feb 05 08:02:15 2014 -0800 @@ -29,13 +29,16 @@ import com.oracle.truffle.sl.nodes.*; /** - * This class is similar to the extensively documented {@link SLAddNode}. + * This class is similar to the extensively documented {@link SLAddNode}. Divisions by 0 throw the + * same {@link ArithmeticException exception} as in Java, SL has no special handling for it to keep + * the code simple. */ @NodeInfo(shortName = "/") public abstract class SLDivNode extends SLBinaryNode { - @Specialization(rewriteOn = ArithmeticException.class) + @Specialization protected long div(long left, long right) { + /* No overflow is possible on a division. */ return left / right; }