• Benedikt Meurer's avatar
    [turbofan] Add support to inline new Array(n) calls. · 34de39bf
    Benedikt Meurer authored
    Make calls like
    
      new Array(n)
      new A(n)
    
    (where A is a subclass of Array) inlinable into TurboFan. We do this by
    speculatively checking that n is an unsigned integer that is not greater
    than JSArray::kInitialMaxFastElementArray, and then lowering the backing
    store allocation to a builtin call. The speculative optimization is
    either protected by the AllocationSite for the Array constructor
    invocation (if we have one), or by a newly introduced global protector
    cell that is used for Array constructor invocations that don't have an
    AllocationSite, i.e. the ones from Array#map, Array#filter, or from
    subclasses of Array.
    
    Next step will be to implement the backing store allocations inline in
    TurboFan, but that requires Loop support in the GraphAssembler, so it's
    done as a separate CL. This should further boost the performance.
    
    This boosts the ARES6 ML benchmark by up to 8% on the steady state,
    and also improves monomorphic Array#map calls by around 20-25% on the
    initial setup.
    
    Bug: v8:6399
    Tbr: ulan@chromium.org
    Change-Id: I7c8bdecf7c814ce52db6ee3051c3206a4f7d4bb6
    Reviewed-on: https://chromium-review.googlesource.com/704639
    Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
    Reviewed-by: 's avatarBenedikt Meurer <bmeurer@chromium.org>
    Reviewed-by: 's avatarJaroslav Sevcik <jarin@chromium.org>
    Reviewed-by: 's avatarMichael Stanton <mvstanton@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#48348}
    34de39bf
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...
.gitignore Loading commit data...
.gn 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...