Index: src/arm/lithium-arm.cc |
diff --git a/src/arm/lithium-arm.cc b/src/arm/lithium-arm.cc |
index faf640490b705a850e04dcbde83a91743694e9b3..b05e555e41ad5062155e75deefa762311f8caaef 100644 |
--- a/src/arm/lithium-arm.cc |
+++ b/src/arm/lithium-arm.cc |
@@ -858,22 +858,20 @@ LInstruction* LChunkBuilder::DoShift(Token::Value op, |
// 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; |
+ 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; |
} |
LInstruction* result = |
- DefineSameAsFirst(new LShiftI(op, left, right, can_deopt)); |
- if (can_deopt) AssignEnvironment(result); |
- return result; |
+ DefineSameAsFirst(new LShiftI(op, left, right, does_deopt)); |
+ return does_deopt ? AssignEnvironment(result) : result; |
} |