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

Issue 48833002: Move all static constants in dtoa/cached-powers.* to .rodata section (Closed)

Created:
7 years, 1 month ago by Inactive
Modified:
7 years, 1 month ago
CC:
blink-reviews, yurys+blink_chromium.org, loislo+blink_chromium.org, adamk+blink_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Visibility:
Public.

Description

Move all static constants in dtoa/cached-powers.* to .rodata section Move all static constants in dtoa/cached-powers.* from .data section to .rodata. This was done by marking those as const and hardcoding their values instead of computing them. Runtime assertions were added to make sure the hardcoded values are correct and kept up-to-date. This data can now be shared between different library instances on Android, thus saving RAM. The size of non-shareable .data in wtf/dtoa/wtf.cached-powers.o went from 1424 bytes to 0 byte. The size of shareable .rodata went from 760 bytes to 2520 bytes. BUG=249746 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=161250

Patch Set 1 #

Patch Set 2 : Move everything to .rodata #

Patch Set 3 : Refactor to avoid duplication #

Total comments: 1

Patch Set 4 : Fix Windows build failure #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+111 lines, -114 lines) Patch
M Source/wtf/ThreadingPthreads.cpp View 1 1 chunk +0 lines, -1 line 0 comments Download
M Source/wtf/ThreadingWin.cpp View 1 2 3 1 chunk +0 lines, -1 line 0 comments Download
M Source/wtf/dtoa/cached-powers.h View 1 2 chunks +3 lines, -8 lines 0 comments Download
M Source/wtf/dtoa/cached-powers.cc View 1 2 3 chunks +108 lines, -104 lines 3 comments Download

Messages

Total messages: 20 (0 generated)
Inactive
Proof via objdump: Before: 022e0850 l O .data 00000570 WTF::double_conversion::initialize()::cachedPowers After: 0000000005707be0 l O .rodata ...
7 years, 1 month ago (2013-10-28 14:11:08 UTC) #1
digit1
ltgm However, this specific source file is depressing, there is absolutely no good reason to ...
7 years, 1 month ago (2013-10-28 14:21:02 UTC) #2
tfarina
On Mon, Oct 28, 2013 at 12:11 PM, <ch.dumez@samsung.com> wrote: > Reviewers: eseidel, digit1, > ...
7 years, 1 month ago (2013-10-28 14:31:46 UTC) #3
Inactive
I updated the description. On 2013/10/28 14:31:46, tfarina wrote: > On Mon, Oct 28, 2013 ...
7 years, 1 month ago (2013-10-28 14:37:11 UTC) #4
Inactive
On 2013/10/28 14:37:11, Chris Dumez wrote: > I updated the description. > > On 2013/10/28 ...
7 years, 1 month ago (2013-10-28 14:39:59 UTC) #5
abarth-chromium
It's easy to generate CPP from Python these days.
7 years, 1 month ago (2013-10-29 03:45:37 UTC) #6
Inactive
I moved all the global variables to .rodata as suggested. I am not generating anything ...
7 years, 1 month ago (2013-10-29 16:00:07 UTC) #7
digit1
lgtm, thanks for this excellent patch. Don't worry about the Python for now :)
7 years, 1 month ago (2013-10-29 16:21:47 UTC) #8
Inactive
On 2013/10/29 16:21:47, digit1 wrote: > lgtm, thanks for this excellent patch. Don't worry about ...
7 years, 1 month ago (2013-10-30 13:16:32 UTC) #9
Inactive
On 2013/10/30 13:16:32, Chris Dumez wrote: > On 2013/10/29 16:21:47, digit1 wrote: > > lgtm, ...
7 years, 1 month ago (2013-11-01 21:03:00 UTC) #10
eseidel
lgtm Wow.
7 years, 1 month ago (2013-11-01 21:16:56 UTC) #11
eseidel
https://codereview.chromium.org/48833002/diff/160001/Source/wtf/dtoa/cached-powers.cc File Source/wtf/dtoa/cached-powers.cc (right): https://codereview.chromium.org/48833002/diff/160001/Source/wtf/dtoa/cached-powers.cc#newcode50 Source/wtf/dtoa/cached-powers.cc:50: {UINT64_2PART_C(0xfa8fd5a0, 081c0288), -1220, -348}, I agree with Adam that ...
7 years, 1 month ago (2013-11-01 21:17:50 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/ch.dumez@samsung.com/48833002/160001
7 years, 1 month ago (2013-11-01 21:21:54 UTC) #13
commit-bot: I haz the power
Sorry for I got bad news for ya. Compile failed with a clobber build on ...
7 years, 1 month ago (2013-11-01 22:06:58 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/ch.dumez@samsung.com/48833002/340001
7 years, 1 month ago (2013-11-04 13:52:44 UTC) #15
commit-bot: I haz the power
Change committed as 161250
7 years, 1 month ago (2013-11-04 15:51:54 UTC) #16
Nico
https://codereview.chromium.org/48833002/diff/340001/Source/wtf/dtoa/cached-powers.cc File Source/wtf/dtoa/cached-powers.cc (right): https://codereview.chromium.org/48833002/diff/340001/Source/wtf/dtoa/cached-powers.cc#newcode138 Source/wtf/dtoa/cached-powers.cc:138: static const int kCachedPowersLength = ARRAY_SIZE(kCachedPowers); This isn't used ...
7 years, 1 month ago (2013-11-04 20:55:03 UTC) #17
Inactive
https://codereview.chromium.org/48833002/diff/340001/Source/wtf/dtoa/cached-powers.cc File Source/wtf/dtoa/cached-powers.cc (right): https://codereview.chromium.org/48833002/diff/340001/Source/wtf/dtoa/cached-powers.cc#newcode138 Source/wtf/dtoa/cached-powers.cc:138: static const int kCachedPowersLength = ARRAY_SIZE(kCachedPowers); On 2013/11/04 20:55:03, ...
7 years, 1 month ago (2013-11-04 20:59:27 UTC) #18
Nico
(for BUG=312287 ) https://codereview.chromium.org/48833002/diff/340001/Source/wtf/dtoa/cached-powers.cc File Source/wtf/dtoa/cached-powers.cc (right): https://codereview.chromium.org/48833002/diff/340001/Source/wtf/dtoa/cached-powers.cc#newcode138 Source/wtf/dtoa/cached-powers.cc:138: static const int kCachedPowersLength = ARRAY_SIZE(kCachedPowers); ...
7 years, 1 month ago (2013-11-04 21:04:59 UTC) #19
Inactive
7 years, 1 month ago (2013-11-04 21:12:40 UTC) #20
Message was sent while issue was closed.
On 2013/11/04 21:04:59, Nico wrote:
> (for BUG=312287 )
> 
>
https://codereview.chromium.org/48833002/diff/340001/Source/wtf/dtoa/cached-p...
> File Source/wtf/dtoa/cached-powers.cc (right):
> 
>
https://codereview.chromium.org/48833002/diff/340001/Source/wtf/dtoa/cached-p...
> Source/wtf/dtoa/cached-powers.cc:138: static const int kCachedPowersLength =
> ARRAY_SIZE(kCachedPowers);
> On 2013/11/04 20:59:28, Chris Dumez wrote:
> > On 2013/11/04 20:55:03, Nico wrote:
> > > This isn't used for anything. Is that intentional?
> > 
> > This is used in 2 assertions in this file so I believe we need to keep it.
We
> > could - however - put it in an #ifndef NDEBUG.
> 
> Ah. I think we usually use `#if !ASSERT_DISABLED` in blink. Can you add that?
> Else this file won't compile with warnings enabled.

Sure, I am preparing a CL right now. Thanks!

Powered by Google App Engine
This is Rietveld 408576698