Skip to content

Commit b533a51

Browse files
anonrigaduh95
authored andcommittedOct 8, 2024··
deps: V8: backport 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: v8/v8@0d5d6e7 PR-URL: #55115 Backport-PR-URL: #55260 Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent 2f65b3f commit b533a51

File tree

5 files changed

+12
-22
lines changed

5 files changed

+12
-22
lines changed
 

‎common.gypi

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636

3737
# Reset this number to 0 on major V8 upgrades.
3838
# Increment by one for each non-official patch applied to deps/v8.
39-
'v8_embedder_string': '-node.20',
39+
'v8_embedder_string': '-node.21',
4040

4141
##### V8 defaults for Node.js #####
4242

‎deps/v8/src/flags/flag-definitions.h

+1-2
Original file line numberDiff line numberDiff line change
@@ -299,8 +299,7 @@ DEFINE_BOOL(js_shipping, true, "enable all shipped JavaScript features")
299299
V(harmony_set_methods, "harmony Set Methods") \
300300
V(harmony_import_attributes, "harmony import attributes")
301301

302-
#define JAVASCRIPT_SHIPPING_FEATURES_BASE(V) \
303-
V(js_promise_withresolvers, "Promise.withResolvers")
302+
#define JAVASCRIPT_SHIPPING_FEATURES_BASE(V)
304303

305304
#ifdef V8_INTL_SUPPORT
306305
#define HARMONY_SHIPPING(V) HARMONY_SHIPPING_BASE(V)

‎deps/v8/src/init/bootstrapper.cc

+9-17
Original file line numberDiff line numberDiff line change
@@ -3217,6 +3217,15 @@ void Genesis::InitializeGlobal(Handle<JSGlobalObject> global_object,
32173217
InstallFunctionWithBuiltinId(isolate_, promise_fun, "reject",
32183218
Builtin::kPromiseReject, 1, true);
32193219

3220+
std::array<Handle<Name>, 3> fields{factory->promise_string(),
3221+
factory->resolve_string(),
3222+
factory->reject_string()};
3223+
DirectHandle<Map> result_map =
3224+
CreateLiteralObjectMapFromCache(isolate_, fields);
3225+
native_context()->set_promise_withresolvers_result_map(*result_map);
3226+
InstallFunctionWithBuiltinId(isolate_, promise_fun, "withResolvers",
3227+
Builtin::kPromiseWithResolvers, 0, true);
3228+
32203229
SetConstructorInstanceType(isolate_, promise_fun,
32213230
JS_PROMISE_CONSTRUCTOR_TYPE);
32223231

@@ -5445,23 +5454,6 @@ void Genesis::InitializeGlobal_harmony_iterator_helpers() {
54455454
#undef ITERATOR_HELPERS
54465455
}
54475456

5448-
void Genesis::InitializeGlobal_js_promise_withresolvers() {
5449-
if (!v8_flags.js_promise_withresolvers) return;
5450-
5451-
Factory* factory = isolate()->factory();
5452-
5453-
std::array<Handle<Name>, 3> fields{factory->promise_string(),
5454-
factory->resolve_string(),
5455-
factory->reject_string()};
5456-
Handle<Map> result_map = CreateLiteralObjectMapFromCache(isolate(), fields);
5457-
native_context()->set_promise_withresolvers_result_map(*result_map);
5458-
5459-
Handle<JSFunction> promise_fun =
5460-
handle(native_context()->promise_function(), isolate());
5461-
InstallFunctionWithBuiltinId(isolate(), promise_fun, "withResolvers",
5462-
Builtin::kPromiseWithResolvers, 0, true);
5463-
}
5464-
54655457
void Genesis::InitializeGlobal_harmony_set_methods() {
54665458
if (!v8_flags.harmony_set_methods) return;
54675459

‎deps/v8/test/mjsunit/harmony/promise-withresolvers.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5-
// Flags: --js-promise-withresolvers --allow-natives-syntax
5+
// Flags: --allow-natives-syntax
66

77
const desc = Object.getOwnPropertyDescriptor(Promise, 'withResolvers');
88
assertTrue(desc.configurable);

‎deps/v8/test/test262/testcfg.py

-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@
5858
'json-parse-with-source': '--harmony-json-parse-with-source',
5959
'iterator-helpers': '--harmony-iterator-helpers',
6060
'set-methods': '--harmony-set-methods',
61-
'promise-with-resolvers': '--js-promise-withresolvers',
6261
'Array.fromAsync': '--harmony-array-from-async',
6362
'import-attributes': '--harmony-import-attributes',
6463
'regexp-duplicate-named-groups': '--js-regexp-duplicate-named-groups',

0 commit comments

Comments
 (0)
Please sign in to comment.