• 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
..
runtime-array.cc Loading commit data...
runtime-atomics.cc Loading commit data...
runtime-bigint.cc Loading commit data...
runtime-classes.cc Loading commit data...
runtime-collections.cc Loading commit data...
runtime-compiler.cc Loading commit data...
runtime-date.cc Loading commit data...
runtime-debug.cc Loading commit data...
runtime-error.cc Loading commit data...
runtime-forin.cc Loading commit data...
runtime-function.cc Loading commit data...
runtime-futex.cc Loading commit data...
runtime-generator.cc Loading commit data...
runtime-internal.cc Loading commit data...
runtime-interpreter.cc Loading commit data...
runtime-intl.cc Loading commit data...
runtime-literals.cc Loading commit data...
runtime-liveedit.cc Loading commit data...
runtime-maths.cc Loading commit data...
runtime-module.cc Loading commit data...
runtime-numbers.cc Loading commit data...
runtime-object.cc Loading commit data...
runtime-operators.cc Loading commit data...
runtime-promise.cc Loading commit data...
runtime-proxy.cc Loading commit data...
runtime-regexp.cc Loading commit data...
runtime-scopes.cc Loading commit data...
runtime-strings.cc Loading commit data...
runtime-symbol.cc Loading commit data...
runtime-test.cc Loading commit data...
runtime-typedarray.cc Loading commit data...
runtime-utils.h Loading commit data...
runtime-wasm.cc Loading commit data...
runtime.cc Loading commit data...
runtime.h Loading commit data...