Don't generate a shift left by one if can deoptimize on ia32 and arm and mips.

BUG=
R=verwaest@chromium.org

Review URL: https://codereview.chromium.org/21196006

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@15958 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
titzer@chromium.org 2013-07-30 13:30:03 +00:00
parent f3fff3c2f4
commit 0af94e4ac4
3 changed files with 9 additions and 3 deletions

View File

@ -1744,7 +1744,9 @@ void LCodeGen::DoShiftI(LShiftI* instr) {
if (shift_count != 0) {
if (instr->hydrogen_value()->representation().IsSmi() &&
instr->can_deopt()) {
__ mov(result, Operand(left, LSL, shift_count - 1));
if (shift_count != 1) {
__ mov(result, Operand(left, LSL, shift_count - 1));
}
__ SmiTag(result, result, SetCC);
DeoptimizeIf(vs, instr->environment());
} else {

View File

@ -1771,7 +1771,9 @@ void LCodeGen::DoShiftI(LShiftI* instr) {
if (shift_count != 0) {
if (instr->hydrogen_value()->representation().IsSmi() &&
instr->can_deopt()) {
__ shl(ToRegister(left), shift_count - 1);
if (shift_count != 1) {
__ shl(ToRegister(left), shift_count - 1);
}
__ SmiTag(ToRegister(left));
DeoptimizeIf(overflow, instr->environment());
} else {

View File

@ -1583,7 +1583,9 @@ void LCodeGen::DoShiftI(LShiftI* instr) {
if (shift_count != 0) {
if (instr->hydrogen_value()->representation().IsSmi() &&
instr->can_deopt()) {
__ sll(result, left, shift_count - 1);
if (shift_count != 1) {
__ sll(result, left, shift_count - 1);
}
__ SmiTagCheckOverflow(result, result, scratch);
DeoptimizeIf(lt, instr->environment(), scratch, Operand(zero_reg));
} else {