• Benedikt Meurer's avatar
    [async-await] Unify handling of await closure contexts. · 9e99297e
    Benedikt Meurer authored
    Change the way that the (internal) await closures store the link to the
    generator object by introducing a dedicated AwaitContext, which stores
    the generator object into the extension slot (instead of misusing a
    regular FunctionContext here). Also unify the allocation+initialization
    of these contexts in the await-related builtins (both for async functions
    and generators).
    
    The rationale behind this is that for (zero-cost) async stack traces, we
    will need to dig into these contexts and we can do better checking with
    a dedicated instance type there. As an additional benefit, we save one
    word per await context, since we just use (the otherwise unused) extension
    slot to remember the generator object. As yet another benefit we will
    never accidentally use any of these contexts in the regular scope chain
    lookups, meaning we can also catch bugs there. And last but not least
    the objects printing machinery understands these contexts now and can
    even print the generator object for AwaitContexts for short printing,
    which is really valuable for debugging.
    
    Tbr: ulan@chromium.org
    Bug: v8:7253, v8:7522, v8:8015
    Change-Id: I86955f5701e694e8a10b91ebe5f52705aa90968d
    Reviewed-on: https://chromium-review.googlesource.com/1249491Reviewed-by: 's avatarSathya Gunasekaran <gsathya@chromium.org>
    Reviewed-by: 's avatarBenedikt Meurer <bmeurer@chromium.org>
    Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#56301}
    9e99297e
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...