diff options
author | Stephen Belanger <admin@stephenbelanger.com> | 2020-06-06 14:13:16 -0700 |
---|---|---|
committer | Michaël Zasso <targos@protonmail.com> | 2020-07-13 14:42:30 +0200 |
commit | e432470ed2ea5210cc4b70cedab2aaec6addfbe6 (patch) | |
tree | 39c787b1541ea67219950bad787b77adf2c98eb9 /deps/v8/src/builtins | |
parent | d7905fcc518d18c5719208387432aaaf4df585cd (diff) | |
download | node-new-e432470ed2ea5210cc4b70cedab2aaec6addfbe6.tar.gz |
deps: V8: cherry-pick eec10a2fd8fa
Original commit message:
[promisehook] Add before/after hooks to thenable tasks
This will allow Node.js to properly track async context in thenables.
Change-Id: If441423789a78307a57ad7e645daabf551cddb57
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2215624
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org>
Commit-Queue: Gus Caplan <me@gus.host>
Cr-Commit-Position: refs/heads/master@{#68207}
Refs: https://github.com/v8/v8/commit/eec10a2fd8fa4d0e7f5e32dedbd239d938a5dd87
PR-URL: https://github.com/nodejs/node/pull/33778
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Diffstat (limited to 'deps/v8/src/builtins')
-rw-r--r-- | deps/v8/src/builtins/builtins-microtask-queue-gen.cc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/deps/v8/src/builtins/builtins-microtask-queue-gen.cc b/deps/v8/src/builtins/builtins-microtask-queue-gen.cc index e613ae9c08..1da6f54c82 100644 --- a/deps/v8/src/builtins/builtins-microtask-queue-gen.cc +++ b/deps/v8/src/builtins/builtins-microtask-queue-gen.cc @@ -198,11 +198,18 @@ void MicrotaskQueueBuiltinsAssembler::RunSingleMicrotask( const TNode<Object> thenable = LoadObjectField( microtask, PromiseResolveThenableJobTask::kThenableOffset); + RunPromiseHook(Runtime::kPromiseHookBefore, microtask_context, + CAST(promise_to_resolve)); + { ScopedExceptionHandler handler(this, &if_exception, &var_exception); CallBuiltin(Builtins::kPromiseResolveThenableJob, native_context, promise_to_resolve, thenable, then); } + + RunPromiseHook(Runtime::kPromiseHookAfter, microtask_context, + CAST(promise_to_resolve)); + RewindEnteredContext(saved_entered_context_count); SetCurrentContext(current_context); Goto(&done); |