• Daniel Clifford's avatar
    Reimplement Array.prototype.slice in CSA and C++ · 6452b26a
    Daniel Clifford authored
    Previously, V8's slice was implemented in a combination of C++ and a 
    Javascript fallback. The disadvantage of this approach was that the
    fast-path required a call through the CEntryStub, which introduced
    considerable overhead for small arrays with fast elements kinds.
    
    Now the implementation primarily uses the CSA to generate both the
    full spec-complaint implementation as well as fast paths for argument
    objects and arrays with fast elements kinds. The CSA implementation
    uses a C++ implementation fallback in select situations where the the
    complexity of a CSA implementation would be too great and the
    CEntryStub overhead is not decisive (e.g. slices of dictionary
    elements arrays).
    
    Performance results on semi-random arrays with small number of
    elements (old vs. new):
    
    smi copy: 48.7 ms vs. 12 ms
    smi slice: 43.5 ms 14.8 ms
    object copy: 35.5 ms 7.7 ms
    object slice: 38.7 ms 8.8 ms
    dictionary slice: 2398.3 ms vs. 5.4 ms
    fast sloppy arguments slice: 9.6 ms vs. 7.2 ms
    slow sloppy arguments slice: 28.9 ms vs. 8.5 ms
    
    As a bonus, the new implementation is fully spec-compliant and fixes
    at least one existing bug.
    
    The design document for Array.prototype builtin rework can be found
    at https://goo.gl/wFHe2n
    
    Bug: v8:1956,v8:6601,v8:6710,v8:6978
    Change-Id: Ia0155bedcf39b4577605ff754f416c2af938efb7
    Reviewed-on: https://chromium-review.googlesource.com/574710
    Commit-Queue: Daniel Clifford <danno@chromium.org>
    Reviewed-by: 's avatarBenedikt Meurer <bmeurer@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#48853}
    6452b26a
Name
Last commit
Last update
..
arm Loading commit data...
arm64 Loading commit data...
ia32 Loading commit data...
mips Loading commit data...
mips64 Loading commit data...
ppc Loading commit data...
s390 Loading commit data...
x64 Loading commit data...
OWNERS Loading commit data...
debug-coverage.cc Loading commit data...
debug-coverage.h Loading commit data...
debug-evaluate.cc Loading commit data...
debug-evaluate.h Loading commit data...
debug-frames.cc Loading commit data...
debug-frames.h Loading commit data...
debug-interface.h Loading commit data...
debug-scope-iterator.cc Loading commit data...
debug-scope-iterator.h Loading commit data...
debug-scopes.cc Loading commit data...
debug-scopes.h Loading commit data...
debug-stack-trace-iterator.cc Loading commit data...
debug-stack-trace-iterator.h Loading commit data...
debug-type-profile.cc Loading commit data...
debug-type-profile.h Loading commit data...
debug.cc Loading commit data...
debug.h Loading commit data...
debug.js Loading commit data...
interface-types.h Loading commit data...
liveedit.cc Loading commit data...
liveedit.h Loading commit data...
liveedit.js Loading commit data...
mirrors.js Loading commit data...