• Benedikt Meurer's avatar
    [ic] Add OOB support to KeyedLoadIC. · 6dc35ab4
    Benedikt Meurer authored
    This adds support to the KeyedLoadIC to ignore out of bounds accesses
    for Strings and return undefined instead. We add a dedicated bit to the
    Smi handler to encode the OOB state and have TurboFan generate appropriate
    code for that case as well. This is mostly useful when programs
    accidentially access past the length of a string, which was observed and
    fixed for example in Babel recently, see
    
      https://github.com/babel/babel/pull/6589
    
    for details. The idea is to also extend this mechanism to Arrays and
    maybe other receivers, as reading beyond the length is also often used
    in jQuery and other popular libraries.
    
    Note that this is considered a mitigation for a performance cliff and
    not a general optimization of OOB accesses. These should still be
    avoided and handled properly instead.
    
    This seems to further improve the babel test on the web-tooling-benchmark
    by around 1%, because the OOB access no longer turns the otherwise
    MONOMORPHIC access into MEGAMORPHIC state.
    
    Bug: v8:6936, v8:7014
    Change-Id: I9df03304e056d7001a65da8e9621119f8e9bb55b
    Reviewed-on: https://chromium-review.googlesource.com/744022
    Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
    Reviewed-by: 's avatarCamillo Bruni <cbruni@chromium.org>
    Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
    Reviewed-by: 's avatarBenedikt Meurer <bmeurer@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#49049}
    6dc35ab4
Name
Last commit
Last update
benchmarks Loading commit data...
build_overrides Loading commit data...
docs Loading commit data...
gni Loading commit data...
gypfiles 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...
.editorconfig Loading commit data...
.git-blame-ignore-revs 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...
Makefile Loading commit data...
Makefile.android 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...