comparison graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/nodes/ArithmeticNode.java @ 8243:d81ff782fa1a

Removed @SpecializationThrows from codegen API. Replaced it by a simplier version in @Specialization.
author Christian Humer <christian.humer@gmail.com>
date Mon, 04 Mar 2013 17:20:26 +0100
parents 33e08aca06ff
children 5b08b0f4d338
comparison
equal deleted inserted replaced
8242:ac4e8c16ffdf 8243:d81ff782fa1a
50 50
51 protected AddNode(AddNode node) { 51 protected AddNode(AddNode node) {
52 super(node); 52 super(node);
53 } 53 }
54 54
55 @Specialization 55 @Specialization(rewriteOn = ArithmeticException.class)
56 @SpecializationThrows(javaClass = ArithmeticException.class, transitionTo = "doBigInteger")
57 int doInteger(int left, int right) { 56 int doInteger(int left, int right) {
58 return ExactMath.addExact(left, right); 57 return ExactMath.addExact(left, right);
59 } 58 }
60 59
61 @Specialization 60 @Specialization
82 81
83 protected SubNode(SubNode node) { 82 protected SubNode(SubNode node) {
84 super(node); 83 super(node);
85 } 84 }
86 85
87 @Specialization 86 @Specialization(rewriteOn = ArithmeticException.class)
88 @SpecializationThrows(javaClass = ArithmeticException.class, transitionTo = "doBigInteger")
89 int doInteger(int left, int right) { 87 int doInteger(int left, int right) {
90 return ExactMath.subtractExact(left, right); 88 return ExactMath.subtractExact(left, right);
91 } 89 }
92 90
93 @Specialization 91 @Specialization
104 102
105 protected DivNode(DivNode node) { 103 protected DivNode(DivNode node) {
106 super(node); 104 super(node);
107 } 105 }
108 106
109 @Specialization 107 @Specialization(rewriteOn = ArithmeticException.class)
110 @SpecializationThrows(javaClass = ArithmeticException.class, transitionTo = "doBigInteger")
111 int doInteger(int left, int right) { 108 int doInteger(int left, int right) {
112 return left / right; 109 return left / right;
113 } 110 }
114 111
115 @Specialization 112 @Specialization
126 123
127 protected MulNode(MulNode node) { 124 protected MulNode(MulNode node) {
128 super(node); 125 super(node);
129 } 126 }
130 127
131 @Specialization 128 @Specialization(rewriteOn = ArithmeticException.class)
132 @SpecializationThrows(javaClass = ArithmeticException.class, transitionTo = "doBigInteger")
133 int doInteger(int left, int right) { 129 int doInteger(int left, int right) {
134 return ExactMath.multiplyExact(left, right); 130 return ExactMath.multiplyExact(left, right);
135 } 131 }
136 132
137 @Specialization 133 @Specialization