• Benedikt Meurer's avatar
    [es2015] Optimize Reflect.has builtin. · 4213af64
    Benedikt Meurer authored
    Port the baseline version of Reflect.has to the CodeStubAssembler and
    reuse the existing logic for HasProperty (i.e. the HasProperty builtin).
    Also inline the Reflect.has builtin into TurboFan, by adding a check
    on the target in front of a use of the JSHasProperty operator.
    Technically this additional check is not necessary, because the
    JSHasProperty operator already throws if the target is not a JSReceiver,
    but the exception message is confusing then.
    
    This improves the performance of the micro-benchmark from
    
      reflectHasPresent: 337 ms.
      reflectHasAbsent: 472 ms.
    
    to
    
      reflectHasPresent: 121 ms.
      reflectHasAbsent: 216 ms.
    
    which is a nice 2.8x improvement in the best case. It also improves the
    chai test on the web-tooling-benchmark by around 1-2%, which is roughly
    the expected win (since Reflect.has overall accounts for around 3-4%).
    
    Bug: v8:5996, v8:6936, v8:6937
    Change-Id: I856183229677a71c19936f06f2a4fc7a794a9a4a
    Reviewed-on: https://chromium-review.googlesource.com/720959
    Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
    Reviewed-by: 's avatarJaroslav Sevcik <jarin@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#48608}
    4213af64
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...