| Index: src/x87/lithium-codegen-x87.cc
|
| diff --git a/src/x87/lithium-codegen-x87.cc b/src/x87/lithium-codegen-x87.cc
|
| index 1e9168d4bb5c7b58c6dc310dc661877f1856b127..dab87688a3f870a8518a29d8b60724d8ab35200c 100644
|
| --- a/src/x87/lithium-codegen-x87.cc
|
| +++ b/src/x87/lithium-codegen-x87.cc
|
| @@ -1546,14 +1546,17 @@ void LCodeGen::DoFlooringDivByPowerOf2I(LFlooringDivByPowerOf2I* instr) {
|
| 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;
|
| }
|
|
|
|
|