From f1ae68351f19069346e623badf42be0e4385633b Mon Sep 17 00:00:00 2001 From: Shu-yu Guo Date: Wed, 11 Nov 2020 16:22:12 -0800 Subject: [PATCH] [flags] Remove --harmony-promise-any MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It's shipped since M85. Bug: v8:9808 Change-Id: I0c2dcda601aad33d4acb379b242799f9b09e8930 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2510869 Commit-Queue: Shu-yu Guo Reviewed-by: Marja Hölttä Cr-Commit-Position: refs/heads/master@{#71137} --- src/flags/flag-definitions.h | 1 - src/init/bootstrapper.cc | 37 +++++-------------- src/runtime/runtime-promise.cc | 2 - .../es6/debug-promises/promise-any-caught.js | 2 - .../debug-promises/promise-any-uncaught.js | 2 +- .../mjsunit/async-stack-traces-promise-any.js | 2 +- test/mjsunit/es6/reflect-construct.js | 2 +- test/mjsunit/harmony/aggregate-error.js | 2 - .../mjsunit/harmony/promise-any-overflow-1.js | 2 +- .../mjsunit/harmony/promise-any-overflow-2.js | 2 +- .../promise-any-resolve-not-callable.js | 2 +- test/mjsunit/harmony/promise-any.js | 2 +- test/mjsunit/regress-crbug-1078825.js | 2 +- test/test262/testcfg.py | 2 - 14 files changed, 17 insertions(+), 45 deletions(-) diff --git a/src/flags/flag-definitions.h b/src/flags/flag-definitions.h index 4bea1258ba..d237adecb7 100644 --- a/src/flags/flag-definitions.h +++ b/src/flags/flag-definitions.h @@ -280,7 +280,6 @@ DEFINE_IMPLICATION(harmony_weak_refs_with_cleanup_some, harmony_weak_refs) #define HARMONY_SHIPPING_BASE(V) \ V(harmony_sharedarraybuffer, "harmony sharedarraybuffer") \ V(harmony_atomics, "harmony atomics") \ - V(harmony_promise_any, "harmony Promise.any") \ V(harmony_private_methods, "harmony private methods in class literals") \ V(harmony_weak_refs, "harmony weak references") \ V(harmony_string_replaceall, "harmony String.prototype.replaceAll") \ diff --git a/src/init/bootstrapper.cc b/src/init/bootstrapper.cc index afa8307909..cca3f7fa7a 100644 --- a/src/init/bootstrapper.cc +++ b/src/init/bootstrapper.cc @@ -2393,6 +2393,10 @@ void Genesis::InitializeGlobal(Handle global_object, InstallFunctionWithBuiltinId(isolate_, promise_fun, "allSettled", Builtins::kPromiseAllSettled, 1, true); + Handle promise_any = InstallFunctionWithBuiltinId( + isolate_, promise_fun, "any", Builtins::kPromiseAny, 1, true); + native_context()->set_promise_any(*promise_any); + InstallFunctionWithBuiltinId(isolate_, promise_fun, "race", Builtins::kPromiseRace, 1, true); @@ -2652,6 +2656,11 @@ void Genesis::InitializeGlobal(Handle global_object, InstallError(isolate_, global, factory->Error_string(), Context::ERROR_FUNCTION_INDEX); + // -- A g g r e g a t e E r r o r + InstallError(isolate_, global, factory->AggregateError_string(), + Context::AGGREGATE_ERROR_FUNCTION_INDEX, + Builtins::kAggregateErrorConstructor, 2, 2); + // -- E v a l E r r o r InstallError(isolate_, global, factory->EvalError_string(), Context::EVAL_ERROR_FUNCTION_INDEX); @@ -4339,34 +4348,6 @@ void Genesis::InitializeGlobal_harmony_weak_refs_with_cleanup_some() { DONT_ENUM); } -void Genesis::InitializeGlobal_harmony_promise_any() { - if (!FLAG_harmony_promise_any) { - return; - } - - Factory* factory = isolate()->factory(); - Handle global(native_context()->global_object(), isolate()); - - InstallError(isolate_, global, factory->AggregateError_string(), - Context::AGGREGATE_ERROR_FUNCTION_INDEX, - Builtins::kAggregateErrorConstructor, 2, 2); - - // Setup %AggregateErrorPrototype%. - Handle aggregate_error_function( - native_context()->aggregate_error_function(), isolate()); - Handle prototype( - JSObject::cast(aggregate_error_function->instance_prototype()), - isolate()); - - Handle promise_fun( - JSFunction::cast( - isolate()->native_context()->get(Context::PROMISE_FUNCTION_INDEX)), - isolate()); - Handle promise_any = InstallFunctionWithBuiltinId( - isolate_, promise_fun, "any", Builtins::kPromiseAny, 1, true); - native_context()->set_promise_any(*promise_any); -} - void Genesis::InitializeGlobal_harmony_regexp_match_indices() { if (!FLAG_harmony_regexp_match_indices) return; diff --git a/src/runtime/runtime-promise.cc b/src/runtime/runtime-promise.cc index dcc2c69013..c1ee96facc 100644 --- a/src/runtime/runtime-promise.cc +++ b/src/runtime/runtime-promise.cc @@ -259,7 +259,6 @@ RUNTIME_FUNCTION(Runtime_ResolvePromise) { // A helper function to be called when constructing AggregateError objects. This // takes care of the Error-related construction, e.g., stack traces. RUNTIME_FUNCTION(Runtime_ConstructAggregateErrorHelper) { - DCHECK(FLAG_harmony_promise_any); HandleScope scope(isolate); DCHECK_EQ(3, args.length()); CONVERT_ARG_HANDLE_CHECKED(JSFunction, target, 0); @@ -278,7 +277,6 @@ RUNTIME_FUNCTION(Runtime_ConstructAggregateErrorHelper) { // A helper function to be called when constructing AggregateError objects. This // takes care of the Error-related construction, e.g., stack traces. RUNTIME_FUNCTION(Runtime_ConstructInternalAggregateErrorHelper) { - DCHECK(FLAG_harmony_promise_any); HandleScope scope(isolate); DCHECK_GE(args.length(), 1); CONVERT_ARG_HANDLE_CHECKED(Smi, message, 0); diff --git a/test/debugger/debug/es6/debug-promises/promise-any-caught.js b/test/debugger/debug/es6/debug-promises/promise-any-caught.js index a5df680d68..cfa4002fb3 100644 --- a/test/debugger/debug/es6/debug-promises/promise-any-caught.js +++ b/test/debugger/debug/es6/debug-promises/promise-any-caught.js @@ -1,8 +1,6 @@ // Copyright 2020 the V8 project authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// -// Flags: --harmony-promise-any // Test debug events when we only listen to uncaught exceptions and a // Promise p3 created by Promise.any has a catch handler, and is rejected diff --git a/test/debugger/debug/es6/debug-promises/promise-any-uncaught.js b/test/debugger/debug/es6/debug-promises/promise-any-uncaught.js index 661f22ae24..8ebab3f8a2 100644 --- a/test/debugger/debug/es6/debug-promises/promise-any-uncaught.js +++ b/test/debugger/debug/es6/debug-promises/promise-any-uncaught.js @@ -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: --harmony-promise-any --ignore-unhandled-promises +// Flags: --ignore-unhandled-promises // Test debug events when we only listen to uncaught exceptions and a // Promise p3 created by Promise.any has no catch handler, and is rejected diff --git a/test/mjsunit/async-stack-traces-promise-any.js b/test/mjsunit/async-stack-traces-promise-any.js index 0b81bfec8f..47aecd4039 100644 --- a/test/mjsunit/async-stack-traces-promise-any.js +++ b/test/mjsunit/async-stack-traces-promise-any.js @@ -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: --allow-natives-syntax --async-stack-traces --harmony-promise-any +// Flags: --allow-natives-syntax --async-stack-traces // Basic test with Promise.any(). (function() { diff --git a/test/mjsunit/es6/reflect-construct.js b/test/mjsunit/es6/reflect-construct.js index f69a93b487..486d7bb056 100644 --- a/test/mjsunit/es6/reflect-construct.js +++ b/test/mjsunit/es6/reflect-construct.js @@ -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: --allow-unsafe-function-constructor --harmony-promise-any +// Flags: --allow-unsafe-function-constructor (function testReflectConstructArity() { diff --git a/test/mjsunit/harmony/aggregate-error.js b/test/mjsunit/harmony/aggregate-error.js index a3b53b2be7..bf3c541812 100644 --- a/test/mjsunit/harmony/aggregate-error.js +++ b/test/mjsunit/harmony/aggregate-error.js @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Flags: --harmony-promise-any - (function TestNoParameters() { // Can't omit the "errors" parameter; there's nothing to iterate. assertThrows(() => { new AggregateError(); }); diff --git a/test/mjsunit/harmony/promise-any-overflow-1.js b/test/mjsunit/harmony/promise-any-overflow-1.js index 0a95edd05c..cbab18ee86 100644 --- a/test/mjsunit/harmony/promise-any-overflow-1.js +++ b/test/mjsunit/harmony/promise-any-overflow-1.js @@ -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: --allow-natives-syntax --harmony-promise-any +// Flags: --allow-natives-syntax load('test/mjsunit/test-async.js'); diff --git a/test/mjsunit/harmony/promise-any-overflow-2.js b/test/mjsunit/harmony/promise-any-overflow-2.js index 2ed8453e3a..2a80480963 100644 --- a/test/mjsunit/harmony/promise-any-overflow-2.js +++ b/test/mjsunit/harmony/promise-any-overflow-2.js @@ -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: --allow-natives-syntax --harmony-promise-any +// Flags: --allow-natives-syntax load('test/mjsunit/test-async.js'); diff --git a/test/mjsunit/harmony/promise-any-resolve-not-callable.js b/test/mjsunit/harmony/promise-any-resolve-not-callable.js index b65bafd2a4..a4aae6071c 100644 --- a/test/mjsunit/harmony/promise-any-resolve-not-callable.js +++ b/test/mjsunit/harmony/promise-any-resolve-not-callable.js @@ -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: --allow-natives-syntax --harmony-promise-any +// Flags: --allow-natives-syntax load('test/mjsunit/test-async.js'); diff --git a/test/mjsunit/harmony/promise-any.js b/test/mjsunit/harmony/promise-any.js index f1244bce8c..6251b05cbc 100644 --- a/test/mjsunit/harmony/promise-any.js +++ b/test/mjsunit/harmony/promise-any.js @@ -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: --allow-natives-syntax --harmony-promise-any +// Flags: --allow-natives-syntax load('test/mjsunit/test-async.js'); diff --git a/test/mjsunit/regress-crbug-1078825.js b/test/mjsunit/regress-crbug-1078825.js index 9381da50a0..20dcb9624c 100644 --- a/test/mjsunit/regress-crbug-1078825.js +++ b/test/mjsunit/regress-crbug-1078825.js @@ -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: --allow-natives-syntax --harmony-promise-any +// Flags: --allow-natives-syntax load('test/mjsunit/test-async.js'); diff --git a/test/test262/testcfg.py b/test/test262/testcfg.py index 34cf4bab30..fb33d00b4a 100644 --- a/test/test262/testcfg.py +++ b/test/test262/testcfg.py @@ -59,9 +59,7 @@ FEATURE_FLAGS = { 'regexp-named-groups': '--harmony-regexp-match-indices', 'class-methods-private': '--harmony-private-methods', 'class-static-methods-private': '--harmony-private-methods', - 'AggregateError': '--harmony-promise-any', 'logical-assignment-operators': '--harmony-logical-assignment', - 'Promise.any': '--harmony-promise-any', 'Atomics.waitAsync': '--harmony-atomics-waitasync', }