• Benedikt Meurer's avatar
    [builtins] Widen the fast-path for Promise builtins. · db0556b7
    Benedikt Meurer authored
    This adds a new isolate wide Promise#then protector, which guards the
    "then" lookup for all JSPromise instances whose [[Prototype]] is the
    initial %PromisePrototype%. Thus arbitrary mutations to the
    Promise.prototype (i.e. monkey-patching other methods or installing
    new functions) no longer sent you down the slow-path. Use this protector
    in Promise.prototype.catch and in Promise.resolve.
    
    Drive-by-fix: Restructure the resolve logic a bit and avoid the
    expensive and large SameValue check, which can be turned into a simple
    reference equal, as the promise in there is known to be a JSPromise
    anyways.
    
    Bug: v8:7253
    Change-Id: If68b12c6bc6ca9c4d10552ae84854ebc3b5774f9
    Reviewed-on: https://chromium-review.googlesource.com/899302
    Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
    Reviewed-by: 's avatarBenedikt Meurer <bmeurer@chromium.org>
    Reviewed-by: 's avatarSathya Gunasekaran <gsathya@chromium.org>
    Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#51085}
    db0556b7
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...
.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...
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...