Commit Graph

408 Commits

Author SHA1 Message Date
Frank Tang
dfab3f44e8 [intl] Part 2 of NumberFormat v3
Change NumberFormat.prototpe.resolvedOptions to return new options in v3.
Also fix a heap allocation assertion bug in GetStringOrBooleanOption
while the useGrouping option is an invalid argument.

https://github.com/tc39/proposal-intl-numberformat-v3

https://chromestatus.com/guide/edit/5707621009981440

Design Doc: https://docs.google.com/document/d/19jAogPBb6W4Samt8NWGZKu47iv0_KoQhBvLgQH3xvr8/edit

Bug: v8:10776
Change-Id: Iaeeb0398b77394db3c941a2706d44b734a1f9d8c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3427298
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79161}
2022-02-18 08:47:59 +00:00
Michael Achenbach
9e9d9142d6 [infra] Testrunner fixes for Python3 compatibility
Using UTF-8 encoding couldn't properly read:
test/webkit/parser-high-byte-character.js

Fix itertools rename and one usage of map that's now an iterator.

Bug: chromium:1292016
Cq-Include-Trybots: luci.v8.try.triggered:v8_linux64_python3_rel_ng_triggered
Change-Id: I2b2ab72ce0eb355d1e70f247b5ea38d1d71c7845
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3439914
Reviewed-by: Liviu Rau <liviurau@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78957}
2022-02-04 17:58:05 +00:00
Frank Tang
250b2e2972 [Intl] Part 1 of NumberFormat v3
Implement ALL in NumberFormat v3 except:
* Add PluralRules.prototype.selectRange
* Add NumberFormat.prototype.formatRange(ToParts)?
(which will be reviewed in later CLs)
* Change NumberFormat.prototpe.resolvedOptions

https://github.com/tc39/proposal-intl-numberformat-v3

https://chromestatus.com/guide/edit/5707621009981440

Design Doc: https://docs.google.com/document/d/19jAogPBb6W4Samt8NWGZKu47iv0_KoQhBvLgQH3xvr8/edit

Bug: v8:10776
Change-Id: I1acf833ec25fb05437cb0b21c5510bb99d1c4583
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3405649
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78878}
2022-02-01 02:19:48 +00:00
Jochen Eisinger
d4dd9cd68b Reassign some old TODOs to folks currently working on the respective code
Change-Id: I8fd11742c4ea13cfd5cd3864e167785b97f1383a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3404274
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Commit-Queue: Jochen Eisinger <jochen@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78695}
2022-01-20 10:44:39 +00:00
Frank Tang
2b352df062 [intl] Update Intl.Locale.weekInfo sync latest
Implement the changes in
https://github.com/tc39/proposal-intl-locale-info/pull/44
So weekInfo will return weekend as an array instead of weekendStart
and weekendEnd.

Bug: v8:11638
Change-Id: I775b003b36f67179943911faa7f77a323ad9f6f1
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3307685
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78172}
2021-11-30 23:17:28 +00:00
Jakob Gruber
dadd34d9ef [intl] Fix two issues in the localeCompare fast path
1. The default locale may be reset / is not immutable as we thought.
2. A suffix of ignorable code points after the common length affects
   the comparison result.

Bug: v8:12196
Fixed: v8:12398
Change-Id: I6f60f56352956779df801c43de6ebac8cd9c592d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3291314
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Auto-Submit: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78053}
2021-11-24 08:28:39 +00:00
Frank Tang
bd4fa32c87 [intl] Clean up
Remove two flags for feature shipped in m95
--harmony_intl_displaynames_v2
--harmony_intl_more_timezone

Bug: v8:11637, v8:11661
Change-Id: I9432865722664f64c64b5bf7fde5e05e6b324b20
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3292518
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78005}
2021-11-20 03:53:26 +00:00
Tobias Tebbi
6181ce59fc [builtins] add Torque fast-path for String.prototype.localeCompare
This fast path works for ASCII-only strings and is similar to the
existing fast-path in C++. Important differences:
- The locale check is done at Turbofan optimization time instead of
  at runtime
- Use tables of size 256 instead of 128 to save a bounds-check when
  handling one-byte strings.
- It first performs an equality check that's optimized for detecting
  inequality quickly by comparing the strings from both ends. If the
  equality check succeeds, we are done. Otherwise chances are high
  that the strings differ according to collation level L1 already.
  Therefore, we first do an L1 check and perform the L3 check
  only when L1 didn't find a difference. This is based on the assumption
  that few strings are identical except for different capitalization.
- Use the Torque version of string flattening instead of the runtime
  version.

Bug: v8:12196
Change-Id: I2d043c1138846783f6d567b736d34063ba9301e5
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3268465
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77946}
2021-11-17 12:55:13 +00:00
Frank Tang
b9a48232b7 [Intl] Update ICU to 70-1 on v8
Diary  https://docs.google.com/document/d/1NqMw7DAVFCZRx67auC7sgOvrikHvCYuaB87JUf21yG8/edit#
eedbaf76..3e05d9da

chromium roll in https://chromium-review.googlesource.com/c/chromium/src/+/3224333

Bug: chromium:1260116
Change-Id: Ie1922a129310106985f3bf1bffd9101fce6bb73a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3237532
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77868}
2021-11-12 11:35:09 +00:00
Frank Tang
63344e8d0b Roll ICU and correct timezone test
Bug: v8:12301
Change-Id: Ia87943478c1b67c077a18785668c485c404cd5dd
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3235814
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77505}
2021-10-21 18:39:31 +00:00
Jakob Gruber
6fbb8bc806 [intl] A fast path for Intl::CompareStrings
Certain collators and subject strings may take this new fast
path without calling into the (slow) ICU comparison functions.

This CL can be roughly split into three topics:
1. The fast path check, precomputed and implemented as a whitelist
   on the current locale string.
2. The actual fast path, which checks subject string eligibility
   and performs L1 and L3 collation weight comparisons all in one pass.
3. Resuming from an aborted fast-path into the generic path.

A longer overview is available at
https://docs.google.com/document/d/1oyDwjYn2JyHsx2YnJJKhjX0WMNQXb8ao86-DRzqiYNg/edit?usp=sharing

JetStream2/cdjs scores improve by roughly 40%.

Bug: v8:12196
Change-Id: I5e1bbd731a36c361af9667f9104d6fa15c42e117
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3149463
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77284}
2021-10-07 12:35:29 +00:00
Camillo Bruni
88893c9e3d [mjsunit] Fix intl test when LC_MESSAGES is set
This test regularly fails due to my local language setting.

Change-Id: Ic4719ffbe49a8fc9d38d75b05b52ac550315a405
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3114138
Reviewed-by: Patrick Thier <pthier@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#76448}
2021-08-24 10:10:12 +00:00
Jakob Kummerow
78e3e7ae80 [test] Drop slow intl/regress-12059 test
In this particular case, a comment in the code provides sufficient
protection against regressions.

No-Try: true
Fixed: v8:12087
Change-Id: If9cad800bcc822b7b5ab91669ccda8b4314009f7
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3098185
Auto-Submit: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#76320}
2021-08-16 16:16:30 +00:00
Frank Tang
266bd5743f [intl] Implement Intl Enumeration API
flag --harmony_intl_enumeration

I2P: https://groups.google.com/a/chromium.org/g/blink-dev/c/Txtf_rSqGH8/m/e27FY33JAQAJ
Design Doc: https://docs.google.com/document/d/1lbj_YVW-xhzYNMQeHB-qDjVkf4SA-eTHYpYXx3Oaud8
https://chromestatus.com/guide/edit/5649454590853120


Bug: v8:10743
Change-Id: I3bfe0c25b50eb55025498534eba975a20723bd2f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2953519
Commit-Queue: Frank Tang <ftang@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#76265}
2021-08-12 18:00:54 +00:00
Frank Tang
19996d6de5 [intl] Change JSLocale::Is38AlphaNumList
Move from recusion to loop to avoid stack overflow

Bug: v8:12059
Change-Id: I44981f4271495adf00d7697114663f966b8f9f11
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3087937
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#76252}
2021-08-12 09:40:18 +00:00
Frank Tang
2273f34116 [Intl] throw instead of DCHECK while long locale
This is a temp fix to throw instead of DCHECK in debug build.
The correct fix depends on the landing of
https://github.com/unicode-org/icu/pull/1762

Once that land I will cherrypick into chrome to fix the function correctly.
But the current (before this CL) behavior is not harmful in release build.
It basically does not do the max nor min just return itself.

Bug: chromium:1224869
Change-Id: Iebce2ab0a5ce047e83e8fce05db8290212e64509
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3017300
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#76047}
2021-08-03 07:33:29 +00:00
Nico Hartmann
8224f4f5d5 [intl] Skip intl test on Android
Bug: v8:11922
Change-Id: I9836b9ab2b8667b2c08f9525a386566117d95598
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2982606
Auto-Submit: Nico Hartmann <nicohartmann@chromium.org>
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Commit-Queue: Maya Lekova <mslekova@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75363}
2021-06-24 13:15:53 +00:00
Frank Tang
91d5cc2fa9 Reland "[intl] Improve test coverage of "best fit" localeMatcher"
This is a reland of dd8845cd74

Original change's description:
> [intl] Improve test coverage of "best fit" localeMatcher
>
> https: //docs.google.com/document/d/1cPGfiihn76yj2iAomKcspPFyLLcnk3WkCiqceBQPQyk/edit#heading=h.cc9tt7s0iwsd
> Bug: v8:7051
> Change-Id: I8c35e859062c5bdb009334dd1b725751e6df2123
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2965481
> Reviewed-by: Shu-yu Guo <syg@chromium.org>
> Commit-Queue: Frank Tang <ftang@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#75228}

Bug: v8:7051
Change-Id: I9af13b8fdf7ec3de2ac24050074d13fcdef981c7
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2973648
Reviewed-by: Frank Tang <ftang@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75280}
2021-06-21 17:37:31 +00:00
Frank Tang
0f24696c71 Revert "[intl] Improve test coverage of "best fit" localeMatcher"
This reverts commit dd8845cd74.

Reason for revert: Performance regression

Original change's description:
> [intl] Improve test coverage of "best fit" localeMatcher
>
> https: //docs.google.com/document/d/1cPGfiihn76yj2iAomKcspPFyLLcnk3WkCiqceBQPQyk/edit#heading=h.cc9tt7s0iwsd
> Bug: v8:7051
> Change-Id: I8c35e859062c5bdb009334dd1b725751e6df2123
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2965481
> Reviewed-by: Shu-yu Guo <syg@chromium.org>
> Commit-Queue: Frank Tang <ftang@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#75228}

Bug: v8:7051
Change-Id: I4cf9484d727291ebc2868e3594ab1f18b19bec6b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2973227
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Frank Tang <ftang@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75262}
2021-06-18 21:27:21 +00:00
Frank Tang
dd8845cd74 [intl] Improve test coverage of "best fit" localeMatcher
https: //docs.google.com/document/d/1cPGfiihn76yj2iAomKcspPFyLLcnk3WkCiqceBQPQyk/edit#heading=h.cc9tt7s0iwsd
Bug: v8:7051
Change-Id: I8c35e859062c5bdb009334dd1b725751e6df2123
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2965481
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75228}
2021-06-18 03:04:32 +00:00
Frank Tang
0690a6bda7 Call uloc_toUnicodeLocaleType to convert key
Add tests for Intl Locale Info API to ensure the return items fit the
type definition in UTS35

Bug: v8:11887
Change-Id: Ie92d80518909df9472ffd887800832a656807b5c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2964597
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75190}
2021-06-16 16:05:50 +00:00
Frank Tang
2347c81ad6 [intl] Fix Intl Locale Info
1. Add test to ensure none of the array contains undefined
2. Calculate the fixed array size by considering the code may filter out
some itmes returned by ICU.
3. Add test to check there are no undefined.
4. Add test to check the locale.timeZones return sorted array.
5. Also refactor the JSArray generation code.

Bug: v8:11871
Change-Id: I8ad4a779d137d9b7e2deead7a1aa38e599e1af2e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2953517
Commit-Queue: Frank Tang <ftang@chromium.org>
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75162}
2021-06-15 19:16:01 +00:00
Frank Tang
4a78a7d00c Address flaky tests
The test push stack boundary and too flaky (timeout) while
running machine with more memory.

Bug: v8:11845
Change-Id: I5b603f05270d224de71c735ece5dd65a27311c25
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2939082
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75030}
2021-06-09 05:48:18 +00:00
Frank Tang
c0f90e5923 Implement DisplayNames v2
Add "calendar", and "dateTimeField"
Add option for languageDisplay

https://tc39.es/intl-displaynames-v2/
https://chromestatus.com/feature/5082027281874944
Design Doc:
https://docs.google.com/document/d/17hQz4nOC7PJYhxc_MU-BRoT6BnYGZv66XlU1iGX0ywQ/edit#

Bug: v8:11637
Change-Id: Ie7dc80d16956f0e668b11e600e47f5bafb081ff7
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2924523
Commit-Queue: Frank Tang <ftang@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75027}
2021-06-08 17:49:36 +00:00
Frank Tang
c563e44a13 Fix supportedLocalesOf of "best fit" matcher
Only return "subset of" the requested Locales.


Bug: v8:11860
Change-Id: I917753c6f0f5dfc7a52d071febbe03abfab45b04
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2946746
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75025}
2021-06-08 16:53:46 +00:00
Frank Tang
6da3dc6e3c Implement "Extend TimeZoneName Option Proposal"
https://tc39.es/proposal-intl-extend-timezonename/
https://chromestatus.com/guide/edit/4506375298220032

Bugs: v8:11661

Change-Id: I6d7e1bccf5a26ca02d39dc72d9362134a60ad6b9
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2757899
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#74809}
2021-05-27 08:49:22 +00:00
Frank Tang
0f0ead74b0 Implement proposal-intl-locale-info
Spec: https://tc39.es/proposal-intl-locale-info/
Design Doc: https://docs.google.com/document/d/1OwEsvs8VQwvR-ug01xLyIwpgcvUfaP24u9owc7aBKJ4/edit#
https://www.chromestatus.com/feature/5566859262820352

Behind flag --harmony_intl_locale_info

Bug: v8:11638

Change-Id: Ie616b3394d047c99d95ae46f112b5f0b367afe74
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2570218
Commit-Queue: Frank Tang <ftang@chromium.org>
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#74394}
2021-05-06 02:05:48 +00:00
Frank Tang
5067f0497b [Intl] Update ICU to 69-1
Diary https://docs.google.com/document/d/1T60FUG62FuvZ447FNoK81uE1fgJ7bayPf_w-rPqFrFM
81d6568..7e7574bd

chrome DEPS rolling https://chromium-review.googlesource.com/c/chromium/src/+/2824939

Bug: chromium:1193795
Change-Id: Ibccb97fe9b6b0601676800dea6c066e0d66a0a6f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2793151
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#74075}
2021-04-20 22:37:09 +00:00
Frank Tang
fb3a854eb7 Fix BestFitMatcher due to invalid locale id in ICU
Somehow we have no-NO-NY locale data in ICU and cause problem.

Bug: v8:11595
Change-Id: I68ba4c4c219bb3fbc88976f901a86219c44ea265
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2782602
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#73818}
2021-04-07 06:17:53 +00:00
Frank Tang
13ac253ac7 Revert "[test] Disable tests failing with new msan roll"
This reverts commit 57ae048bd2.

Reason for revert: bug fixed in https://chromium-review.googlesource.com/c/v8/v8/+/2706353

Original change's description:
> [test] Disable tests failing with new msan roll
>
> Temporarily disable these tests failing on msan builds after latest
> roll:
> - test262/intl402/DateTimeFormat/timezone-invalid
> - intl/regress-364374
> - mjsunit/regress/regress-crbug-627935
>
> No-Try: true
> No-Tree-Checks: true
> Bug: v8:11438
> Change-Id: I4a7755f9f65b2e9a12463c9e12fbbe39d3f5efb2
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2692188
> Reviewed-by: Clemens Backes <clemensb@chromium.org>
> Commit-Queue: Clemens Backes <clemensb@chromium.org>
> Auto-Submit: Nico Hartmann <nicohartmann@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#72691}

Bug: v8:11438
Change-Id: Iaca0a401a2c6d89e1bc8292ad41ae0086943c635
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2724862
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Reviewed-by: Nico Hartmann <nicohartmann@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#73115}
2021-03-02 00:00:03 +00:00
Frank Tang
8bc2cfb749 Implement GetOptionsObject/CoerceOptionsToObject
Add GetOptionsObject/CoerceOptionsToObject for ECMA402 2021
Change Intl.ListFormat / Intl.DisplayNames and Intl.Segmenter
to use GetOptionsObject and keep old API under CoerceOptionsToObject
based on https://github.com/tc39/ecma402/pull/538/files

Test262 tests need to be changed per
https://github.com/tc39/test262/issues/2950

Bug: v8:11466
Change-Id: I5cb9b7aba0556effc76b4005e95c90db1e59d41f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2705696
Commit-Queue: Frank Tang <ftang@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#73082}
2021-02-26 22:45:22 +00:00
Frank Tang
00038e19ca Fix Use-of-uninitialized-value
v8::internal::JSDateTimeFormat::New

Bug: chromium:1177812, chromium:1177623
Change-Id: I91e6babd796c6735e96e3cd1541d8aba51aaefee
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2706353
Commit-Queue: Frank Tang <ftang@chromium.org>
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#72878}
2021-02-19 21:11:27 +00:00
Nico Hartmann
57ae048bd2 [test] Disable tests failing with new msan roll
Temporarily disable these tests failing on msan builds after latest
roll:
- test262/intl402/DateTimeFormat/timezone-invalid
- intl/regress-364374
- mjsunit/regress/regress-crbug-627935

No-Try: true
No-Tree-Checks: true
Bug: v8:11438
Change-Id: I4a7755f9f65b2e9a12463c9e12fbbe39d3f5efb2
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2692188
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Auto-Submit: Nico Hartmann <nicohartmann@chromium.org>
Cr-Commit-Position: refs/heads/master@{#72691}
2021-02-12 11:53:48 +00:00
Frank Tang
ddb7d3079c Fix Intl.DisplayNames language canoncalization
Bug: v8:11424
Change-Id: Ic9c9dc2609ee85f046f6bc5794004ededd32bee5
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2684931
Commit-Queue: Frank Tang <ftang@chromium.org>
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#72616}
2021-02-10 02:59:43 +00:00
Frank Tang
f09c3831dd [intl] Fix space between day and hour in Chinese locale
Make sure there are space between day and hour in the pattern
when we alternate date pattern for the change of hour cycle.

Bug: chromium:1170305
Change-Id: I2714111dcdedeefafdb854d1684f301786273303
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2654002
Commit-Queue: Frank Tang <ftang@chromium.org>
Reviewed-by: Frank Tang <ftang@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#72418}
2021-01-29 00:29:37 +00:00
Frank Tang
3e5552350b Fix m(in|ax)imize() with long locale
Bug: v8:11350
Change-Id: Ic34b40c4d88d6c2a0ac62bbebee4e2a95ebba826
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2648973
Commit-Queue: Frank Tang <ftang@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#72417}
2021-01-29 00:28:32 +00:00
Frank Tang
c2795bd790 [intl] Implement ECMA402 PR500 Use OrdinaryHasInstance
Implement https://github.com/tc39/ecma402/pull/500

For the legacy [optional]  Unwrap*Format steps, use OrdinaryHasInstance
instead of InstanceofOperator.

ECMA402 agree w/ PR500 on 2021-1-14

Bug: v8:10981
Change-Id: Ic697aa245b11fecaf998127c009e59a821aaa01e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2444092
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#72303}
2021-01-25 22:33:04 +00:00
Frank Tang
dff4f7a921 Fix resolvedOption calendar for "iso8601"
Use a bit to work around the issue of ICU getType() bug.

Bug: v8:11295
Change-Id: I15d65bd44c489031d789e7638ea8abab90128124
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2614216
Commit-Queue: Frank Tang <ftang@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#72028}
2021-01-12 06:22:08 +00:00
Frank Tang
71e68fe4ed Cherrypick Locale canonicalization fix
cl for chrome/src/DEPS in https://chromium-review.googlesource.com/c/chromium/src/+/2582536

Bug: v8:10447
Change-Id: I28452cab64f000aa8cc466290ffcc97aa0b41f78
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2583189
Commit-Queue: Shu-yu Guo <syg@chromium.org>
Auto-Submit: Frank Tang <ftang@chromium.org>
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71702}
2020-12-10 19:05:08 +00:00
Frank Tang
64da43ef36 Reland "[intl] Clean up intl_segmenter flag"
This is a reland of c9c3ec4c14


Original change's description:
> [intl] Clean up intl_segmenter flag
>
> Intl.Segmenter shipped in m87 and launched.
>
> Bug: v8:11225
> Change-Id: I4213e261e1aea717c1281f19785a8c29ff1bbd8b
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2570461
> Commit-Queue: Frank Tang <ftang@chromium.org>
> Reviewed-by: Shu-yu Guo <syg@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#71653}

Bug: v8:11225, v8:11240
Change-Id: Ibded9038671862d90206d328f8a12db51c40e63c
Cq-Include-Trybots: luci.v8.try:v8_linux64_gc_stress_custom_snapshot_dbg_ng,v8_linux_arm64_gc_stress_dbg_ng,v8_linux_gc_stress_dbg_ng,v8_mac64_gc_stress_dbg_ng
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2579043
Commit-Queue: Frank Tang <ftang@chromium.org>
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71691}
2020-12-10 10:25:48 +00:00
Clemens Backes
371d7dbcc3 Revert "[intl] Clean up intl_segmenter flag"
This reverts commit c9c3ec4c14.

Reason for revert: Speculative revert for https://ci.chromium.org/ui/p/v8/builders/ci/V8%20Linux64%20GC%20Stress%20-%20custom%20snapshot/34616/overview (looks unrelated, but fails consistently since this CL)

Original change's description:
> [intl] Clean up intl_segmenter flag
>
> Intl.Segmenter shipped in m87 and launched.
>
> Bug: v8:11225
> Change-Id: I4213e261e1aea717c1281f19785a8c29ff1bbd8b
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2570461
> Commit-Queue: Frank Tang <ftang@chromium.org>
> Reviewed-by: Shu-yu Guo <syg@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#71653}

TBR=jkummerow@chromium.org,ftang@chromium.org,syg@chromium.org

Change-Id: Ic1d1b02abb9ae7faa41307eee694bb7e40d0fae2
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:11225
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2578979
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71657}
2020-12-08 13:25:56 +00:00
Frank Tang
c9c3ec4c14 [intl] Clean up intl_segmenter flag
Intl.Segmenter shipped in m87 and launched.

Bug: v8:11225
Change-Id: I4213e261e1aea717c1281f19785a8c29ff1bbd8b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2570461
Commit-Queue: Frank Tang <ftang@chromium.org>
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71653}
2020-12-08 10:01:23 +00:00
Maya Lekova
f3b77a2ac9 Revert "[int] Fix security bug in Intl.ListFormat"
This reverts commit 1341dbd209.

Reason for revert: The new test is failing on arm64 simulator MSAN - https://ci.chromium.org/p/v8/builders/ci/V8%20Linux%20-%20arm64%20-%20sim%20-%20MSAN/35559

Original change's description:
> [int] Fix security bug in Intl.ListFormat
>
> Also add test to ensure it won't crash. The crash is caused by int32_t overflow inside ICU68-1
>
> Real fix in 3bf08c6a50
>
> Bug: chromium:1150371
> Change-Id: I71c7bb3c50453fe3fa40226cab83bee0d865b0f0
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2551212
> Reviewed-by: Shu-yu Guo <syg@chromium.org>
> Reviewed-by: Michael Achenbach <machenbach@chromium.org>
> Commit-Queue: Frank Tang <ftang@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#71357}

TBR=jkummerow@chromium.org,machenbach@chromium.org,ftang@chromium.org,syg@chromium.org

Change-Id: I10862ad1fb308d1610b8f7a80cca43c010475397
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:1150371
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2557512
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Commit-Queue: Maya Lekova <mslekova@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71362}
2020-11-24 11:04:31 +00:00
Frank Tang
1341dbd209 [int] Fix security bug in Intl.ListFormat
Also add test to ensure it won't crash. The crash is caused by int32_t overflow inside ICU68-1

Real fix in 3bf08c6a50

Bug: chromium:1150371
Change-Id: I71c7bb3c50453fe3fa40226cab83bee0d865b0f0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2551212
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71357}
2020-11-24 09:37:50 +00:00
Frank Tang
fbfbc5c28b [intl] Validate locale by LocaleBuilder
LocaleBuilder validates better, it also fixes most cases in
transformed-ext-invalid except one.

Bug: v8:10447
Change-Id: I6fed6692ca3264198e42ccc3d9ca4bfb54fb0517
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2549688
Commit-Queue: Frank Tang <ftang@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71300}
2020-11-20 00:34:29 +00:00
Frank Tang
b346af5424 [Intl] Fix Locale Canonicalization bugs
Bug: v8:9613, v8:10447
Change-Id: Iff43b298c6edaa9b258038ae15406d5df209e8b5
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2543266
Commit-Queue: Frank Tang <ftang@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71267}
2020-11-18 16:48:25 +00:00
Frank Tang
f6d2255a03 Reland "Add regression tests for 4 calendar bugs"
This is a reland of 915f729afb

Original change's description:
> Add regression tests for 4 calendar bugs
>
> These bugs was fixed by ICU68
>
> Bug: v8:10526, v8:10527, v8:10528, v8:10529
> Change-Id: I8d0dcb52d849f742e0a29314ac8a148370f60a1a
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2527086
> Reviewed-by: Shu-yu Guo <syg@chromium.org>
> Commit-Queue: Frank Tang <ftang@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#71062}

Cq-Include-Trybots: luci.v8.try:v8_android_arm64_n5x_rel_ng
Bug: v8:10526
Bug: v8:10527
Bug: v8:10528
Bug: v8:10529
Change-Id: I8857fb8c104bb4bede8fe816574bfd46ccbcd082
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2536737
Commit-Queue: Frank Tang <ftang@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71244}
2020-11-17 23:47:08 +00:00
Frank Tang
3af12e4848 [Intl] Fix ASAN crash listformat w/ > 9 items
Fix the ASAN crahs when there are 9 or more items to be formatted by
ListFormat.

chromium DEPS rolled in
https://chromium-review.googlesource.com/c/chromium/src/+/2536432

This CL is mainly to add unit test to ensure it fix.

Cq-Include-Trybots: luci.v8.try:v8_linux64_asan_rel_ng,v8_mac64_asan_rel_ng,v8_win64_asan_rel_ng;luci.chromium.try:android-asan,win-asan,win-libfuzzer-asan-relBug: chromium:1146068
Change-Id: I4dfbd6ea0efe5b398196f95abc520bb93e16a7cd
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2528476
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71192}
2020-11-14 05:42:45 +00:00
Frank Tang
570086544d roll icu to Fix debug assertion in ICU Locale::setKeywordValue
chromium DEPS rolled in
https://chromium-review.googlesource.com/c/chromium/src/+/2536432

This CL is mainly to add unit test to ensure it fix.

Bug: chromium:1146468
Change-Id: I30505d9133136122023d80ff85edbf0abe49c07e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2535790
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71190}
2020-11-14 03:19:17 +00:00
Michael Achenbach
394eedcdd4 Revert "Add regression tests for 4 calendar bugs"
This reverts commit 915f729afb.

Reason for revert: Failing on Android:
https://ci.chromium.org/p/v8/builders/ci/V8%20Android%20Arm64%20-%20N5X/11321

Original change's description:
> Add regression tests for 4 calendar bugs
>
> These bugs was fixed by ICU68
>
> Bug: v8:10526, v8:10527, v8:10528, v8:10529
> Change-Id: I8d0dcb52d849f742e0a29314ac8a148370f60a1a
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2527086
> Reviewed-by: Shu-yu Guo <syg@chromium.org>
> Commit-Queue: Frank Tang <ftang@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#71062}

TBR=jkummerow@chromium.org,ftang@chromium.org,syg@chromium.org

Change-Id: I3173d1e7e991de63a8a6fa73be9b931faf6d9ef6
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:10526
Bug: v8:10527
Bug: v8:10528
Bug: v8:10529
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2527091
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71071}
2020-11-10 08:18:45 +00:00