deps: V8: cherry-pick 0d5d6e71bbb0

Original commit message:

    Remove `--js-promise-withresolvers` runtime flag

    Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
    Bug: 42204122
    Change-Id: I017a0d1ae0f8225513206ffb7806a4250be75d4c
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5843972
    Reviewed-by: Igor Sheludko <ishell@chromium.org>
    Commit-Queue: Erik Corry <erikcorry@chromium.org>
    Reviewed-by: Shu-yu Guo <syg@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#96215}

Refs: https://github.com/v8/v8/commit/0d5d6e71bbb0d2b0a12567fffa7e3375c427bc92
PR-URL: https://github.com/nodejs/node/pull/55014
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
This commit is contained in:
Yagiz NizipliandAntoine du Hamel authored and Michaël Zasso committed 2025-01-31 12:47:01 +01:00
1 parent 5d8011d91c
commit 99ffe3555a
5 files changed
+11 -22

No files matched your search

+1 -1
View File
@@ -37,7 +37,7 @@
# Reset this number to 0 on major V8 upgrades.
# Increment by one for each non-official patch applied to deps/v8.
'v8_embedder_string': '-node.8',
'v8_embedder_string': '-node.9',
##### V8 defaults for Node.js #####
-1
View File
@@ -315,7 +315,6 @@ DEFINE_BOOL(js_shipping, true, "enable all shipped JavaScript features")
V(harmony_import_attributes, "harmony import attributes")
#define JAVASCRIPT_SHIPPING_FEATURES_BASE(V) \
V(js_promise_withresolvers, "Promise.withResolvers") \
V(js_regexp_duplicate_named_groups, "RegExp duplicate named groups") \
V(js_regexp_modifiers, "RegExp modifiers") \
V(js_promise_try, "Promise.try")
+9 -18
View File
@@ -3258,6 +3258,15 @@ void Genesis::InitializeGlobal(Handle<JSGlobalObject> global_object,
InstallFunctionWithBuiltinId(isolate_, promise_fun, "reject",
Builtin::kPromiseReject, 1, kAdapt);
std::array<Handle<Name>, 3> fields{factory->promise_string(),
factory->resolve_string(),
factory->reject_string()};
DirectHandle<Map> result_map =
CreateLiteralObjectMapFromCache(isolate_, fields);
native_context()->set_promise_withresolvers_result_map(*result_map);
InstallFunctionWithBuiltinId(isolate_, promise_fun, "withResolvers",
Builtin::kPromiseWithResolvers, 0, kAdapt);
SetConstructorInstanceType(isolate_, promise_fun,
JS_PROMISE_CONSTRUCTOR_TYPE);
@@ -5581,24 +5590,6 @@ void Genesis::InitializeGlobal_js_promise_try() {
Builtin::kPromiseTry, 1, kDontAdapt);
}
void Genesis::InitializeGlobal_js_promise_withresolvers() {
if (!v8_flags.js_promise_withresolvers) return;
Factory* factory = isolate()->factory();
std::array<Handle<Name>, 3> fields{factory->promise_string(),
factory->resolve_string(),
factory->reject_string()};
DirectHandle<Map> result_map =
CreateLiteralObjectMapFromCache(isolate(), fields);
native_context()->set_promise_withresolvers_result_map(*result_map);
Handle<JSFunction> promise_fun =
handle(native_context()->promise_function(), isolate());
InstallFunctionWithBuiltinId(isolate(), promise_fun, "withResolvers",
Builtin::kPromiseWithResolvers, 0, kAdapt);
}
void Genesis::InitializeGlobal_harmony_set_methods() {
if (!v8_flags.harmony_set_methods) return;
+1 -1
View File
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --js-promise-withresolvers --allow-natives-syntax
// Flags: --allow-natives-syntax
const desc = Object.getOwnPropertyDescriptor(Promise, 'withResolvers');
assertTrue(desc.configurable);
-1
View File
@@ -58,7 +58,6 @@ FEATURE_FLAGS = {
'json-parse-with-source': '--harmony-json-parse-with-source',
'iterator-helpers': '--harmony-iterator-helpers',
'set-methods': '--harmony-set-methods',
'promise-with-resolvers': '--js-promise-withresolvers',
'import-attributes': '--harmony-import-attributes',
'regexp-duplicate-named-groups': '--js-regexp-duplicate-named-groups',
'regexp-modifiers': '--js-regexp-modifiers',