Commit 51c9123e authored by Mathias Bynens's avatar Mathias Bynens Committed by Commit Bot

Remove always-true --harmony-promise-finally runtime flag

It was shipped in Chrome 63.

Bug: v8:5967
Cq-Include-Trybots: luci.v8.try:v8_linux_noi18n_rel_ng
Change-Id: I1ade30d7ba3cf012f4d0c898f868192972aac726
Reviewed-on: https://chromium-review.googlesource.com/1085289
Commit-Queue: Mathias Bynens <mathias@chromium.org>
Reviewed-by: 's avatarSathya Gunasekaran <gsathya@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53505}
parent 675c1de5
......@@ -2352,6 +2352,40 @@ void Genesis::InitializeGlobal(Handle<JSGlobalObject> global_object,
Builtins::kPromisePrototypeCatch, 1, true);
native_context()->set_promise_catch(*promise_catch);
SimpleInstallFunction(isolate_, prototype, "finally",
Builtins::kPromisePrototypeFinally, 1, true,
DONT_ENUM);
{
Handle<SharedFunctionInfo> info = SimpleCreateSharedFunctionInfo(
isolate(), Builtins::kPromiseThenFinally,
isolate_->factory()->empty_string(), 1);
info->set_native(true);
native_context()->set_promise_then_finally_shared_fun(*info);
}
{
Handle<SharedFunctionInfo> info = SimpleCreateSharedFunctionInfo(
isolate(), Builtins::kPromiseCatchFinally,
isolate_->factory()->empty_string(), 1);
info->set_native(true);
native_context()->set_promise_catch_finally_shared_fun(*info);
}
{
Handle<SharedFunctionInfo> info = SimpleCreateSharedFunctionInfo(
isolate(), Builtins::kPromiseValueThunkFinally,
isolate_->factory()->empty_string(), 0);
native_context()->set_promise_value_thunk_finally_shared_fun(*info);
}
{
Handle<SharedFunctionInfo> info = SimpleCreateSharedFunctionInfo(
isolate(), Builtins::kPromiseThrowerFinally,
isolate_->factory()->empty_string(), 0);
native_context()->set_promise_thrower_finally_shared_fun(*info);
}
// Force the Promise constructor to fast properties, so that we can use the
// fast paths for various things like
//
......@@ -4405,49 +4439,6 @@ void Genesis::InitializeGlobal_harmony_string_matchall() {
}
}
void Genesis::InitializeGlobal_harmony_promise_finally() {
if (!FLAG_harmony_promise_finally) return;
Handle<JSFunction> constructor(native_context()->promise_function());
Handle<JSObject> prototype(JSObject::cast(constructor->instance_prototype()));
SimpleInstallFunction(isolate(), prototype, "finally",
Builtins::kPromisePrototypeFinally, 1, true, DONT_ENUM);
// The promise prototype map has changed because we added a property
// to prototype, so we update the saved map.
Handle<Map> prototype_map(prototype->map());
Map::SetShouldBeFastPrototypeMap(prototype_map, true, isolate());
{
Handle<SharedFunctionInfo> info = SimpleCreateSharedFunctionInfo(
isolate(), Builtins::kPromiseThenFinally, factory()->empty_string(), 1);
info->set_native(true);
native_context()->set_promise_then_finally_shared_fun(*info);
}
{
Handle<SharedFunctionInfo> info = SimpleCreateSharedFunctionInfo(
isolate(), Builtins::kPromiseCatchFinally, factory()->empty_string(),
1);
info->set_native(true);
native_context()->set_promise_catch_finally_shared_fun(*info);
}
{
Handle<SharedFunctionInfo> info = SimpleCreateSharedFunctionInfo(
isolate(), Builtins::kPromiseValueThunkFinally,
factory()->empty_string(), 0);
native_context()->set_promise_value_thunk_finally_shared_fun(*info);
}
{
Handle<SharedFunctionInfo> info = SimpleCreateSharedFunctionInfo(
isolate(), Builtins::kPromiseThrowerFinally, factory()->empty_string(),
0);
native_context()->set_promise_thrower_finally_shared_fun(*info);
}
}
void Genesis::InitializeGlobal_harmony_bigint() {
Factory* factory = isolate()->factory();
Handle<JSGlobalObject> global(native_context()->global_object());
......
......@@ -235,7 +235,6 @@ DEFINE_IMPLICATION(harmony_class_fields, harmony_private_fields)
V(harmony_regexp_named_captures, "harmony regexp named captures") \
V(harmony_regexp_property, "harmony Unicode regexp property classes") \
V(harmony_function_tostring, "harmony Function.prototype.toString") \
V(harmony_promise_finally, "harmony Promise.prototype.finally") \
V(harmony_optional_catch_binding, "allow omitting binding in catch blocks") \
V(harmony_import_meta, "harmony import.meta property") \
V(harmony_bigint, "harmony arbitrary precision integers") \
......
......@@ -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-finally
Debug = debug.Debug
var exception = null;
......
......@@ -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-finally --allow-natives-syntax
// Flags: --allow-natives-syntax
assertThrows(() => Promise.prototype.finally.call(5), TypeError);
......
......@@ -45,7 +45,6 @@ FEATURE_FLAGS = {
'BigInt': '--harmony-bigint',
'regexp-named-groups': '--harmony-regexp-named-captures',
'regexp-unicode-property-escapes': '--harmony-regexp-property',
'Promise.prototype.finally': '--harmony-promise-finally',
'class-fields-public': '--harmony-public-fields',
'optional-catch-binding': '--harmony-optional-catch-binding',
'class-fields-private': '--harmony-private-fields',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment