• Benedikt Meurer's avatar
    [turbofan] Introduce a CallFunctionTemplate builtin. · a2d9924c
    Benedikt Meurer authored
    When calling into API callbacks from TurboFan optimized, we can
    currently only take a fast-path when TurboFan is able to find some
    information about the receiver in the graph, or when the API callback
    specifies that it neither requires an access check (aka "accepts any
    receiver") nor an interface check (aka "compatible receiver check").
    
    This change introduces a new CallFunctionTemplate builtin that sits
    in front of the CallApiCallback builtin and does both the access as well
    as the interface check as necessary (and raises appropriate exceptions).
    This way TurboFan can still call into the API callback via the fast-path
    even without ahead knowledge about the receiver, which is significantly
    faster than the generic call machinery for API callbacks.
    
    On the test case from the Angular team[1], the interesting metrics
    improve from
    
      DOM_mono: 0.273 ms
      DOM_mega: 0.571 ms
      DOM_call: 0.649 ms
    
    to
    
      DOM_mono: 0.264 ms
      DOM_mega: 0.572 ms
      DOM_call: 0.368 ms
    
    so the DOM_call is only about **1.4 times slower** than the DOM_mono and
    about **1.5 times faster** than the DOM_mega case (compared to **2.4
    times slower**). Execution time in the DOM_call was reduced by around
    **~45%**.
    
    Currently this new code path is limited to TurboFan optimized code, but
    the idea is to eventually migrate the API calls from baseline to also
    use the new CSA functionality, but there are lot's of subleties to take
    into account, so starting with small changes to get coverage for the
    basic building blocks.
    
    [1]: https://mhevery.github.io/perf-tests/DOM-megamorphic.html
    
    Bug: v8:8820
    Change-Id: Ie1029cf182ce05a6e519fd9a9d4fa825db8adb4c
    Cq-Include-Trybots: luci.chromium.try:linux-blink-rel
    Reviewed-on: https://chromium-review.googlesource.com/c/1470129
    Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
    Reviewed-by: 's avatarToon Verwaest <verwaest@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#59598}
    a2d9924c
Name
Last commit
Last update
benchmarks Loading commit data...
build_overrides Loading commit data...
custom_deps Loading commit data...
docs Loading commit data...
gni 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...
.clang-tidy Loading commit data...
.editorconfig Loading commit data...
.git-blame-ignore-revs Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
.gn Loading commit data...
.vpython 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...
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...