Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(526)

Unified Diff: src/math.js

Issue 509007: Optimize implementation of Math.floor a little by special casing... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« src/ia32/codegen-ia32.cc ('K') | « src/macros.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/math.js
===================================================================
--- src/math.js (revision 3503)
+++ src/math.js (working copy)
@@ -98,7 +98,7 @@
if (!IS_NUMBER(x)) x = ToNumber(x);
// It's more common to call this with a positive number that's out
// of range than negative numbers; check the upper bound first.
- if (x <= 0x7FFFFFFF && x > 0) {
+ if (x < 0x80000000 && x > 0) {
// Numbers in the range [0, 2^31) can be floored by converting
// them to an unsigned 32-bit value using the shift operator.
// We avoid doing so for -0, because the result of Math.floor(-0)
« src/ia32/codegen-ia32.cc ('K') | « src/macros.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698