X64: Ensure that unary subtraction returns a zero-extended smi, if it returns a smi.

Review URL: http://codereview.chromium.org/195101

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2900 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
whesse@chromium.org 2009-09-16 12:40:15 +00:00
parent 677c043fee
commit 412a146825
2 changed files with 4 additions and 1 deletions

View File

@ -6320,7 +6320,7 @@ void UnarySubStub::Generate(MacroAssembler* masm) {
// Also enter it if the value of the smi is Smi::kMinValue
__ testl(rax, Immediate(0x7FFFFFFE));
__ j(zero, &special);
__ neg(rax);
__ negl(rax);
__ jmp(&done);
__ bind(&special);

View File

@ -309,3 +309,6 @@ Array.prototype[1] = 1;
assertEquals(1, arr.pop());
assertEquals(0, arr.pop());
Array.prototype[1] = undefined;
// Test http://code.google.com/p/chromium/issues/detail?id=21860
Array.prototype.push.apply([], [1].splice(0, -(-1 % 5)));