Reviewers: Mads Ager, Description: Version 1.2.7.1.
Merge bleeding_e...@2134 to trunk to fix code generation issue with left shifts with zero. Regression test case added. Please review this at http://codereview.chromium.org/118497 SVN Base: http://v8.googlecode.com/svn/trunk/ Affected files: M src/ia32/codegen-ia32.cc M src/version.cc M test/mjsunit/smi-ops.js Index: test/mjsunit/smi-ops.js =================================================================== --- test/mjsunit/smi-ops.js (revision 2133) +++ test/mjsunit/smi-ops.js (working copy) @@ -585,3 +585,10 @@ } testShiftNonSmis(); + + +// Verify that we handle the (optimized) corner case of shifting by +// zero even for non-smis. +function shiftByZero(n) { return n << 0; } + +assertEquals(3, shiftByZero(3.1415)); Index: src/ia32/codegen-ia32.cc =================================================================== --- src/ia32/codegen-ia32.cc (revision 2133) +++ src/ia32/codegen-ia32.cc (working copy) @@ -1691,6 +1691,8 @@ int shift_value = int_value & 0x1f; operand->ToRegister(); if (shift_value == 0) { + // Spill operand so it can be overwritten in the slow case. + frame_->Spill(operand->reg()); DeferredInlineSmiOperation* deferred = new DeferredInlineSmiOperation(op, operand->reg(), Index: src/version.cc =================================================================== --- src/version.cc (revision 2133) +++ src/version.cc (working copy) @@ -35,7 +35,7 @@ #define MAJOR_VERSION 1 #define MINOR_VERSION 2 #define BUILD_NUMBER 7 -#define PATCH_LEVEL 0 +#define PATCH_LEVEL 1 #define CANDIDATE_VERSION false // Define SONAME to have the SCons build the put a specific SONAME into the --~--~---------~--~----~------------~-------~--~----~ v8-dev mailing list v8-dev@googlegroups.com http://groups.google.com/group/v8-dev -~----------~----~----~----~------~----~------~--~---