• 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...
cctest Loading commit data...
common Loading commit data...
debugger Loading commit data...
fuzzer Loading commit data...
inspector Loading commit data...
intl Loading commit data...
js-perf-test Loading commit data...
memory Loading commit data...
message Loading commit data...
mjsunit Loading commit data...
mkgrokdump Loading commit data...
mozilla Loading commit data...
preparser Loading commit data...
promises-aplus Loading commit data...
test262 Loading commit data...
unittests Loading commit data...
wasm-spec-tests Loading commit data...
webkit Loading commit data...
BUILD.gn Loading commit data...
bot_default.gyp Loading commit data...
bot_default.isolate Loading commit data...
default.gyp Loading commit data...
default.isolate Loading commit data...
optimize_for_size.gyp Loading commit data...
optimize_for_size.isolate Loading commit data...
perf.gyp Loading commit data...
perf.isolate Loading commit data...