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

Unified Diff: src/v8natives.js

Issue 21507: Experimental: port bleeding_edge r1276 (a grab bag of optimizations)... (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/toiger/
Patch Set: Created 11 years, 10 months 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
Index: src/v8natives.js
===================================================================
--- src/v8natives.js (revision 1313)
+++ src/v8natives.js (working copy)
@@ -81,11 +81,11 @@
// non-Smi number 9 times faster (230ns vs 2070ns). Together
// they make parseInt on a string 1.4% slower (274ns vs 270ns).
if (%_IsSmi(string)) return string;
- if (IS_NUMBER(string)) {
- if (string >= 0.01 && string < 1e9)
- return $floor(string);
- if (string <= -0.01 && string > -1e9)
- return - $floor(-string);
+ if (IS_NUMBER(string) &&
+ ((string < -0.01 && -1e9 < string) ||
+ (0.01 < string && string < 1e9))) {
+ // Truncate number.
+ return string | 0;
}
} else {
radix = TO_INT32(radix);
« src/codegen-ia32.cc ('K') | « src/string.js ('k') | test/mjsunit/date.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698