Title: [281383] trunk
Revision
281383
Author
ysuz...@apple.com
Date
2021-08-21 17:26:53 -0700 (Sat, 21 Aug 2021)

Log Message

[JSC] Remove Intl runtime feature flags for already shipped ones
https://bugs.webkit.org/show_bug.cgi?id=229371

Reviewed by Ross Kirsling.

JSTests:

* stress/intl-datetimeformat-day-period.js:
* test262/config.yaml:

Source/_javascript_Core:

Since they are already shipped, we should remove these runtime flags.

* builtins/DatePrototype.js:
(globalPrivate.toDateTimeOptionsAnyAll):
(globalPrivate.toDateTimeOptionsTimeTime):
* bytecode/BytecodeIntrinsicRegistry.cpp:
(JSC::BytecodeIntrinsicRegistry::BytecodeIntrinsicRegistry):
* bytecode/BytecodeIntrinsicRegistry.h:
* runtime/IntlDateTimeFormat.cpp:
(JSC::toDateTimeOptionsAnyDate):
(JSC::IntlDateTimeFormat::initializeDateTimeFormat):
(JSC::IntlDateTimeFormat::resolvedOptions const):
* runtime/IntlDateTimeFormatPrototype.cpp:
(JSC::IntlDateTimeFormatPrototype::finishCreation):
* runtime/OptionsList.h:

Modified Paths

Diff

Modified: trunk/JSTests/ChangeLog (281382 => 281383)


--- trunk/JSTests/ChangeLog	2021-08-21 23:01:13 UTC (rev 281382)
+++ trunk/JSTests/ChangeLog	2021-08-22 00:26:53 UTC (rev 281383)
@@ -1,5 +1,15 @@
 2021-08-21  Yusuke Suzuki  <ysuz...@apple.com>
 
+        [JSC] Remove Intl runtime feature flags for already shipped ones
+        https://bugs.webkit.org/show_bug.cgi?id=229371
+
+        Reviewed by Ross Kirsling.
+
+        * stress/intl-datetimeformat-day-period.js:
+        * test262/config.yaml:
+
+2021-08-21  Yusuke Suzuki  <ysuz...@apple.com>
+
         [JSC] Intl.DisplayNames v2
         https://bugs.webkit.org/show_bug.cgi?id=227832
 

Modified: trunk/JSTests/stress/intl-datetimeformat-day-period.js (281382 => 281383)


--- trunk/JSTests/stress/intl-datetimeformat-day-period.js	2021-08-21 23:01:13 UTC (rev 281382)
+++ trunk/JSTests/stress/intl-datetimeformat-day-period.js	2021-08-22 00:26:53 UTC (rev 281383)
@@ -1,5 +1,3 @@
-//@ runDefault("--useIntlDateTimeFormatDayPeriod=1")
-
 function shouldBe(actual, expected) {
     if (actual !== expected)
         throw new Error(`expected ${expected} but got ${actual}`);

Modified: trunk/JSTests/test262/config.yaml (281382 => 281383)


--- trunk/JSTests/test262/config.yaml	2021-08-21 23:01:13 UTC (rev 281382)
+++ trunk/JSTests/test262/config.yaml	2021-08-22 00:26:53 UTC (rev 281383)
@@ -10,7 +10,6 @@
   class-static-fields-private: usePrivateStaticClassFields
   class-static-methods-private: usePrivateMethods
   error-cause: useErrorCause
-  Intl.DateTimeFormat-dayPeriod: useIntlDateTimeFormatDayPeriod
   SharedArrayBuffer: useSharedArrayBuffer
   Atomics: useSharedArrayBuffer
   Array.prototype.at: useAtMethod

Modified: trunk/Source/_javascript_Core/ChangeLog (281382 => 281383)


--- trunk/Source/_javascript_Core/ChangeLog	2021-08-21 23:01:13 UTC (rev 281382)
+++ trunk/Source/_javascript_Core/ChangeLog	2021-08-22 00:26:53 UTC (rev 281383)
@@ -1,5 +1,28 @@
 2021-08-21  Yusuke Suzuki  <ysuz...@apple.com>
 
+        [JSC] Remove Intl runtime feature flags for already shipped ones
+        https://bugs.webkit.org/show_bug.cgi?id=229371
+
+        Reviewed by Ross Kirsling.
+
+        Since they are already shipped, we should remove these runtime flags.
+
+        * builtins/DatePrototype.js:
+        (globalPrivate.toDateTimeOptionsAnyAll):
+        (globalPrivate.toDateTimeOptionsTimeTime):
+        * bytecode/BytecodeIntrinsicRegistry.cpp:
+        (JSC::BytecodeIntrinsicRegistry::BytecodeIntrinsicRegistry):
+        * bytecode/BytecodeIntrinsicRegistry.h:
+        * runtime/IntlDateTimeFormat.cpp:
+        (JSC::toDateTimeOptionsAnyDate):
+        (JSC::IntlDateTimeFormat::initializeDateTimeFormat):
+        (JSC::IntlDateTimeFormat::resolvedOptions const):
+        * runtime/IntlDateTimeFormatPrototype.cpp:
+        (JSC::IntlDateTimeFormatPrototype::finishCreation):
+        * runtime/OptionsList.h:
+
+2021-08-21  Yusuke Suzuki  <ysuz...@apple.com>
+
         [JSC] Intl.DisplayNames v2
         https://bugs.webkit.org/show_bug.cgi?id=227832
 

Modified: trunk/Source/_javascript_Core/builtins/DatePrototype.js (281382 => 281383)


--- trunk/Source/_javascript_Core/builtins/DatePrototype.js	2021-08-21 23:01:13 UTC (rev 281382)
+++ trunk/Source/_javascript_Core/builtins/DatePrototype.js	2021-08-22 00:26:53 UTC (rev 281383)
@@ -45,7 +45,7 @@
         options.year === @undefined &&
         options.month === @undefined &&
         options.day === @undefined &&
-        (!@useIntlDateTimeFormatDayPeriod || options.dayPeriod === @undefined) &&
+        options.dayPeriod === @undefined &&
         options.hour === @undefined &&
         options.minute === @undefined &&
         options.second === @undefined &&
@@ -168,7 +168,7 @@
 
     // Check original instead of descendant to reduce lookups up the prototype chain.
     var needsDefaults = !options || (
-        (!@useIntlDateTimeFormatDayPeriod || options.dayPeriod === @undefined) &&
+        options.dayPeriod === @undefined &&
         options.hour === @undefined &&
         options.minute === @undefined &&
         options.second === @undefined &&

Modified: trunk/Source/_javascript_Core/bytecode/BytecodeIntrinsicRegistry.cpp (281382 => 281383)


--- trunk/Source/_javascript_Core/bytecode/BytecodeIntrinsicRegistry.cpp	2021-08-21 23:01:13 UTC (rev 281382)
+++ trunk/Source/_javascript_Core/bytecode/BytecodeIntrinsicRegistry.cpp	2021-08-22 00:26:53 UTC (rev 281383)
@@ -112,7 +112,6 @@
     m_AsyncGeneratorSuspendReasonYield.set(m_vm, jsNumber(static_cast<int32_t>(JSAsyncGenerator::AsyncGeneratorSuspendReason::Yield)));
     m_AsyncGeneratorSuspendReasonAwait.set(m_vm, jsNumber(static_cast<int32_t>(JSAsyncGenerator::AsyncGeneratorSuspendReason::Await)));
     m_AsyncGeneratorSuspendReasonNone.set(m_vm, jsNumber(static_cast<int32_t>(JSAsyncGenerator::AsyncGeneratorSuspendReason::None)));
-    m_useIntlDateTimeFormatDayPeriod.set(m_vm, jsBoolean(Options::useIntlDateTimeFormatDayPeriod()));
     m_abstractModuleRecordFieldState.set(m_vm, jsNumber(static_cast<int32_t>(AbstractModuleRecord::Field::State)));
 }
 

Modified: trunk/Source/_javascript_Core/bytecode/BytecodeIntrinsicRegistry.h (281382 => 281383)


--- trunk/Source/_javascript_Core/bytecode/BytecodeIntrinsicRegistry.h	2021-08-21 23:01:13 UTC (rev 281382)
+++ trunk/Source/_javascript_Core/bytecode/BytecodeIntrinsicRegistry.h	2021-08-22 00:26:53 UTC (rev 281383)
@@ -153,7 +153,6 @@
     macro(AsyncGeneratorSuspendReasonYield) \
     macro(AsyncGeneratorSuspendReasonAwait) \
     macro(AsyncGeneratorSuspendReasonNone) \
-    macro(useIntlDateTimeFormatDayPeriod) \
     macro(abstractModuleRecordFieldState) \
 
 #define JSC_COMMON_BYTECODE_INTRINSIC_CONSTANTS_CUSTOM_EACH_NAME(macro) \

Modified: trunk/Source/_javascript_Core/runtime/IntlDateTimeFormat.cpp (281382 => 281383)


--- trunk/Source/_javascript_Core/runtime/IntlDateTimeFormat.cpp	2021-08-21 23:01:13 UTC (rev 281382)
+++ trunk/Source/_javascript_Core/runtime/IntlDateTimeFormat.cpp	2021-08-22 00:26:53 UTC (rev 281383)
@@ -245,12 +245,10 @@
     // ii. Let value be Get(options, prop).
     // iii. ReturnIfAbrupt(value).
     // iv. If value is not undefined, then let needDefaults be false.
-    if (Options::useIntlDateTimeFormatDayPeriod()) {
-        JSValue dayPeriod = options->get(globalObject, vm.propertyNames->dayPeriod);
-        RETURN_IF_EXCEPTION(scope, { });
-        if (!dayPeriod.isUndefined())
-            needDefaults = false;
-    }
+    JSValue dayPeriod = options->get(globalObject, vm.propertyNames->dayPeriod);
+    RETURN_IF_EXCEPTION(scope, { });
+    if (!dayPeriod.isUndefined())
+        needDefaults = false;
 
     JSValue hour = options->get(globalObject, vm.propertyNames->hour);
     RETURN_IF_EXCEPTION(scope, { });
@@ -691,11 +689,8 @@
         break;
     }
 
-    DayPeriod dayPeriod = DayPeriod::None;
-    if (Options::useIntlDateTimeFormatDayPeriod()) {
-        dayPeriod = intlOption<DayPeriod>(globalObject, options, vm.propertyNames->dayPeriod, { { "narrow"_s, DayPeriod::Narrow }, { "short"_s, DayPeriod::Short }, { "long"_s, DayPeriod::Long } }, "dayPeriod must be \"narrow\", \"short\", or \"long\""_s, DayPeriod::None);
-        RETURN_IF_EXCEPTION(scope, void());
-    }
+    DayPeriod dayPeriod = intlOption<DayPeriod>(globalObject, options, vm.propertyNames->dayPeriod, { { "narrow"_s, DayPeriod::Narrow }, { "short"_s, DayPeriod::Short }, { "long"_s, DayPeriod::Long } }, "dayPeriod must be \"narrow\", \"short\", or \"long\""_s, DayPeriod::None);
+    RETURN_IF_EXCEPTION(scope, void());
 
     Hour hour = intlOption<Hour>(globalObject, options, vm.propertyNames->hour, { { "2-digit"_s, Hour::TwoDigit }, { "numeric"_s, Hour::Numeric } }, "hour must be \"2-digit\" or \"numeric\""_s, Hour::None);
     RETURN_IF_EXCEPTION(scope, void());
@@ -746,22 +741,20 @@
         }
     }
 
-    if (Options::useIntlDateTimeFormatDayPeriod()) {
-        // dayPeriod must be set after setting hour.
-        // https://unicode-org.atlassian.net/browse/ICU-20731
-        switch (dayPeriod) {
-        case DayPeriod::Narrow:
-            skeletonBuilder.append("BBBBB");
-            break;
-        case DayPeriod::Short:
-            skeletonBuilder.append('B');
-            break;
-        case DayPeriod::Long:
-            skeletonBuilder.append("BBBB");
-            break;
-        case DayPeriod::None:
-            break;
-        }
+    // dayPeriod must be set after setting hour.
+    // https://unicode-org.atlassian.net/browse/ICU-20731
+    switch (dayPeriod) {
+    case DayPeriod::Narrow:
+        skeletonBuilder.append("BBBBB");
+        break;
+    case DayPeriod::Short:
+        skeletonBuilder.append('B');
+        break;
+    case DayPeriod::Long:
+        skeletonBuilder.append("BBBB");
+        break;
+    case DayPeriod::None:
+        break;
     }
 
     Minute minute = intlOption<Minute>(globalObject, options, vm.propertyNames->minute, { { "2-digit"_s, Minute::TwoDigit }, { "numeric"_s, Minute::Numeric } }, "minute must be \"2-digit\" or \"numeric\""_s, Minute::None);
@@ -1184,10 +1177,8 @@
     if (m_day != Day::None)
         options->putDirect(vm, vm.propertyNames->day, jsNontrivialString(vm, dayString(m_day)));
 
-    if (Options::useIntlDateTimeFormatDayPeriod()) {
-        if (m_dayPeriod != DayPeriod::None)
-            options->putDirect(vm, vm.propertyNames->dayPeriod, jsNontrivialString(vm, dayPeriodString(m_dayPeriod)));
-    }
+    if (m_dayPeriod != DayPeriod::None)
+        options->putDirect(vm, vm.propertyNames->dayPeriod, jsNontrivialString(vm, dayPeriodString(m_dayPeriod)));
 
     if (m_hour != Hour::None)
         options->putDirect(vm, vm.propertyNames->hour, jsNontrivialString(vm, hourString(m_hour)));

Modified: trunk/Source/_javascript_Core/runtime/IntlDateTimeFormatPrototype.cpp (281382 => 281383)


--- trunk/Source/_javascript_Core/runtime/IntlDateTimeFormatPrototype.cpp	2021-08-21 23:01:13 UTC (rev 281382)
+++ trunk/Source/_javascript_Core/runtime/IntlDateTimeFormatPrototype.cpp	2021-08-22 00:26:53 UTC (rev 281383)
@@ -82,8 +82,7 @@
     Base::finishCreation(vm);
     ASSERT(inherits(vm, info()));
 #if HAVE(ICU_U_DATE_INTERVAL_FORMAT_FORMAT_RANGE_TO_PARTS)
-    if (Options::useIntlDateTimeFormatRangeToParts())
-        JSC_NATIVE_FUNCTION_WITHOUT_TRANSITION("formatRangeToParts", IntlDateTimeFormatPrototypeFuncFormatRangeToParts, static_cast<unsigned>(PropertyAttribute::DontEnum), 2);
+    JSC_NATIVE_FUNCTION_WITHOUT_TRANSITION("formatRangeToParts", IntlDateTimeFormatPrototypeFuncFormatRangeToParts, static_cast<unsigned>(PropertyAttribute::DontEnum), 2);
 #else
     UNUSED_PARAM(globalObject);
     UNUSED_PARAM(&IntlDateTimeFormatPrototypeFuncFormatRangeToParts);

Modified: trunk/Source/_javascript_Core/runtime/OptionsList.h (281382 => 281383)


--- trunk/Source/_javascript_Core/runtime/OptionsList.h	2021-08-21 23:01:13 UTC (rev 281382)
+++ trunk/Source/_javascript_Core/runtime/OptionsList.h	2021-08-22 00:26:53 UTC (rev 281383)
@@ -542,8 +542,6 @@
     v(Bool, useWebAssemblyMultiValues, true, Normal, "Allow types from the wasm mulit-values spec.") \
     v(Bool, useWebAssemblyThreading, true, Normal, "Allow instructions from the wasm threading spec.") \
     v(Bool, useWeakRefs, true, Normal, "Expose the WeakRef constructor.") \
-    v(Bool, useIntlDateTimeFormatDayPeriod, true, Normal, "Expose the Intl.DateTimeFormat dayPeriod feature.") \
-    v(Bool, useIntlDateTimeFormatRangeToParts, true, Normal, "Expose the Intl.DateTimeFormat#formatRangeToParts feature.") \
     v(Bool, useAtMethod, true, Normal, "Expose the at() method on Array, %TypedArray%, and String.") \
     v(Bool, useErrorCause, true, Normal, "Allow a cause to be provided when constructing an Error, _NativeError_, or AggregateError.") \
     v(Bool, useSharedArrayBuffer, false, Normal, nullptr) \
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to