• Benedikt Meurer's avatar
    [turbofan] Optimize String#slice(-1) calls. · 3200cc60
    Benedikt Meurer authored
    In TurboFan we can easily recognize calls to String.prototype.slice
    where the start parameter is -1 and the end parameter is either
    undefined or not present. These calls either return an empty string if
    the input string is empty, or the last character of the input string
    as a single character string. So we can just make use of the existing
    StringCharAt operator.
    
    This reduces the overhead of the String.prototype.slice calls from
    optimized code in the chai test of the web-tooling-benchmark
    significantly. We observe a 2-3% improvement on the test.
    
    Bug: v8:6936, v8:7137
    Change-Id: Iebe02667446880f5760e3e8c80f8b7cc712df663
    Reviewed-on: https://chromium-review.googlesource.com/795726
    Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
    Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#49704}
    3200cc60
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...