From 7ad3db74850380834629c22428b428d696c3bbde Mon Sep 17 00:00:00 2001 From: "ulan@chromium.org" Date: Wed, 31 Jul 2013 12:46:54 +0000 Subject: [PATCH] Fix SHL when shift amount is zero for arm and mips. BUG=v8:2817 R=titzer@chromium.org TEST=octane Review URL: https://chromiumcodereview.appspot.com/21358002 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@15987 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/arm/lithium-codegen-arm.cc | 4 +++- src/mips/lithium-codegen-mips.cc | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) 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);