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

Issue 4060001: Bignum implementation of Strtod. (Closed)

Created:
10 years, 2 months ago by Florian Loitsch
Modified:
9 years, 7 months ago
Reviewers:
William Hesse
CC:
v8-dev
Visibility:
Public.

Description

Bignum implementation of Strtod. This removes the dependency on Gay's strtod. Committed: http://code.google.com/p/v8/source/detail?r=5778

Patch Set 1 #

Patch Set 2 : Fix lint errors. #

Patch Set 3 : Fix comment. #

Total comments: 43

Patch Set 4 : Adressed comments. #

Total comments: 2

Patch Set 5 : Adressed comments. RandomStrtod now uses deterministic random function. #

Patch Set 6 : Try upload again. #

Patch Set 7 : bignum.h changes that somehow disappeared earlier. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+2704 lines, -44 lines) Patch
M src/SConscript View 1 chunk +1 line, -0 lines 0 comments Download
A src/bignum.h View 1 2 3 4 5 6 1 chunk +140 lines, -0 lines 0 comments Download
A src/bignum.cc View 1 2 3 4 5 6 1 chunk +767 lines, -0 lines 0 comments Download
M src/double.h View 2 chunks +8 lines, -2 lines 0 comments Download
M src/strtod.cc View 1 2 3 4 4 chunks +88 lines, -41 lines 0 comments Download
M test/cctest/SConscript View 1 chunk +1 line, -0 lines 0 comments Download
A test/cctest/test-bignum.cc View 1 2 3 4 1 chunk +1502 lines, -0 lines 0 comments Download
M test/cctest/test-strtod.cc View 1 2 3 4 3 chunks +161 lines, -1 line 0 comments Download
M tools/gyp/v8.gyp View 1 2 3 1 chunk +4 lines, -0 lines 0 comments Download
M tools/visual_studio/v8_base.vcproj View 2 chunks +32 lines, -0 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
Florian Loitsch
10 years, 2 months ago (2010-10-21 17:15:33 UTC) #1
William Hesse
Reviewed all but strtod.cc and the three test files. Their reviews will follow. http://codereview.chromium.org/4060001/diff/17001/18002 File ...
10 years, 1 month ago (2010-11-04 14:20:46 UTC) #2
Florian Loitsch
Adressed comments. Please have another look. I haven't yet looked at the xcode-files (will ask ...
10 years, 1 month ago (2010-11-06 00:07:47 UTC) #3
William Hesse
LGTM, with comments. http://codereview.chromium.org/4060001/diff/17001/18005 File src/strtod.cc (right): http://codereview.chromium.org/4060001/diff/17001/18005#newcode365 src/strtod.cc:365: // or where the next double ...
10 years, 1 month ago (2010-11-08 09:46:33 UTC) #4
Florian Loitsch
10 years, 1 month ago (2010-11-08 10:20:04 UTC) #5
http://codereview.chromium.org/4060001/diff/17001/18005
File src/strtod.cc (right):

http://codereview.chromium.org/4060001/diff/17001/18005#newcode365
src/strtod.cc:365: // or where the next double (i.e. the next closest double) is
the correct
On 2010/11/08 09:46:34, William Hesse wrote:
> either the correct double or its lower neighbor (the nearest double less than
> the correct one).

Done.

http://codereview.chromium.org/4060001/diff/17001/18005#newcode402
src/strtod.cc:402: int comparison = Bignum::Compare(input, boundary);
On 2010/11/08 09:46:34, William Hesse wrote:
> Beautifully simple code.

thanks :)

http://codereview.chromium.org/4060001/diff/17001/18005#newcode426
src/strtod.cc:426: return Strtod(Vector<const char>(significant_buffer,
On 2010/11/08 09:46:34, William Hesse wrote:
> Instead of return Strtod(...) why not
> trimmed = Vector<const char>(significant_buffer,kMaxSignificantDecimalDigits);
> exponent = significant_exponent;
> 
> The recursion is merely a tail call to the rest of the function body, since
the
> previous stuff will have no impact.

Done.

http://codereview.chromium.org/4060001/diff/17001/18007
File test/cctest/test-bignum.cc (right):

http://codereview.chromium.org/4060001/diff/17001/18007#newcode1590
test/cctest/test-bignum.cc:1590: bignum.AssignPowerUInt16(10, 30);
On 2010/11/08 09:46:34, William Hesse wrote:
> Couldn't you try a different base, like 17, once?

Done.

http://codereview.chromium.org/4060001/diff/28001/29008
File test/cctest/test-strtod.cc (right):

http://codereview.chromium.org/4060001/diff/28001/29008#newcode368
test/cctest/test-strtod.cc:368: 
On 2010/11/08 09:46:34, William Hesse wrote:
> Is this test reproducible?  Is there an option to make random() use the same
> seed?  What is random() - is it libc or one of our own functions?

It was a libc function. I have copied v8's Random function and adapted it so it
is deterministic.

Powered by Google App Engine
This is Rietveld 408576698