Commit ea9e2c64 authored by Jungshik Shin's avatar Jungshik Shin Committed by Commit Bot

Remove flags for plural rules and number formatToParts

Intl.PluralRules and Intl.NumberFormat.prototype.formatToParts
were shipped in 6.3 and 6.4, respectively.

Remove harmony_plural_rules and harmony_number_format_to_parts.

Bug: v8:5601, v8:5244
Test: mjsunit/intl-pluralrules-select
Test: mjsunit/intl-numberformat-formattoparts
Test: test262/intl402/PluralRules/unit/harmony/intl-numberformat-formattoparts
Test: test262/intl402/NumberFormat/prototype/formatToParts/*
Cq-Include-Trybots: luci.v8.try:v8_linux_noi18n_rel_ng
Change-Id: I1752622484bf9a0a8b9d810db54fc238f4caf3f3
Reviewed-on: https://chromium-review.googlesource.com/1032260
Commit-Queue: Jungshik Shin <jshin@chromium.org>
Reviewed-by: 's avatarSathya Gunasekaran <gsathya@chromium.org>
Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52866}
parent 2747d0e6
...@@ -2748,6 +2748,14 @@ void Genesis::InitializeGlobal(Handle<JSGlobalObject> global_object, ...@@ -2748,6 +2748,14 @@ void Genesis::InitializeGlobal(Handle<JSGlobalObject> global_object,
JSObject::AddProperty( JSObject::AddProperty(
prototype, factory->to_string_tag_symbol(), factory->Object_string(), prototype, factory->to_string_tag_symbol(), factory->Object_string(),
static_cast<PropertyAttributes>(DONT_ENUM | READ_ONLY)); static_cast<PropertyAttributes>(DONT_ENUM | READ_ONLY));
Handle<String> name = factory->InternalizeUtf8String("formatToParts");
InstallFunction(
prototype,
SimpleCreateFunction(isolate, name,
Builtins::kNumberFormatPrototypeFormatToParts, 1,
false),
name);
} }
{ {
...@@ -2780,6 +2788,22 @@ void Genesis::InitializeGlobal(Handle<JSGlobalObject> global_object, ...@@ -2780,6 +2788,22 @@ void Genesis::InitializeGlobal(Handle<JSGlobalObject> global_object,
prototype, factory->to_string_tag_symbol(), factory->Object_string(), prototype, factory->to_string_tag_symbol(), factory->Object_string(),
static_cast<PropertyAttributes>(DONT_ENUM | READ_ONLY)); static_cast<PropertyAttributes>(DONT_ENUM | READ_ONLY));
} }
{
Handle<JSFunction> plural_rules_constructor = InstallFunction(
intl, "PluralRules", JS_OBJECT_TYPE, PluralRules::kSize, 0,
factory->the_hole_value(), Builtins::kIllegal);
native_context()->set_intl_plural_rules_function(
*plural_rules_constructor);
Handle<JSObject> prototype(
JSObject::cast(plural_rules_constructor->prototype()), isolate);
// Install the @@toStringTag property on the {prototype}.
JSObject::AddProperty(
prototype, factory->to_string_tag_symbol(), factory->Object_string(),
static_cast<PropertyAttributes>(DONT_ENUM | READ_ONLY));
}
} }
#endif // V8_INTL_SUPPORT #endif // V8_INTL_SUPPORT
...@@ -4075,24 +4099,6 @@ void Bootstrapper::ExportFromRuntime(Isolate* isolate, ...@@ -4075,24 +4099,6 @@ void Bootstrapper::ExportFromRuntime(Isolate* isolate,
} }
} }
} }
#ifdef V8_INTL_SUPPORT
{ // I n t l P l u r a l R u l e s
Handle<JSObject> plural_rules_prototype =
factory->NewJSObject(isolate->object_function(), TENURED);
// Install the @@toStringTag property on the {prototype}.
JSObject::AddProperty(
plural_rules_prototype, factory->to_string_tag_symbol(),
factory->Object_string(),
static_cast<PropertyAttributes>(DONT_ENUM | READ_ONLY));
Handle<JSFunction> plural_rules_constructor = InstallFunction(
container, "PluralRules", JS_OBJECT_TYPE, PluralRules::kSize, 0,
plural_rules_prototype, Builtins::kIllegal);
JSObject::AddProperty(plural_rules_prototype, factory->constructor_string(),
plural_rules_constructor, DONT_ENUM);
native_context->set_intl_plural_rules_function(*plural_rules_constructor);
}
#endif // V8_INTL_SUPPORT
} }
...@@ -4387,36 +4393,6 @@ void Genesis::InitializeGlobal_harmony_bigint() { ...@@ -4387,36 +4393,6 @@ void Genesis::InitializeGlobal_harmony_bigint() {
Builtins::kDataViewPrototypeSetBigUint64, 2, false); Builtins::kDataViewPrototypeSetBigUint64, 2, false);
} }
#ifdef V8_INTL_SUPPORT
void Genesis::InitializeGlobal_harmony_number_format_to_parts() {
if (!FLAG_harmony_number_format_to_parts) return;
Handle<JSObject> number_format_prototype(JSObject::cast(
native_context()->intl_number_format_function()->prototype()));
Handle<String> name = factory()->InternalizeUtf8String("formatToParts");
InstallFunction(number_format_prototype,
SimpleCreateFunction(
isolate(), name,
Builtins::kNumberFormatPrototypeFormatToParts, 1, false),
name);
}
void Genesis::InitializeGlobal_harmony_plural_rules() {
if (!FLAG_harmony_plural_rules) return;
Handle<JSFunction> plural_rules(
native_context()->intl_plural_rules_function());
Handle<JSObject> intl = Handle<JSObject>::cast(
JSReceiver::GetProperty(
Handle<JSReceiver>(native_context()->global_object()),
factory()->InternalizeUtf8String("Intl"))
.ToHandleChecked());
JSObject::AddProperty(intl, factory()->InternalizeUtf8String("PluralRules"),
plural_rules, DONT_ENUM);
}
#endif // V8_INTL_SUPPORT
Handle<JSFunction> Genesis::CreateArrayBuffer( Handle<JSFunction> Genesis::CreateArrayBuffer(
Handle<String> name, ArrayBufferKind array_buffer_kind) { Handle<String> name, ArrayBufferKind array_buffer_kind) {
// Create the %ArrayBufferPrototype% // Create the %ArrayBufferPrototype%
......
...@@ -226,7 +226,7 @@ DEFINE_IMPLICATION(harmony_class_fields, harmony_private_fields) ...@@ -226,7 +226,7 @@ DEFINE_IMPLICATION(harmony_class_fields, harmony_private_fields)
V(harmony_numeric_separator, "harmony numeric separator between digits") V(harmony_numeric_separator, "harmony numeric separator between digits")
// Features that are shipping (turned on by default, but internal flag remains). // Features that are shipping (turned on by default, but internal flag remains).
#define HARMONY_SHIPPING_BASE(V) \ #define HARMONY_SHIPPING(V) \
V(harmony_subsume_json, "harmony subsume JSON") \ V(harmony_subsume_json, "harmony subsume JSON") \
V(harmony_string_trimming, "harmony String.prototype.trim{Start,End}") \ V(harmony_string_trimming, "harmony String.prototype.trim{Start,End}") \
V(harmony_sharedarraybuffer, "harmony sharedarraybuffer") \ V(harmony_sharedarraybuffer, "harmony sharedarraybuffer") \
...@@ -239,16 +239,6 @@ DEFINE_IMPLICATION(harmony_class_fields, harmony_private_fields) ...@@ -239,16 +239,6 @@ DEFINE_IMPLICATION(harmony_class_fields, harmony_private_fields)
V(harmony_bigint, "harmony arbitrary precision integers") \ V(harmony_bigint, "harmony arbitrary precision integers") \
V(harmony_dynamic_import, "harmony dynamic import") V(harmony_dynamic_import, "harmony dynamic import")
#ifdef V8_INTL_SUPPORT
#define HARMONY_SHIPPING(V) \
HARMONY_SHIPPING_BASE(V) \
V(harmony_number_format_to_parts, \
"Intl.NumberFormat.prototype.formatToParts") \
V(harmony_plural_rules, "Intl.PluralRules")
#else
#define HARMONY_SHIPPING(V) HARMONY_SHIPPING_BASE(V)
#endif
// Once a shipping feature has proved stable in the wild, it will be dropped // Once a shipping feature has proved stable in the wild, it will be dropped
// from HARMONY_SHIPPING, all occurrences of the FLAG_ variable are removed, // from HARMONY_SHIPPING, all occurrences of the FLAG_ variable are removed,
// and associated tests are moved from the harmony directory to the appropriate // and associated tests are moved from the harmony directory to the appropriate
......
...@@ -24,7 +24,7 @@ var GlobalIntl = global.Intl; ...@@ -24,7 +24,7 @@ var GlobalIntl = global.Intl;
var GlobalIntlDateTimeFormat = GlobalIntl.DateTimeFormat; var GlobalIntlDateTimeFormat = GlobalIntl.DateTimeFormat;
var GlobalIntlNumberFormat = GlobalIntl.NumberFormat; var GlobalIntlNumberFormat = GlobalIntl.NumberFormat;
var GlobalIntlCollator = GlobalIntl.Collator; var GlobalIntlCollator = GlobalIntl.Collator;
var GlobalIntlPluralRules = utils.ImportNow("PluralRules"); var GlobalIntlPluralRules = GlobalIntl.PluralRules;
var GlobalIntlv8BreakIterator = GlobalIntl.v8BreakIterator; var GlobalIntlv8BreakIterator = GlobalIntl.v8BreakIterator;
var GlobalNumber = global.Number; var GlobalNumber = global.Number;
var GlobalRegExp = global.RegExp; var GlobalRegExp = global.RegExp;
......
...@@ -2,8 +2,6 @@ ...@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
// Flags: --harmony-number-format-to-parts
// Adapted from Gecko's js/src/tests/Intl/NumberFormat/formatToParts.js, // Adapted from Gecko's js/src/tests/Intl/NumberFormat/formatToParts.js,
// which was dedicated to the public domain. // which was dedicated to the public domain.
......
...@@ -2,8 +2,6 @@ ...@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
// Flags: --harmony-plural-rules
if (this.Intl) { if (this.Intl) {
var pr; var pr;
var suffixes; var suffixes;
......
...@@ -338,9 +338,6 @@ ...@@ -338,9 +338,6 @@
'language/expressions/object/method-definition/name-param-redecl': [FAIL], 'language/expressions/object/method-definition/name-param-redecl': [FAIL],
'language/statements/async-function/early-errors-declaration-formals-body-duplicate': [FAIL], 'language/statements/async-function/early-errors-declaration-formals-body-duplicate': [FAIL],
# https://bugs.chromium.org/p/v8/issues/detail?id=5601
'intl402/PluralRules/*': ['--harmony-plural-rules'],
# SharedArrayBuffer tests that require flags # SharedArrayBuffer tests that require flags
'built-ins/SharedArrayBuffer/*': ['--harmony-sharedarraybuffer'], 'built-ins/SharedArrayBuffer/*': ['--harmony-sharedarraybuffer'],
'built-ins/Atomics/*': ['--harmony-sharedarraybuffer'], 'built-ins/Atomics/*': ['--harmony-sharedarraybuffer'],
......
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