Commit 3f96776a authored by Frank Tang's avatar Frank Tang Committed by V8 LUCI CQ

[intl] Ship Intl NumberFormat v3

Also need to change how we got the prototype of Intl.NumberFormat
and Intl.PluralRules to install function in bootstrapper.cc code to avoid assertion in JSReceiver casting.

For m106
Flag: harmony_intl_number_format_v3
https://chromestatus.com/feature/5707621009981440
Design doc:
https://docs.google.com/document/d/19jAogPBb6W4Samt8NWGZKu47iv0_KoQhBvLgQH3xvr8
and
https://docs.google.com/document/d/14zxGub6Os6nARzH6XstOZX05w2537sZo_ZSSlGjGpBM

R2T: https://groups.google.com/a/chromium.org/g/blink-dev/c/vy6rCuh3r_0/m/1Q2FHx9hBAAJ
I2S: https://groups.google.com/a/chromium.org/g/blink-dev/c/mN6o7uk2hjM/m/I6-C006lBwAJ
LGTMs from API Owners: bratell.d@gmail.com, miketaylr@chromium.org, mkwst@chromium.org

Bug: v8:10776
Change-Id: I2c11e1c53390bdc6246caf084661d82e08a4d94c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3790120
Commit-Queue: Frank Tang <ftang@chromium.org>
Reviewed-by: 's avatarAdam Klein <adamk@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82049}
parent 387dfe27
......@@ -305,9 +305,7 @@ DEFINE_BOOL(harmony_shipping, true, "enable all shipped harmony features")
V(harmony_array_grouping, "harmony array grouping")
#ifdef V8_INTL_SUPPORT
#define HARMONY_STAGED(V) \
HARMONY_STAGED_BASE(V) \
V(harmony_intl_number_format_v3, "Intl.NumberFormat v3")
#define HARMONY_STAGED(V) HARMONY_STAGED_BASE(V)
#else
#define HARMONY_STAGED(V) HARMONY_STAGED_BASE(V)
#endif
......@@ -321,7 +319,9 @@ DEFINE_BOOL(harmony_shipping, true, "enable all shipped harmony features")
V(harmony_array_find_last, "harmony array find last helpers")
#ifdef V8_INTL_SUPPORT
#define HARMONY_SHIPPING(V) HARMONY_SHIPPING_BASE(V)
#define HARMONY_SHIPPING(V) \
HARMONY_SHIPPING_BASE(V) \
V(harmony_intl_number_format_v3, "Intl.NumberFormat v3")
#else
#define HARMONY_SHIPPING(V) HARMONY_SHIPPING_BASE(V)
#endif
......
......@@ -5476,19 +5476,9 @@ void Genesis::InitializeGlobal_harmony_temporal() {
void Genesis::InitializeGlobal_harmony_intl_number_format_v3() {
if (!FLAG_harmony_intl_number_format_v3) return;
Handle<JSObject> intl = Handle<JSObject>::cast(
JSReceiver::GetProperty(
isolate(),
Handle<JSReceiver>(native_context()->global_object(), isolate()),
factory()->InternalizeUtf8String("Intl"))
.ToHandleChecked());
{
Handle<JSFunction> number_format_constructor = Handle<JSFunction>::cast(
JSReceiver::GetProperty(
isolate(), Handle<JSReceiver>(JSReceiver::cast(*intl), isolate()),
factory()->InternalizeUtf8String("NumberFormat"))
.ToHandleChecked());
Handle<JSFunction> number_format_constructor =
isolate()->intl_number_format_function();
Handle<JSObject> prototype(
JSObject::cast(number_format_constructor->prototype()), isolate());
......@@ -5500,11 +5490,8 @@ void Genesis::InitializeGlobal_harmony_intl_number_format_v3() {
false);
}
{
Handle<JSFunction> plural_rules_constructor = Handle<JSFunction>::cast(
JSReceiver::GetProperty(
isolate(), Handle<JSReceiver>(JSReceiver::cast(*intl), isolate()),
factory()->InternalizeUtf8String("PluralRules"))
.ToHandleChecked());
Handle<JSFunction> plural_rules_constructor =
isolate()->intl_plural_rules_function();
Handle<JSObject> prototype(
JSObject::cast(plural_rules_constructor->prototype()), isolate());
......
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