Index: src/hydrogen.cc |
diff --git a/src/hydrogen.cc b/src/hydrogen.cc |
index 7a3e203beb759bad5cd333b715f4a7ef81285dbe..1681128654d377cc273d48b0a24969fd140510f2 100644 |
--- a/src/hydrogen.cc |
+++ b/src/hydrogen.cc |
@@ -8270,7 +8270,16 @@ HInstruction* HGraphBuilder::BuildBinaryOperation(BinaryOperation* expr, |
case Token::SHR: |
instr = HShr::NewHShr(zone(), context, left, right); |
if (FLAG_opt_safe_uint32_operations && instr->IsShr()) { |
- graph()->RecordUint32Instruction(instr); |
+ bool can_be_shift_by_zero = true; |
+ if (right->IsConstant()) { |
+ HConstant* right_const = HConstant::cast(right); |
+ if (right_const->HasInteger32Value() && |
+ (right_const->Integer32Value() & 0x1f) != 0) { |
+ can_be_shift_by_zero = false; |
+ } |
+ } |
+ |
+ if (can_be_shift_by_zero) graph()->RecordUint32Instruction(instr); |
} |
break; |
case Token::SHL: |