[stack-trace] Include API functions in Error.stack stack trace

This CL extends Error.stack to include frames of functions declared
with the C++ FunctionTemplate API. For example, "print" in d8.

Two changes are necessary:
  - HandleApiCall and friends need to go through an BUILTIN_EXIT frame
    instead of an EXIT frame. The existing stack-trace machinery will
    then pick up FunctionTemplate frames without additional changes.
  - Turbofan doesn't go through HandleApiCall, but instead uses an
    ASM builtin to enter FunctionTemplate functions. A "marker"
    frame state is needed to include these frames in the stack trace.

Note: This CL only includes these frames in Error.stack,
but not (yet) in the stack-trace API (v8.h).

Bug: v8:8742,v8:6802
Change-Id: Ic0631af883cf56e0d0122a2e0c54e36fed324d91
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1609835
Commit-Queue: Simon Zünd <szuend@chromium.org>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61602}
11 files changed
tree: c1fb0fdc9f5fa1eb10fc3cf890b7196dbbc0067b
  1. .clang-format
  2. .clang-tidy
  3. .editorconfig
  4. .git-blame-ignore-revs
  5. .gitattributes
  6. .gitignore
  7. .gn
  8. .vpython
  9. .ycm_extra_conf.py
  11. BUILD.gn
  13. ChangeLog
  14. DEPS
  18. LICENSE.fdlibm
  19. LICENSE.strongtalk
  20. LICENSE.v8
  21. LICENSE.valgrind
  22. OWNERS
  23. PRESUBMIT.py
  24. README.md
  26. benchmarks/
  27. build_overrides/
  28. codereview.settings
  29. custom_deps/
  30. docs/
  31. gni/
  32. include/
  33. infra/
  34. samples/
  35. snapshot_toolchain.gni
  36. src/
  37. test/
  38. testing/
  39. third_party/
  40. tools/

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://v8.dev/docs

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/*


Please follow the instructions mentioned at v8.dev/docs/contribute.