Go to file
Benedikt Meurer f537d77845 [async] First prototype of zero-cost async stack traces.
This introduces a new flag --async-stack-traces, which enables zero-cost
async stack traces. This enriches the non-standard Error.stack property
with async stack frames computed from walking up the promise chains and
collecting all the await suspension points along the way. In Error.stack
these async frames are marked with "async" to make it possible to
distinguish them from regular frames, for example:

```
Error: Some error message
    at bar (<anonymous>)
    at async foo (<anonymous>)
```

It's zero-cost because no additional information is collected during the
execution of the program, but only the information already present in the
promise chains is used to reconstruct an approximation of the async stack
in case of an exception. But this approximation is limited to suspension
points at await's in async functions. This depends on a recent ECMAScript
specification change, flagged behind --harmony-await-optimization and
implied the --async-stack-traces flag. Without this change there's no
way to get from the outer promise of an async function to the rest of
the promise chain, since the link is broken by the indirection introduced
by await.

For async functions the special outer promise, named .promise in the
Parser desugaring, is now forcible allocated to stack slot 0 during
scope resolution, to make it accessible to the stack frame construction
logic. Note that this first prototype doesn't yet work fully support
async generators and might have other limitations.

Bug: v8:7522
Ref: nodejs/node#11865
Change-Id: I0cc8e3cdfe45dab56d3d506be2d25907409b01a9
Design-Document: http://bit.ly/v8-zero-cost-async-stack-traces
Reviewed-on: https://chromium-review.googlesource.com/c/1256762
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Adam Klein <adamk@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56363}
2018-10-04 08:02:06 +00:00
benchmarks
build_overrides
custom_deps
docs
gni
include [Intl] Add CountUsage for intl objects/functions 2018-10-03 22:36:55 +00:00
infra [build] Remove configs for removed mipsel builder 2018-10-02 13:12:27 +00:00
samples
src [async] First prototype of zero-cost async stack traces. 2018-10-04 08:02:06 +00:00
test [async] First prototype of zero-cost async stack traces. 2018-10-04 08:02:06 +00:00
testing
third_party
tools [tools] Implement --exit-after-n-failures functionality via a flag 2018-10-02 14:18:48 +00:00
.clang-format
.clang-tidy Add a tool/script to run clang-tidy over V8. 2018-09-11 12:01:09 +00:00
.editorconfig
.git-blame-ignore-revs
.gitattributes
.gitignore
.gn
.vpython
.ycm_extra_conf.py
AUTHORS
BUILD.gn [objects.h splitting] Move StackFrameInfo 2018-10-02 12:01:06 +00:00
ChangeLog
CODE_OF_CONDUCT.md
codereview.settings
DEPS Update V8 DEPS. 2018-10-04 03:38:17 +00:00
LICENSE
LICENSE.fdlibm
LICENSE.strongtalk
LICENSE.v8
LICENSE.valgrind
OWNERS
PRESUBMIT.py Fix nits in presubmit.py and handling of .tq otherwise formatting 2018-09-25 15:37:39 +00:00
README.md
snapshot_toolchain.gni
WATCHLISTS

V8 JavaScript Engine

V8 is Google's open source JavaScript engine.

V8 implements ECMAScript as specified in ECMA-262.

V8 is written in C++ and is used in Google Chrome, the open source browser from Google.

V8 can run standalone, or can be embedded into any C++ application.

V8 Project page: https://github.com/v8/v8/wiki

Getting the Code

Checkout depot tools, and run

    fetch v8

This will checkout V8 into the directory v8 and fetch all of its dependencies. To stay up to date, run

    git pull origin
    gclient sync

For fetching all branches, add the following into your remote configuration in .git/config:

    fetch = +refs/branch-heads/*:refs/remotes/branch-heads/*
    fetch = +refs/tags/*:refs/tags/*

Contributing

Please follow the instructions mentioned on the V8 wiki.