Skip to content

Commit fe45be2

Browse files
anonrigaduh95
authored andcommitted
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 Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent cc9b9a7 commit fe45be2

File tree

5 files changed

+11
-22
lines changed

5 files changed

+11
-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.9',
39+
'v8_embedder_string': '-node.10',
4040

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

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

-1
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,6 @@ DEFINE_BOOL(js_shipping, true, "enable all shipped JavaScript features")
317317
V(harmony_import_attributes, "harmony import attributes")
318318

319319
#define JAVASCRIPT_SHIPPING_FEATURES_BASE(V) \
320-
V(js_promise_withresolvers, "Promise.withResolvers") \
321320
V(js_regexp_duplicate_named_groups, "RegExp duplicate named groups") \
322321
V(js_regexp_modifiers, "RegExp modifiers") \
323322
V(js_promise_try, "Promise.try")

deps/v8/src/init/bootstrapper.cc

+9-18
Original file line numberDiff line numberDiff line change
@@ -3228,6 +3228,15 @@ void Genesis::InitializeGlobal(Handle<JSGlobalObject> global_object,
32283228
InstallFunctionWithBuiltinId(isolate_, promise_fun, "reject",
32293229
Builtin::kPromiseReject, 1, true);
32303230

3231+
std::array<Handle<Name>, 3> fields{factory->promise_string(),
3232+
factory->resolve_string(),
3233+
factory->reject_string()};
3234+
DirectHandle<Map> result_map =
3235+
CreateLiteralObjectMapFromCache(isolate_, fields);
3236+
native_context()->set_promise_withresolvers_result_map(*result_map);
3237+
InstallFunctionWithBuiltinId(isolate_, promise_fun, "withResolvers",
3238+
Builtin::kPromiseWithResolvers, 0, true);
3239+
32313240
SetConstructorInstanceType(isolate_, promise_fun,
32323241
JS_PROMISE_CONSTRUCTOR_TYPE);
32333242

@@ -5504,24 +5513,6 @@ void Genesis::InitializeGlobal_js_promise_try() {
55045513
Builtin::kPromiseTry, 1, false);
55055514
}
55065515

5507-
void Genesis::InitializeGlobal_js_promise_withresolvers() {
5508-
if (!v8_flags.js_promise_withresolvers) return;
5509-
5510-
Factory* factory = isolate()->factory();
5511-
5512-
std::array<Handle<Name>, 3> fields{factory->promise_string(),
5513-
factory->resolve_string(),
5514-
factory->reject_string()};
5515-
DirectHandle<Map> result_map =
5516-
CreateLiteralObjectMapFromCache(isolate(), fields);
5517-
native_context()->set_promise_withresolvers_result_map(*result_map);
5518-
5519-
Handle<JSFunction> promise_fun =
5520-
handle(native_context()->promise_function(), isolate());
5521-
InstallFunctionWithBuiltinId(isolate(), promise_fun, "withResolvers",
5522-
Builtin::kPromiseWithResolvers, 0, true);
5523-
}
5524-
55255516
void Genesis::InitializeGlobal_harmony_set_methods() {
55265517
if (!v8_flags.harmony_set_methods) return;
55275518

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
'import-attributes': '--harmony-import-attributes',
6362
'regexp-duplicate-named-groups': '--js-regexp-duplicate-named-groups',
6463
'regexp-modifiers': '--js-regexp-modifiers',

0 commit comments

Comments
 (0)