Revision: 4339
Author: [email protected]
Date: Mon Apr  5 01:00:28 2010
Log: Parsing some kinds of integers and junk values in Runtime_NumberToString. For that values the string is converted into int and then into SMI. It lets to avoid floating point operations.


Committed: http://code.google.com/p/v8/source/detail?r=4331
Review URL: http://codereview.chromium.org/1572004
http://code.google.com/p/v8/source/detail?r=4339

Modified:
 /branches/bleeding_edge/src/runtime.cc

=======================================
--- /branches/bleeding_edge/src/runtime.cc      Wed Mar 31 10:19:05 2010
+++ /branches/bleeding_edge/src/runtime.cc      Mon Apr  5 01:00:28 2010
@@ -4482,7 +4482,9 @@
     bool minus = (data[0] == '-');
     int start_pos = (minus ? 1 : 0);

-    if (start_pos == len || data[start_pos] > '9') {
+    if (start_pos == len) {
+      return Heap::nan_value();
+    } else if (data[start_pos] > '9') {
       // Fast check for a junk value. A valid string may start from a
// whitespace, a sign ('+' or '-'), the decimal point, a decimal digit or // the 'I' character ('Infinity'). All of that have codes not greater than

--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

To unsubscribe, reply using "remove me" as the subject.

Reply via email to