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
This commit is contained in:
parent
9a4eaa72dc
commit
a403144159
@ -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());
|
||||
|
Loading…
Reference in New Issue
Block a user