Commit 9877ea8b authored by serya@chromium.org's avatar serya@chromium.org

Parsing some kinds of integers and junk values in Runtime_NumberToString. For...

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4339 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 560baa5e
......@@ -4482,7 +4482,9 @@ static Object* Runtime_StringToNumber(Arguments args) {
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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment