Skip to content

Commit 99ffe35

Browse files
anonrigtargos
authored andcommitted
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: v8/v8@0d5d6e7 PR-URL: #55014 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
1 parent 5d8011d commit 99ffe35

File tree

5 files changed

+11
-22
lines changed

5 files changed

+11
-22
lines changed

common.gypi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737

3838
# Reset this number to 0 on major V8 upgrades.
3939
# Increment by one for each non-official patch applied to deps/v8.
40-
'v8_embedder_string': '-node.8',
40+
'v8_embedder_string': '-node.9',
4141

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

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,6 @@ DEFINE_BOOL(js_shipping, true, "enable all shipped JavaScript features")
315315
V(harmony_import_attributes, "harmony import attributes")
316316

317317
#define JAVASCRIPT_SHIPPING_FEATURES_BASE(V) \
318-
V(js_promise_withresolvers, "Promise.withResolvers") \
319318
V(js_regexp_duplicate_named_groups, "RegExp duplicate named groups") \
320319
V(js_regexp_modifiers, "RegExp modifiers") \
321320
V(js_promise_try, "Promise.try")

deps/v8/src/init/bootstrapper.cc

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3258,6 +3258,15 @@ void Genesis::InitializeGlobal(Handle<JSGlobalObject> global_object,
32583258
InstallFunctionWithBuiltinId(isolate_, promise_fun, "reject",
32593259
Builtin::kPromiseReject, 1, kAdapt);
32603260

3261+
std::array<Handle<Name>, 3> fields{factory->promise_string(),
3262+
factory->resolve_string(),
3263+
factory->reject_string()};
3264+
DirectHandle<Map> result_map =
3265+
CreateLiteralObjectMapFromCache(isolate_, fields);
3266+
native_context()->set_promise_withresolvers_result_map(*result_map);
3267+
InstallFunctionWithBuiltinId(isolate_, promise_fun, "withResolvers",
3268+
Builtin::kPromiseWithResolvers, 0, kAdapt);
3269+
32613270
SetConstructorInstanceType(isolate_, promise_fun,
32623271
JS_PROMISE_CONSTRUCTOR_TYPE);
32633272

@@ -5581,24 +5590,6 @@ void Genesis::InitializeGlobal_js_promise_try() {
55815590
Builtin::kPromiseTry, 1, kDontAdapt);
55825591
}
55835592

5584-
void Genesis::InitializeGlobal_js_promise_withresolvers() {
5585-
if (!v8_flags.js_promise_withresolvers) return;
5586-
5587-
Factory* factory = isolate()->factory();
5588-
5589-
std::array<Handle<Name>, 3> fields{factory->promise_string(),
5590-
factory->resolve_string(),
5591-
factory->reject_string()};
5592-
DirectHandle<Map> result_map =
5593-
CreateLiteralObjectMapFromCache(isolate(), fields);
5594-
native_context()->set_promise_withresolvers_result_map(*result_map);
5595-
5596-
Handle<JSFunction> promise_fun =
5597-
handle(native_context()->promise_function(), isolate());
5598-
InstallFunctionWithBuiltinId(isolate(), promise_fun, "withResolvers",
5599-
Builtin::kPromiseWithResolvers, 0, kAdapt);
5600-
}
5601-
56025593
void Genesis::InitializeGlobal_harmony_set_methods() {
56035594
if (!v8_flags.harmony_set_methods) return;
56045595

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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 0 additions & 1 deletion
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy