v8/include
Stephen Belanger c0fceaa066 Reland "[api] JSFunction PromiseHook for v8::Context"
This is a reland of d5457f5fb7
after a speculative revert.

Additionally it fixes an issue with throwing promise hooks.

Original change's description:
> [api] JSFunction PromiseHook for v8::Context
>
> This will enable Node.js to get much better performance from async_hooks
> as currently PromiseHook delegates to C++ for the hook function and then
> Node.js delegates it right back to JavaScript, introducing several
> unnecessary barrier hops in code that gets called very, very frequently
> in modern, promise-heavy applications.
>
> This API mirrors the form of the original C++ function based PromiseHook
> API, however it is intentionally separate to allow it to use JSFunctions
> triggered within generated code to, as much as possible, avoid entering
> runtime functions entirely.
>
> Because PromiseHook has internal use also, beyond just the Node.js use,
> I have opted to leave the existing API intact and keep this separate to
> avoid conflicting with any possible behaviour expectations of other API
> users.
>
> The design ideas for this new API stemmed from discussion with some V8
> team members at a previous Node.js Diagnostics Summit hosted by Google
> in Munich, and the relevant documentation of the discussion can be found
> here: https://docs.google.com/document/d/1g8OrG5lMIUhRn1zbkutgY83MiTSMx-0NHDs8Bf-nXxM/edit#heading=h.w1bavzz80l1e
>
> A summary of the reasons for why this new design is important can be
> found here: https://docs.google.com/document/d/1vtgoT4_kjgOr-Bl605HR2T6_SC-C8uWzYaOPDK5pmRo/edit?usp=sharing
>
> Bug: v8:11025
> Change-Id: I0b403b00c37d3020b5af07b654b860659d3a7697
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2759188
> Reviewed-by: Marja Hölttä <marja@chromium.org>
> Reviewed-by: Camillo Bruni <cbruni@chromium.org>
> Reviewed-by: Anton Bikineev <bikineev@chromium.org>
> Reviewed-by: Igor Sheludko <ishell@chromium.org>
> Commit-Queue: Camillo Bruni <cbruni@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#73858}

Bug: v8:11025
Bug: chromium:1197475
Change-Id: I73a71e97d9c3dff89a2b092c3fe4adff81ede8ef
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2823917
Reviewed-by: Marja Hölttä <marja@chromium.org>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Reviewed-by: Anton Bikineev <bikineev@chromium.org>
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#74071}
2021-04-20 14:49:46 +00:00
..
cppgc cppgc: Check for correct base class inheritance 2021-04-08 09:23:57 +00:00
libplatform Step 1 (of 3-ish): Basic ETW Instrumentation in V8 2021-01-05 20:11:03 +00:00
APIDesign.md Move inspector protocol definitions to include/ 2019-06-18 17:59:36 +00:00
DEPS cppgc: Implement process-global state accessors. 2021-02-17 22:37:24 +00:00
DIR_METADATA Add DIR_METADATA files to v8. 2020-10-20 22:12:28 +00:00
js_protocol-1.2.json Move inspector protocol definitions to include/ 2019-06-18 17:59:36 +00:00
js_protocol-1.3.json Move inspector protocol definitions to include/ 2019-06-18 17:59:36 +00:00
js_protocol.pdl Heap Number encoding 2021-04-16 02:29:06 +00:00
OWNERS Update include/OWNERS 2021-02-25 14:27:28 +00:00
v8-cppgc.h Reland "cppgc: Rework testing GC infrastructure" 2021-02-26 21:29:42 +00:00
v8-fast-api-calls.h Reland "[fastcall] Add support for leaf interface type checks" 2021-04-20 12:44:38 +00:00
v8-inspector-protocol.h Fix LINT exceptions across the code base 2020-04-27 16:37:04 +00:00
v8-inspector.h Delegate unique id generation to embedder 2020-12-22 18:40:10 +00:00
v8-internal.h [api] Add v8::metrics::LongTaskStats for the LongTasks UKM 2021-04-14 12:56:34 +00:00
v8-metrics.h [api] Add v8::metrics::LongTaskStats for the LongTasks UKM 2021-04-14 12:56:34 +00:00
v8-platform.h [Jobs]: Cleanup in v8 platform. 2021-04-07 16:00:22 +00:00
v8-profiler.h Heap Number encoding 2021-04-16 02:29:06 +00:00
v8-unwinder-state.h Add RISC-V backend 2021-02-09 17:06:36 +00:00
v8-util.h Fix LINT exceptions across the code base 2020-04-27 16:37:04 +00:00
v8-value-serializer-version.h Expose the ValueSerializer data format version as a compile-time constant. 2017-04-27 15:14:41 +00:00
v8-version-string.h Fix LINT exceptions across the code base 2020-04-27 16:37:04 +00:00
v8-version.h Changed version number to 9.2 2021-04-08 17:30:02 +00:00
v8-wasm-trap-handler-posix.h Fix LINT exceptions across the code base 2020-04-27 16:37:04 +00:00
v8-wasm-trap-handler-win.h Fix LINT exceptions across the code base 2020-04-27 16:37:04 +00:00
v8.h Reland "[api] JSFunction PromiseHook for v8::Context" 2021-04-20 14:49:46 +00:00
v8config.h [build] Add header for externally-visible defines 2021-01-18 16:57:26 +00:00