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

Issue 21437003: Remove the pointer from StringImpl (Closed)

Created:
7 years, 4 months ago by abarth-chromium
Modified:
7 years, 4 months ago
Reviewers:
eseidel
CC:
blink-reviews, loislo+blink_chromium.org, eae+blinkwatch, yurys+blink_chromium.org, dglazkov+blink, adamk+blink_chromium.org, jeez
Visibility:
Public.

Description

Remove the pointer from StringImpl This CL removes the data pointer from StringImpl, reducing sizeof(StringImpl) from 24 bytes to 12 bytes. We now always store the character data after the StringImpl object itself, which means we don't need a pointer to keep track of it. This CL saves 120 kB of memory on typical web pages (which have ~10k strings). R=eseidel BUG=262320 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=155309 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=155404 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=155464

Patch Set 1 #

Patch Set 2 : Mark constructor explicit #

Patch Set 3 : Tweak slightly #

Patch Set 4 : Now with placement new #

Unified diffs Side-by-side diffs Delta from patch set Stats (+106 lines, -146 lines) Patch
M Source/core/scripts/StaticString.pm View 1 2 3 2 chunks +12 lines, -26 lines 0 comments Download
M Source/core/scripts/make_names.pl View 1 2 3 5 chunks +4 lines, -5 lines 0 comments Download
M Source/wtf/text/StringImpl.h View 1 2 3 7 chunks +24 lines, -41 lines 0 comments Download
M Source/wtf/text/StringImpl.cpp View 1 2 3 36 chunks +63 lines, -63 lines 0 comments Download
M Source/wtf/text/StringStatics.cpp View 2 chunks +3 lines, -11 lines 0 comments Download

Messages

Total messages: 11 (0 generated)
abarth-chromium
7 years, 4 months ago (2013-08-01 00:30:20 UTC) #1
eseidel
lgtm
7 years, 4 months ago (2013-08-01 00:38:16 UTC) #2
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/abarth@chromium.org/21437003/4001
7 years, 4 months ago (2013-08-01 00:38:37 UTC) #3
commit-bot: I haz the power
Change committed as 155309
7 years, 4 months ago (2013-08-01 06:19:12 UTC) #4
abarth-chromium
ASSERTION FAILED: hasHash() Backtrace: WTF::StringImpl::assertHashIsCorrect [0x0023DC3A+58] (c:\b\build\slave\webkit-win-latest-dbg\build\src\third_party\webkit\source\wtf\text\stringimpl.h:474) WebCore::HTMLNames::init [0x1128E459+169] (c:\b\build\slave\webkit-win-latest-dbg\build\src\out\debug\gen\blink\htmlnames.cpp:6526) WebCore::init [0x11AE07EC+44] (c:\b\build\slave\webkit-win-latest-dbg\build\src\third_party\webkit\source\core\init.cpp:58) WebKit::initializeWithoutV8 [0x10243A05+197] ...
7 years, 4 months ago (2013-08-01 16:47:31 UTC) #5
abarth-chromium
I asked Justin to test this CL on a win64 debug build and he didn't ...
7 years, 4 months ago (2013-08-01 22:16:30 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/abarth@chromium.org/21437003/25001
7 years, 4 months ago (2013-08-02 03:33:38 UTC) #7
commit-bot: I haz the power
Change committed as 155404
7 years, 4 months ago (2013-08-02 05:25:38 UTC) #8
abarth-chromium
I updated StaticString.pm to use placement new instead of reinterpret_cast. Hopefully Windows will like that ...
7 years, 4 months ago (2013-08-03 01:19:31 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/abarth@chromium.org/21437003/38002
7 years, 4 months ago (2013-08-03 01:20:10 UTC) #10
commit-bot: I haz the power
7 years, 4 months ago (2013-08-03 03:57:06 UTC) #11
Message was sent while issue was closed.
Change committed as 155464

Powered by Google App Engine
This is Rietveld 408576698