diff options
author | Stephen Belanger <stephen.belanger@datadoghq.com> | 2021-04-29 19:18:17 +0300 |
---|---|---|
committer | Myles Borins <mylesborins@github.com> | 2021-08-31 17:54:53 +0300 |
commit | 9d7177c152961e559af582480f237ef78ffea779 (patch) | |
tree | ace33ff750a516aa8984c4c2cc4cb679bc230f5b /deps | |
parent | ec0f0ef8ef7aa3501394b9d40542838673ac51e0 (diff) |
deps: V8: cherry-pick 4c074516397b
Original commit message:
[promises] Fix slow path when context promise hooks are present
Bug: chromium:1201936
Change-Id: I1ee545e33587ddf4a5c7e1cbd64b53d36c75a146
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2850936
Reviewed-by: Marja Hölttä <marja@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#74267}
Refs: https://github.com/v8/v8/commit/4c074516397b89c5cfe9de9857018484f73445ef
PR-URL: https://github.com/nodejs/node/pull/36394
Backport-PR-URL: https://github.com/nodejs/node/pull/38577
Reviewed-By: Bryan English <bryan@bryanenglish.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'deps')
-rw-r--r-- | deps/v8/src/builtins/promise-jobs.tq | 3 | ||||
-rw-r--r-- | deps/v8/src/codegen/code-stub-assembler.cc | 6 | ||||
-rw-r--r-- | deps/v8/src/codegen/code-stub-assembler.h | 10 |
3 files changed, 9 insertions, 10 deletions
diff --git a/deps/v8/src/builtins/promise-jobs.tq b/deps/v8/src/builtins/promise-jobs.tq index 50bcd395288..d0d88b30d6b 100644 --- a/deps/v8/src/builtins/promise-jobs.tq +++ b/deps/v8/src/builtins/promise-jobs.tq @@ -7,6 +7,7 @@ // https://tc39.es/ecma262/#sec-promise-jobs namespace promise { extern macro IsJSPromiseMap(Map): bool; +extern macro NeedsAnyPromiseHooks(): bool; // https://tc39.es/ecma262/#sec-promiseresolvethenablejob transitioning builtin @@ -25,7 +26,7 @@ PromiseResolveThenableJob(implicit context: Context)( const promiseThen = nativeContext[NativeContextSlot::PROMISE_THEN_INDEX]; const thenableMap = thenable.map; if (TaggedEqual(then, promiseThen) && IsJSPromiseMap(thenableMap) && - !IsIsolatePromiseHookEnabledOrDebugIsActiveOrHasAsyncEventDelegate() && + !NeedsAnyPromiseHooks() && IsPromiseSpeciesLookupChainIntact(nativeContext, thenableMap)) { // We know that the {thenable} is a JSPromise, which doesn't require // any special treatment and that {then} corresponds to the initial diff --git a/deps/v8/src/codegen/code-stub-assembler.cc b/deps/v8/src/codegen/code-stub-assembler.cc index e330d99f038..843d1e39ac9 100644 --- a/deps/v8/src/codegen/code-stub-assembler.cc +++ b/deps/v8/src/codegen/code-stub-assembler.cc @@ -12781,11 +12781,11 @@ TNode<BoolT> CodeStubAssembler:: return Word32NotEqual(flags, Int32Constant(0)); } -TNode<BoolT> CodeStubAssembler:: - IsAnyPromiseHookEnabledOrHasAsyncEventDelegate(TNode<Uint32T> flags) { +TNode<BoolT> CodeStubAssembler::NeedsAnyPromiseHooks(TNode<Uint32T> flags) { uint32_t mask = Isolate::PromiseHookFields::HasContextPromiseHook::kMask | Isolate::PromiseHookFields::HasIsolatePromiseHook::kMask | - Isolate::PromiseHookFields::HasAsyncEventDelegate::kMask; + Isolate::PromiseHookFields::HasAsyncEventDelegate::kMask | + Isolate::PromiseHookFields::IsDebugActive::kMask; return IsSetWord32(flags, mask); } diff --git a/deps/v8/src/codegen/code-stub-assembler.h b/deps/v8/src/codegen/code-stub-assembler.h index bcb88afe0ca..499b26e0bf0 100644 --- a/deps/v8/src/codegen/code-stub-assembler.h +++ b/deps/v8/src/codegen/code-stub-assembler.h @@ -3747,12 +3747,10 @@ class V8_EXPORT_PRIVATE CodeStubAssembler return IsAnyPromiseHookEnabledOrDebugIsActiveOrHasAsyncEventDelegate( PromiseHookFlags()); } - TNode<BoolT> IsAnyPromiseHookEnabledOrHasAsyncEventDelegate( - TNode<Uint32T> flags); - TNode<BoolT> - IsAnyPromiseHookEnabledOrHasAsyncEventDelegate() { - return IsAnyPromiseHookEnabledOrHasAsyncEventDelegate( - PromiseHookFlags()); + + TNode<BoolT> NeedsAnyPromiseHooks(TNode<Uint32T> flags); + TNode<BoolT> NeedsAnyPromiseHooks() { + return NeedsAnyPromiseHooks(PromiseHookFlags()); } // for..in helpers |