| Index: src/x64/lithium-x64.cc
|
| diff --git a/src/x64/lithium-x64.cc b/src/x64/lithium-x64.cc
|
| index 620bbc94e521df8d43e3429196821ac2cfc055c6..931424ee055c4997c934c2d4c054fca49cc172c9 100644
|
| --- a/src/x64/lithium-x64.cc
|
| +++ b/src/x64/lithium-x64.cc
|
| @@ -851,24 +851,22 @@ LInstruction* LChunkBuilder::DoShift(Token::Value op,
|
| right = UseFixed(right_value, rcx);
|
| }
|
|
|
| - // Shift operations can only deoptimize if we do a logical shift
|
| - // by 0 and the result cannot be truncated to int32.
|
| - bool can_deopt = (op == Token::SHR && constant_value == 0);
|
| - if (can_deopt) {
|
| - bool can_truncate = true;
|
| - for (int i = 0; i < instr->uses()->length(); i++) {
|
| - if (!instr->uses()->at(i)->CheckFlag(HValue::kTruncatingToInt32)) {
|
| - can_truncate = false;
|
| + // Shift operations can only deoptimize if we do a logical shift by 0 and
|
| + // the result cannot be truncated to int32.
|
| + bool may_deopt = (op == Token::SHR && constant_value == 0);
|
| + bool does_deopt = false;
|
| + if (may_deopt) {
|
| + for (HUseIterator it(instr->uses()); !it.Done(); it.Advance()) {
|
| + if (!it.value()->CheckFlag(HValue::kTruncatingToInt32)) {
|
| + does_deopt = true;
|
| break;
|
| }
|
| }
|
| - can_deopt = !can_truncate;
|
| }
|
|
|
| - LShiftI* result = new LShiftI(op, left, right, can_deopt);
|
| - return can_deopt
|
| - ? AssignEnvironment(DefineSameAsFirst(result))
|
| - : DefineSameAsFirst(result);
|
| + LInstruction* result =
|
| + DefineSameAsFirst(new LShiftI(op, left, right, does_deopt));
|
| + return does_deopt ? AssignEnvironment(result) : result;
|
| }
|
|
|
|
|
|
|