deps: V8: cherry-pick eec10a2fd8fa · nodejs/node@5db8b35 · GitHub
Skip to content

Commit 5db8b35

Browse files
Qardaddaleax
authored andcommitted
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: v8/v8@eec10a2 Backport-PR-URL: #34776 PR-URL: #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>
1 parent b7e4d5f commit 5db8b35

3 files changed

Lines changed: 20 additions & 2 deletions

File tree

common.gypi

Lines changed: 1 addition & 1 deletion

deps/v8/src/builtins/builtins-microtask-queue-gen.cc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,10 +202,17 @@ void MicrotaskQueueBuiltinsAssembler::RunSingleMicrotask(
202202
TNode<Object> const thenable = LoadObjectField(
203203
microtask, PromiseResolveThenableJobTask::kThenableOffset);
204204

205+
RunPromiseHook(Runtime::kPromiseHookBefore, microtask_context,
206+
CAST(promise_to_resolve));
207+
205208
TNode<Object> const result =
206209
CallBuiltin(Builtins::kPromiseResolveThenableJob, native_context,
207210
promise_to_resolve, thenable, then);
208211
GotoIfException(result, &if_exception, &var_exception);
212+
213+
RunPromiseHook(Runtime::kPromiseHookAfter, microtask_context,
214+
CAST(promise_to_resolve));
215+
209216
RewindEnteredContext(saved_entered_context_count);
210217
SetCurrentContext(current_context);
211218
Goto(&done);

deps/v8/test/cctest/test-api.cc

Lines changed: 12 additions & 1 deletion

0 commit comments

Comments
 (0)