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

Issue 2520363002: Reimplement Number.prototype.toString with non-default radix. (Closed)

Created:
4 years, 1 month ago by Yang
Modified:
4 years ago
CC:
v8-reviews_googlegroups.com
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

Reimplement Number.prototype.toString with non-default radix. The old algorithm produces unnecessary decimal digits. The new one converts the significand of the input double into an uint64_t to be just as precise as necessary. R=tebbi@chromium.org BUG=chromium:658712, chromium:666376 Committed: https://crrev.com/21b0dbedfd470b67c47f84428e1af95a506e49e5 Cr-Commit-Position: refs/heads/master@{#41255}

Patch Set 1 #

Total comments: 2

Patch Set 2 : . #

Patch Set 3 : reimplemented #

Patch Set 4 : readd copyright headers #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+131 lines, -115 lines) Patch
M src/builtins/builtins-number.cc View 1 1 chunk +2 lines, -1 line 2 comments Download
M src/conversions.cc View 1 2 3 chunks +72 lines, -64 lines 0 comments Download
M test/mjsunit/number-tostring.js View 1 2 1 chunk +7 lines, -0 lines 0 comments Download
M test/webkit/fast/js/number-toString-expected.txt View 1 2 3 1 chunk +29 lines, -29 lines 0 comments Download
M test/webkit/fast/js/toString-number-expected.txt View 1 2 3 7 chunks +21 lines, -21 lines 0 comments Download

Messages

Total messages: 32 (19 generated)
Yang
4 years, 1 month ago (2016-11-22 14:33:00 UTC) #1
Dan Ehrenberg
lgtm Very clean implementation. Do you want to mention the bug 666376 as well? This ...
4 years, 1 month ago (2016-11-22 17:13:27 UTC) #3
Tobias Tebbi
lgtm https://codereview.chromium.org/2520363002/diff/1/src/builtins/builtins-number.cc File src/builtins/builtins-number.cc (right): https://codereview.chromium.org/2520363002/diff/1/src/builtins/builtins-number.cc#newcode549 src/builtins/builtins-number.cc:549: value_number == 0.0) { nit: value_number == -0.0 ...
4 years, 1 month ago (2016-11-22 18:46:54 UTC) #4
Yang
On 2016/11/22 18:46:54, Tobias Tebbi wrote: > lgtm > > https://codereview.chromium.org/2520363002/diff/1/src/builtins/builtins-number.cc > File src/builtins/builtins-number.cc (right): ...
4 years, 1 month ago (2016-11-22 19:08:23 UTC) #5
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2520363002/20001
4 years ago (2016-11-23 08:04:29 UTC) #12
commit-bot: I haz the power
Try jobs failed on following builders: v8_mac_rel_ng on master.tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_mac_rel_ng/builds/13042) v8_mac_rel_ng_triggered on master.tryserver.v8 (JOB_FAILED, ...
4 years ago (2016-11-23 08:21:21 UTC) #14
Yang
Reimplemented this due to imprecisions. This is also faster than the two previous variants.
4 years ago (2016-11-23 11:39:48 UTC) #17
Tobias Tebbi
lgtm
4 years ago (2016-11-24 10:14:55 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2520363002/60001
4 years ago (2016-11-24 10:28:27 UTC) #24
commit-bot: I haz the power
Committed patchset #4 (id:60001)
4 years ago (2016-11-24 10:30:23 UTC) #27
commit-bot: I haz the power
Patchset 4 (id:??) landed as https://crrev.com/21b0dbedfd470b67c47f84428e1af95a506e49e5 Cr-Commit-Position: refs/heads/master@{#41255}
4 years ago (2016-11-24 10:30:54 UTC) #29
Jakob Kummerow
https://codereview.chromium.org/2520363002/diff/60001/src/builtins/builtins-number.cc File src/builtins/builtins-number.cc (right): https://codereview.chromium.org/2520363002/diff/60001/src/builtins/builtins-number.cc#newcode549 src/builtins/builtins-number.cc:549: value_number == -0.0) { DBC: This is misleading, because ...
4 years ago (2016-11-28 12:15:11 UTC) #31
Yang
4 years ago (2016-11-28 12:20:21 UTC) #32
Message was sent while issue was closed.
https://codereview.chromium.org/2520363002/diff/60001/src/builtins/builtins-n...
File src/builtins/builtins-number.cc (right):

https://codereview.chromium.org/2520363002/diff/60001/src/builtins/builtins-n...
src/builtins/builtins-number.cc:549: value_number == -0.0) {
On 2016/11/28 12:15:11, Jakob Kummerow wrote:
> DBC: This is misleading, because "value_number == -0.0" also evaluates to true
> when value_number == 0.0. That's fine here, but could lead to bugs when this
> pattern is copied elsewhere.
> 
> Use IsMinusZero() from conversions.h to actually check for -0, or compare
> against 0.0 with a comment like "Covers both 0 and -0." to make explicit
what's
> going on.

Noted. I originally had compared to 0.0 in patch set 1.

Powered by Google App Engine
This is Rietveld 408576698