Index: src/x87/lithium-codegen-x87.cc |
=================================================================== |
--- src/x87/lithium-codegen-x87.cc (revision 21827) |
+++ src/x87/lithium-codegen-x87.cc (working copy) |
@@ -1546,14 +1546,17 @@ |
DeoptimizeIf(zero, instr->environment()); |
} |
- if (!instr->hydrogen()->CheckFlag(HValue::kLeftCanBeMinInt)) { |
- __ sar(dividend, shift); |
+ // Dividing by -1 is basically negation, unless we overflow. |
+ if (divisor == -1) { |
+ if (instr->hydrogen()->CheckFlag(HValue::kLeftCanBeMinInt)) { |
+ DeoptimizeIf(overflow, instr->environment()); |
+ } |
return; |
} |
- // Dividing by -1 is basically negation, unless we overflow. |
- if (divisor == -1) { |
- DeoptimizeIf(overflow, instr->environment()); |
+ // If the negation could not overflow, simply shifting is OK. |
+ if (!instr->hydrogen()->CheckFlag(HValue::kLeftCanBeMinInt)) { |
+ __ sar(dividend, shift); |
return; |
} |