diff --git a/src/arm/lithium-codegen-arm.cc b/src/arm/lithium-codegen-arm.cc index 974bcccb11..a92604ecbf 100644 --- a/src/arm/lithium-codegen-arm.cc +++ b/src/arm/lithium-codegen-arm.cc @@ -1746,8 +1746,10 @@ void LCodeGen::DoShiftI(LShiftI* instr) { instr->can_deopt()) { if (shift_count != 1) { __ mov(result, Operand(left, LSL, shift_count - 1)); + __ SmiTag(result, result, SetCC); + } else { + __ SmiTag(result, left, SetCC); } - __ SmiTag(result, result, SetCC); DeoptimizeIf(vs, instr->environment()); } else { __ mov(result, Operand(left, LSL, shift_count)); diff --git a/src/mips/lithium-codegen-mips.cc b/src/mips/lithium-codegen-mips.cc index 85528f0ab2..d7d12411d4 100644 --- a/src/mips/lithium-codegen-mips.cc +++ b/src/mips/lithium-codegen-mips.cc @@ -1585,8 +1585,10 @@ void LCodeGen::DoShiftI(LShiftI* instr) { instr->can_deopt()) { if (shift_count != 1) { __ sll(result, left, shift_count - 1); + __ SmiTagCheckOverflow(result, result, scratch); + } else { + __ SmiTagCheckOverflow(result, left, scratch); } - __ SmiTagCheckOverflow(result, result, scratch); DeoptimizeIf(lt, instr->environment(), scratch, Operand(zero_reg)); } else { __ sll(result, left, shift_count);