• 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...
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...