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

Issue 1529004: StringToInt rewritten. This version doesn't allocate memory for long decimals... (Closed)

Created:
10 years, 8 months ago by SeRya
Modified:
9 years, 7 months ago
Reviewers:
floitschv8
CC:
v8-dev
Visibility:
Public.

Description

StringToInt rewritten. This version doesn't allocate memory for long decimals and uses percise rounding if radix 10 or a power of 2 (in other cases rounding error still may occur). Handling special values moved from Runtime_StringParseInt into StringToInt in order to make it consistent with StringToDouble. Committed: http://code.google.com/p/v8/source/detail?r=4329 Committed: http://code.google.com/p/v8/source/detail?r=4333

Patch Set 1 : '' #

Total comments: 12

Patch Set 2 : '' #

Patch Set 3 : '' #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+242 lines, -204 lines) Patch
M src/conversions.h View 1 2 1 chunk +1 line, -2 lines 0 comments Download
M src/conversions.cc View 1 2 12 chunks +216 lines, -158 lines 3 comments Download
M src/runtime.cc View 1 2 1 chunk +3 lines, -43 lines 0 comments Download
M test/mjsunit/parse-int-float.js View 2 2 chunks +18 lines, -1 line 0 comments Download
M test/mjsunit/str-to-num.js View 1 chunk +4 lines, -0 lines 0 comments Download

Messages

Total messages: 7 (0 generated)
SeRya
10 years, 8 months ago (2010-03-30 13:48:22 UTC) #1
Florian Loitsch
LGTM with comments. http://codereview.chromium.org/1529004/diff/8001/9001 File src/conversions.cc (right): http://codereview.chromium.org/1529004/diff/8001/9001#newcode246 src/conversions.cc:246: static double InternalStringToInt(Iterator current, indentation seems ...
10 years, 8 months ago (2010-03-30 15:08:43 UTC) #2
SeRya
http://codereview.chromium.org/1529004/diff/8001/9001 File src/conversions.cc (right): http://codereview.chromium.org/1529004/diff/8001/9001#newcode246 src/conversions.cc:246: static double InternalStringToInt(Iterator current, On 2010/03/30 15:08:44, Florian Loitsch ...
10 years, 8 months ago (2010-03-31 09:34:58 UTC) #3
SeRya
Fixed issue with long decimal numbers what failed webkit tests. Fixed Number('0x '). Tests added.
10 years, 8 months ago (2010-03-31 14:17:10 UTC) #4
Florian Loitsch
LGTM. http://codereview.chromium.org/1529004/diff/29001/30003 File src/conversions.cc (right): http://codereview.chromium.org/1529004/diff/29001/30003#newcode335 src/conversions.cc:335: // The buffer may contain up to kMaxSignificantDigits ...
10 years, 8 months ago (2010-03-31 16:49:59 UTC) #5
SeRya
http://codereview.chromium.org/1529004/diff/29001/30003 File src/conversions.cc (right): http://codereview.chromium.org/1529004/diff/29001/30003#newcode335 src/conversions.cc:335: // The buffer may contain up to kMaxSignificantDigits + ...
10 years, 8 months ago (2010-03-31 17:18:08 UTC) #6
Florian Loitsch
10 years, 8 months ago (2010-04-03 13:10:58 UTC) #7
LGTM.

http://codereview.chromium.org/1529004/diff/29001/30003
File src/conversions.cc (right):

http://codereview.chromium.org/1529004/diff/29001/30003#newcode335
src/conversions.cc:335: // The buffer may contain up to kMaxSignificantDigits +
1 digits and a zero
On 2010/03/31 17:18:08, SeRya wrote:
> On 2010/03/31 16:50:00, Florian Loitsch wrote:
> > Maybe add comment:
> > A number with more than kMaxSignificantDigits digits will be read as
Infinity.
> 
> The comment 7 lines below says the same. I think that is place more suitable
> since digits are dropped there and it explaines why it's safe.
true. fine with me.

Powered by Google App Engine
This is Rietveld 408576698