• Benedikt Meurer's avatar
    [cleanup] Remove obsolete "one byte data hint" for strings. · 683cf6f4
    Benedikt Meurer authored
    In the early days of Chrome when we used WebKit there was no support for
    ASCII strings on the C++ side, so we put a hint onto these two-byte
    strings that said "string only contains one byte data", such that
    internally in V8 when these were involved in string operations, we could
    instead create the *cheaper* one byte strings.
    
    Nowadays Blink properly supports one-byte string representations and
    this additional hint only comes with overhead, since we check it in
    quite a few places (i.e. on the hot path for string concatenation), plus
    we end up consuming more memory due to the additional string maps.
    Removing the hint also frees one bit in the InstanceType zoo for
    strings.
    
    This alone improves performance on the `bench-dom-serialize.js` test case
    by around **3%**.
    
    Tbr: mstarzinger@chromium.org
    Bug: v8:6622, v8:8834, v8:8939
    Cq-Include-Trybots: luci.chromium.try:linux-blink-rel
    Change-Id: I0753f2859cee7b5a37b6f0da64d8ec39fcb044ff
    Doc: https://bit.ly/fast-string-concatenation-in-javascript
    Reviewed-on: https://chromium-review.googlesource.com/c/1498478
    Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
    Reviewed-by: 's avatarYang Guo <yangguo@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#60006}
    683cf6f4
Name
Last commit
Last update
benchmarks Loading commit data...
build_overrides Loading commit data...
custom_deps Loading commit data...
docs Loading commit data...
gni Loading commit data...
include Loading commit data...
infra Loading commit data...
samples Loading commit data...
src Loading commit data...
test Loading commit data...
testing Loading commit data...
third_party Loading commit data...
tools Loading commit data...
.clang-format Loading commit data...
.clang-tidy Loading commit data...
.editorconfig Loading commit data...
.git-blame-ignore-revs Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
.gn Loading commit data...
.vpython Loading commit data...
.ycm_extra_conf.py Loading commit data...
AUTHORS Loading commit data...
BUILD.gn Loading commit data...
CODE_OF_CONDUCT.md Loading commit data...
ChangeLog Loading commit data...
DEPS Loading commit data...
LICENSE Loading commit data...
LICENSE.fdlibm Loading commit data...
LICENSE.strongtalk Loading commit data...
LICENSE.v8 Loading commit data...
LICENSE.valgrind Loading commit data...
OWNERS Loading commit data...
PRESUBMIT.py Loading commit data...
README.md Loading commit data...
WATCHLISTS Loading commit data...
codereview.settings Loading commit data...
snapshot_toolchain.gni Loading commit data...