Commit 0af94e4a authored by titzer@chromium.org's avatar titzer@chromium.org

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
parent f3fff3c2
......@@ -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 {
......
......@@ -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 {
......
......@@ -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 {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment