Reviewers: Lasse Reichstein, Description: X64: Ensure that unary subtraction returns a zero-extended smi, if it returns a smi.
Please review this at http://codereview.chromium.org/195101 SVN Base: http://v8.googlecode.com/svn/branches/bleeding_edge/ Affected files: M src/x64/codegen-x64.cc M test/mjsunit/array-splice.js Index: src/x64/codegen-x64.cc =================================================================== --- src/x64/codegen-x64.cc (revision 2897) +++ src/x64/codegen-x64.cc (working copy) @@ -6320,7 +6320,7 @@ // 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); Index: test/mjsunit/array-splice.js =================================================================== --- test/mjsunit/array-splice.js (revision 2897) +++ test/mjsunit/array-splice.js (working copy) @@ -309,3 +309,6 @@ 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))); --~--~---------~--~----~------------~-------~--~----~ v8-dev mailing list [email protected] http://groups.google.com/group/v8-dev -~----------~----~----~----~------~----~------~--~---
