Commit 1b41a5fd authored by Frank Tang's avatar Frank Tang Committed by Commit Bot

Revert "[Intl] Cleans up intl-relative-time-format flag"

This reverts commit 048a3a3e.

Reason for revert: Break V8 Linux64 GC Stress 

Original change's description:
> [Intl] Cleans up intl-relative-time-format flag
> 
> Cleans up always=true intl-relative-time-format flag
> It shipped in m71 in Dec 2018.
> 
> Bug: v8:8704
> Change-Id: I52d86aea9aedf201a216a1df0773a486fbee37b9
> Reviewed-on: https://chromium-review.googlesource.com/c/1417299
> Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org>
> Commit-Queue: Frank Tang <ftang@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#58904}

TBR=jshin@chromium.org,gsathya@chromium.org,ftang@chromium.org

Change-Id: I811decf09e2e1e06323eb5a651cd921d669fc4db
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:8704
Reviewed-on: https://chromium-review.googlesource.com/c/1420359Reviewed-by: 's avatarFrank Tang <ftang@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58905}
parent 048a3a3e
...@@ -2874,7 +2874,7 @@ void Genesis::InitializeGlobal(Handle<JSGlobalObject> global_object, ...@@ -2874,7 +2874,7 @@ void Genesis::InitializeGlobal(Handle<JSGlobalObject> global_object,
SimpleInstallFunction(isolate(), intl, "getCanonicalLocales", SimpleInstallFunction(isolate(), intl, "getCanonicalLocales",
Builtins::kIntlGetCanonicalLocales, 1, false); Builtins::kIntlGetCanonicalLocales, 1, false);
{ // -- D a t e T i m e F o r m a t {
Handle<JSFunction> date_time_format_constructor = InstallFunction( Handle<JSFunction> date_time_format_constructor = InstallFunction(
isolate_, intl, "DateTimeFormat", JS_INTL_DATE_TIME_FORMAT_TYPE, isolate_, intl, "DateTimeFormat", JS_INTL_DATE_TIME_FORMAT_TYPE,
JSDateTimeFormat::kSize, 0, factory->the_hole_value(), JSDateTimeFormat::kSize, 0, factory->the_hole_value(),
...@@ -2907,7 +2907,7 @@ void Genesis::InitializeGlobal(Handle<JSGlobalObject> global_object, ...@@ -2907,7 +2907,7 @@ void Genesis::InitializeGlobal(Handle<JSGlobalObject> global_object,
Builtins::kDateTimeFormatPrototypeFormat, false); Builtins::kDateTimeFormatPrototypeFormat, false);
} }
{ // -- N u m b e r F o r m a t {
Handle<JSFunction> number_format_constructor = InstallFunction( Handle<JSFunction> number_format_constructor = InstallFunction(
isolate_, intl, "NumberFormat", JS_INTL_NUMBER_FORMAT_TYPE, isolate_, intl, "NumberFormat", JS_INTL_NUMBER_FORMAT_TYPE,
JSNumberFormat::kSize, 0, factory->the_hole_value(), JSNumberFormat::kSize, 0, factory->the_hole_value(),
...@@ -2939,7 +2939,7 @@ void Genesis::InitializeGlobal(Handle<JSGlobalObject> global_object, ...@@ -2939,7 +2939,7 @@ void Genesis::InitializeGlobal(Handle<JSGlobalObject> global_object,
Builtins::kNumberFormatPrototypeFormatNumber, false); Builtins::kNumberFormatPrototypeFormatNumber, false);
} }
{ // -- C o l l a t o r {
Handle<JSFunction> collator_constructor = InstallFunction( Handle<JSFunction> collator_constructor = InstallFunction(
isolate_, intl, "Collator", JS_INTL_COLLATOR_TYPE, JSCollator::kSize, isolate_, intl, "Collator", JS_INTL_COLLATOR_TYPE, JSCollator::kSize,
0, factory->the_hole_value(), Builtins::kCollatorConstructor); 0, factory->the_hole_value(), Builtins::kCollatorConstructor);
...@@ -2965,7 +2965,7 @@ void Genesis::InitializeGlobal(Handle<JSGlobalObject> global_object, ...@@ -2965,7 +2965,7 @@ void Genesis::InitializeGlobal(Handle<JSGlobalObject> global_object,
Builtins::kCollatorPrototypeCompare, false); Builtins::kCollatorPrototypeCompare, false);
} }
{ // -- V 8 B r e a k I t e r a t o r {
Handle<JSFunction> v8_break_iterator_constructor = InstallFunction( Handle<JSFunction> v8_break_iterator_constructor = InstallFunction(
isolate_, intl, "v8BreakIterator", JS_INTL_V8_BREAK_ITERATOR_TYPE, isolate_, intl, "v8BreakIterator", JS_INTL_V8_BREAK_ITERATOR_TYPE,
JSV8BreakIterator::kSize, 0, factory->the_hole_value(), JSV8BreakIterator::kSize, 0, factory->the_hole_value(),
...@@ -3006,7 +3006,7 @@ void Genesis::InitializeGlobal(Handle<JSGlobalObject> global_object, ...@@ -3006,7 +3006,7 @@ void Genesis::InitializeGlobal(Handle<JSGlobalObject> global_object,
Builtins::kV8BreakIteratorPrototypeBreakType, false); Builtins::kV8BreakIteratorPrototypeBreakType, false);
} }
{ // -- P l u r a l R u l e s {
Handle<JSFunction> plural_rules_constructor = InstallFunction( Handle<JSFunction> plural_rules_constructor = InstallFunction(
isolate_, intl, "PluralRules", JS_INTL_PLURAL_RULES_TYPE, isolate_, intl, "PluralRules", JS_INTL_PLURAL_RULES_TYPE,
JSPluralRules::kSize, 0, factory->the_hole_value(), JSPluralRules::kSize, 0, factory->the_hole_value(),
...@@ -3029,36 +3029,6 @@ void Genesis::InitializeGlobal(Handle<JSGlobalObject> global_object, ...@@ -3029,36 +3029,6 @@ void Genesis::InitializeGlobal(Handle<JSGlobalObject> global_object,
SimpleInstallFunction(isolate_, prototype, "select", SimpleInstallFunction(isolate_, prototype, "select",
Builtins::kPluralRulesPrototypeSelect, 1, false); Builtins::kPluralRulesPrototypeSelect, 1, false);
} }
{ // -- R e l a t i v e T i m e F o r m a t e
Handle<JSFunction> relative_time_format_fun = InstallFunction(
isolate(), intl, "RelativeTimeFormat",
JS_INTL_RELATIVE_TIME_FORMAT_TYPE, JSRelativeTimeFormat::kSize, 0,
factory->the_hole_value(), Builtins::kRelativeTimeFormatConstructor);
relative_time_format_fun->shared()->set_length(0);
relative_time_format_fun->shared()->DontAdaptArguments();
SimpleInstallFunction(
isolate(), relative_time_format_fun, "supportedLocalesOf",
Builtins::kRelativeTimeFormatSupportedLocalesOf, 1, false);
// Setup %RelativeTimeFormatPrototype%.
Handle<JSObject> prototype(
JSObject::cast(relative_time_format_fun->instance_prototype()),
isolate());
InstallToStringTag(isolate(), prototype, "Intl.RelativeTimeFormat");
SimpleInstallFunction(
isolate(), prototype, "resolvedOptions",
Builtins::kRelativeTimeFormatPrototypeResolvedOptions, 0, false);
SimpleInstallFunction(isolate(), prototype, "format",
Builtins::kRelativeTimeFormatPrototypeFormat, 2,
false);
SimpleInstallFunction(isolate(), prototype, "formatToParts",
Builtins::kRelativeTimeFormatPrototypeFormatToParts,
2, false);
}
} }
#endif // V8_INTL_SUPPORT #endif // V8_INTL_SUPPORT
...@@ -4566,6 +4536,43 @@ void Genesis::InitializeGlobal_harmony_locale() { ...@@ -4566,6 +4536,43 @@ void Genesis::InitializeGlobal_harmony_locale() {
Builtins::kLocalePrototypeNumberingSystem, true); Builtins::kLocalePrototypeNumberingSystem, true);
} }
void Genesis::InitializeGlobal_harmony_intl_relative_time_format() {
if (!FLAG_harmony_intl_relative_time_format) return;
Handle<JSObject> intl = Handle<JSObject>::cast(
JSReceiver::GetProperty(
isolate(),
Handle<JSReceiver>(native_context()->global_object(), isolate()),
factory()->InternalizeUtf8String("Intl"))
.ToHandleChecked());
Handle<JSFunction> relative_time_format_fun = InstallFunction(
isolate(), intl, "RelativeTimeFormat", JS_INTL_RELATIVE_TIME_FORMAT_TYPE,
JSRelativeTimeFormat::kSize, 0, factory()->the_hole_value(),
Builtins::kRelativeTimeFormatConstructor);
relative_time_format_fun->shared()->set_length(0);
relative_time_format_fun->shared()->DontAdaptArguments();
SimpleInstallFunction(
isolate(), relative_time_format_fun, "supportedLocalesOf",
Builtins::kRelativeTimeFormatSupportedLocalesOf, 1, false);
// Setup %RelativeTimeFormatPrototype%.
Handle<JSObject> prototype(
JSObject::cast(relative_time_format_fun->instance_prototype()),
isolate());
InstallToStringTag(isolate(), prototype, "Intl.RelativeTimeFormat");
SimpleInstallFunction(isolate(), prototype, "resolvedOptions",
Builtins::kRelativeTimeFormatPrototypeResolvedOptions,
0, false);
SimpleInstallFunction(isolate(), prototype, "format",
Builtins::kRelativeTimeFormatPrototypeFormat, 2, false);
SimpleInstallFunction(isolate(), prototype, "formatToParts",
Builtins::kRelativeTimeFormatPrototypeFormatToParts, 2,
false);
}
void Genesis::InitializeGlobal_harmony_intl_segmenter() { void Genesis::InitializeGlobal_harmony_intl_segmenter() {
if (!FLAG_harmony_intl_segmenter) return; if (!FLAG_harmony_intl_segmenter) return;
Handle<JSObject> intl = Handle<JSObject>::cast( Handle<JSObject> intl = Handle<JSObject>::cast(
......
...@@ -243,9 +243,10 @@ DEFINE_IMPLICATION(harmony_private_methods, harmony_private_fields) ...@@ -243,9 +243,10 @@ DEFINE_IMPLICATION(harmony_private_methods, harmony_private_fields)
V(harmony_await_optimization, "harmony await taking 1 tick") V(harmony_await_optimization, "harmony await taking 1 tick")
#ifdef V8_INTL_SUPPORT #ifdef V8_INTL_SUPPORT
#define HARMONY_SHIPPING(V) \ #define HARMONY_SHIPPING(V) \
HARMONY_SHIPPING_BASE(V) \ HARMONY_SHIPPING_BASE(V) \
V(harmony_intl_list_format, "Intl.ListFormat") V(harmony_intl_list_format, "Intl.ListFormat") \
V(harmony_intl_relative_time_format, "Intl.RelativeTimeFormat")
#else #else
#define HARMONY_SHIPPING(V) HARMONY_SHIPPING_BASE(V) #define HARMONY_SHIPPING(V) HARMONY_SHIPPING_BASE(V)
#endif #endif
......
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
// 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-intl-relative-time-format
var locales = ["tlh", "id", "en"]; var locales = ["tlh", "id", "en"];
var referenceRelativeTimeFormat = new Intl.RelativeTimeFormat(locales); var referenceRelativeTimeFormat = new Intl.RelativeTimeFormat(locales);
var referenceFormatted = referenceRelativeTimeFormat.format(3, "day"); var referenceFormatted = referenceRelativeTimeFormat.format(3, "day");
......
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
// 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-intl-relative-time-format
// RelativeTimeFormat constructor can't be called as function. // RelativeTimeFormat constructor can't be called as function.
assertThrows(() => Intl.RelativeTimeFormat('sr'), TypeError); assertThrows(() => Intl.RelativeTimeFormat('sr'), TypeError);
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
// 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-intl-relative-time-format --harmony-locale
// Environment Variables: LC_ALL=fr_CA // Environment Variables: LC_ALL=fr_CA
assertEquals( assertEquals(
'fr-CA', 'fr-CA',
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
// 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-intl-relative-time-format --harmony-locale
// Environment Variables: LC_ALL=pt_BR // Environment Variables: LC_ALL=pt_BR
assertEquals( assertEquals(
'pt-BR', 'pt-BR',
......
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
// 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-intl-relative-time-format
// The following test are not part of the comformance. Just some output in // The following test are not part of the comformance. Just some output in
// English to verify the format does return something reasonable for English. // English to verify the format does return something reasonable for English.
// It may be changed when we update the CLDR data. // It may be changed when we update the CLDR data.
......
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
// 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-intl-relative-time-format
// The following test are not part of the comformance. Just some output in // The following test are not part of the comformance. Just some output in
// English to verify the format does return something reasonable for English. // English to verify the format does return something reasonable for English.
// It may be changed when we update the CLDR data. // It may be changed when we update the CLDR data.
......
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
// 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-intl-relative-time-format
// Check plural w/ formatToParts // Check plural w/ formatToParts
// http://tc39.github.io/proposal-intl-relative-time/ // http://tc39.github.io/proposal-intl-relative-time/
......
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
// 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-intl-relative-time-format
// Make sure that RelativeTimeFormat exposes all required properties. Those not specified // Make sure that RelativeTimeFormat exposes all required properties. Those not specified
// should have undefined value. // should have undefined value.
// http://tc39.github.io/proposal-intl-relative-time/ // http://tc39.github.io/proposal-intl-relative-time/
......
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
// 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-intl-relative-time-format
// Make sure that RelativeTimeFormat exposes all required properties. Those not specified // Make sure that RelativeTimeFormat exposes all required properties. Those not specified
// should have undefined value. // should have undefined value.
// http://tc39.github.io/proposal-intl-relative-time/ // http://tc39.github.io/proposal-intl-relative-time/
......
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
// 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-intl-relative-time-format
// For locale default the numberingSystem to 'latn' // For locale default the numberingSystem to 'latn'
assertEquals( assertEquals(
"latn", "latn",
......
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
// 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-intl-relative-time-format
let rtf = new Intl.RelativeTimeFormat(); let rtf = new Intl.RelativeTimeFormat();
// Test 1.4.5 Intl.RelativeTimeFormat.prototype.resolvedOptions () // Test 1.4.5 Intl.RelativeTimeFormat.prototype.resolvedOptions ()
// The default style is 'long' // The default style is 'long'
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
// 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-intl-relative-time-format
assertEquals(typeof Intl.RelativeTimeFormat.supportedLocalesOf, "function", assertEquals(typeof Intl.RelativeTimeFormat.supportedLocalesOf, "function",
"Intl.RelativeTimeFormat.supportedLocalesOf should be a function"); "Intl.RelativeTimeFormat.supportedLocalesOf should be a function");
......
...@@ -53,6 +53,7 @@ FEATURE_FLAGS = { ...@@ -53,6 +53,7 @@ FEATURE_FLAGS = {
'numeric-separator-literal': '--harmony-numeric-separator', 'numeric-separator-literal': '--harmony-numeric-separator',
'Intl.ListFormat': '--harmony-intl-list-format', 'Intl.ListFormat': '--harmony-intl-list-format',
'Intl.Locale': '--harmony-locale', 'Intl.Locale': '--harmony-locale',
'Intl.RelativeTimeFormat': '--harmony-intl-relative-time-format',
'Intl.Segmenter': '--harmony-intl-segmenter', 'Intl.Segmenter': '--harmony-intl-segmenter',
'Symbol.prototype.description': '--harmony-symbol-description', 'Symbol.prototype.description': '--harmony-symbol-description',
'globalThis': '--harmony-global', 'globalThis': '--harmony-global',
......
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