184
184
import com .oracle .graal .python .runtime .sequence .storage .LongSequenceStorage ;
185
185
import com .oracle .graal .python .runtime .sequence .storage .ObjectSequenceStorage ;
186
186
import com .oracle .graal .python .runtime .sequence .storage .SequenceStorage ;
187
- import com .oracle .graal .python .util .OverflowException ;
188
187
import com .oracle .graal .python .util .PythonUtils ;
189
188
import com .oracle .truffle .api .Assumption ;
190
189
import com .oracle .truffle .api .CompilerAsserts ;
@@ -2143,8 +2142,8 @@ private void bytecodeBinaryOpIII(VirtualFrame virtualFrame, int stackTop, int bc
2143
2142
case BinaryOpsConstants .ADD :
2144
2143
case BinaryOpsConstants .INPLACE_ADD :
2145
2144
try {
2146
- result = PythonUtils .addExact (left , right );
2147
- } catch (OverflowException e ) {
2145
+ result = Math .addExact (left , right );
2146
+ } catch (ArithmeticException e ) {
2148
2147
CompilerDirectives .transferToInterpreterAndInvalidate ();
2149
2148
bytecode [bci ] = OpCodesConstants .BINARY_OP_II_O ;
2150
2149
bytecodeBinaryOpIIO (virtualFrame , stackTop , bci , adoptedNodes , op );
@@ -2154,8 +2153,8 @@ private void bytecodeBinaryOpIII(VirtualFrame virtualFrame, int stackTop, int bc
2154
2153
case BinaryOpsConstants .SUB :
2155
2154
case BinaryOpsConstants .INPLACE_SUB :
2156
2155
try {
2157
- result = PythonUtils .subtractExact (left , right );
2158
- } catch (OverflowException e ) {
2156
+ result = Math .subtractExact (left , right );
2157
+ } catch (ArithmeticException e ) {
2159
2158
CompilerDirectives .transferToInterpreterAndInvalidate ();
2160
2159
bytecode [bci ] = OpCodesConstants .BINARY_OP_II_O ;
2161
2160
bytecodeBinaryOpIIO (virtualFrame , stackTop , bci , adoptedNodes , op );
@@ -2165,8 +2164,8 @@ private void bytecodeBinaryOpIII(VirtualFrame virtualFrame, int stackTop, int bc
2165
2164
case BinaryOpsConstants .MUL :
2166
2165
case BinaryOpsConstants .INPLACE_MUL :
2167
2166
try {
2168
- result = PythonUtils .multiplyExact (left , right );
2169
- } catch (OverflowException e ) {
2167
+ result = Math .multiplyExact (left , right );
2168
+ } catch (ArithmeticException e ) {
2170
2169
CompilerDirectives .transferToInterpreterAndInvalidate ();
2171
2170
bytecode [bci ] = OpCodesConstants .BINARY_OP_II_O ;
2172
2171
bytecodeBinaryOpIIO (virtualFrame , stackTop , bci , adoptedNodes , op );
0 commit comments