• 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
..
bytecode-array-builder-unittest.cc Loading commit data...
bytecode-array-iterator-unittest.cc Loading commit data...
bytecode-array-random-iterator-unittest.cc Loading commit data...
bytecode-array-writer-unittest.cc Loading commit data...
bytecode-decoder-unittest.cc Loading commit data...
bytecode-node-unittest.cc Loading commit data...
bytecode-operands-unittest.cc Loading commit data...
bytecode-register-allocator-unittest.cc Loading commit data...
bytecode-register-optimizer-unittest.cc Loading commit data...
bytecode-source-info-unittest.cc Loading commit data...
bytecode-utils.h Loading commit data...
bytecodes-unittest.cc Loading commit data...
constant-array-builder-unittest.cc Loading commit data...
interpreter-assembler-unittest.cc Loading commit data...
interpreter-assembler-unittest.h Loading commit data...