• Benedikt Meurer's avatar
    [turbofan] Introduce InstanceOfIC to collect rhs feedback. · bcee1406
    Benedikt Meurer authored
    This adds a new InstanceOfIC where the TestInstanceOf bytecode collects
    constant feedback about the right-hand side of instanceof operators,
    including both JSFunction and JSBoundFunction instances. TurboFan then
    uses the feedback to optimize instanceof in places where the right-hand
    side is not a known constant (known to TurboFan).
    
    This addresses the odd performance cliff that we see with instanceof in
    functions with multiple closures. It was discovered as one of the main
    bottlenecks on the uglify-es test in the web-tooling-benchmark. The
    uglify-es test (run in separation) is ~18% faster with this change.
    
    On the micro-benchmark in the tracking bug we go from
    
      instanceofSingleClosure_Const: 69 ms.
      instanceofSingleClosure_Class: 246 ms.
      instanceofMultiClosure: 246 ms.
      instanceofParameter: 246 ms.
    
    to
    
      instanceofSingleClosure_Const: 70 ms.
      instanceofSingleClosure_Class: 75 ms.
      instanceofMultiClosure: 76 ms.
      instanceofParameter: 73 ms.
    
    boosting performance by roughly 3.6x and thus effectively removing the
    performance cliff around instanceof.
    
    Bug: v8:6936, v8:6971
    Change-Id: Ib88dbb9eaef9cafa4a0e260fbbde73427a54046e
    Reviewed-on: https://chromium-review.googlesource.com/730686
    Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
    Reviewed-by: 's avatarMichael Stanton <mvstanton@chromium.org>
    Reviewed-by: 's avatarRoss McIlroy <rmcilroy@chromium.org>
    Reviewed-by: 's avatarBenedikt Meurer <bmeurer@chromium.org>
    Reviewed-by: 's avatarJaroslav Sevcik <jarin@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#48820}
    bcee1406
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...
.git-blame-ignore-revs 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...