Commit a4031441 authored by palfia@homejinni.com's avatar palfia@homejinni.com

MIPS: Fix PrepareKeyedOperand on MIPS.

Port r20363 (235f866c)

Original commit message:
When additional_offset is specified, the 'key' operand can be negative
and still pass the bounds check. Therefore, when converting key from
Smi, arithmetic and not logical shift must be used.

BUG=
R=plind44@gmail.com

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@20370 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 9a4eaa72
......@@ -3259,7 +3259,8 @@ MemOperand LCodeGen::PrepareKeyedOperand(Register key,
__ Addu(scratch0(), scratch0(), Operand(base_offset));
} else {
ASSERT_EQ(-1, shift_size);
__ srl(scratch0(), key, 1);
// Key can be negative, so using sra here.
__ sra(scratch0(), key, 1);
__ Addu(scratch0(), scratch0(), Operand(base_offset));
}
__ Addu(scratch0(), base, scratch0());
......
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