Skip to content

Commit

Permalink
[intl] Fix arm64-N5X failure in NumberFormat v3 due to precision issue
Browse files Browse the repository at this point in the history
Use the new ICU 71-1 API

Precision::incrementExact
https://unicode-org.github.io/icu-docs/apidoc/dev/icu4c/classicu_1_1number_1_1Precision.html#aedfb413e5a37c69868594c870a87134b

Change-Id: I6d8841e5a07972d1be36026ce150eb83dbf300e7
Cq-Include-Trybots: luci.v8.try:v8_android_arm64_n5x_rel_ng
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3430378
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/main@{#80126}
  • Loading branch information
FrankYFTang authored and V8 LUCI CQ committed Apr 22, 2022
1 parent b081948 commit 3ae4277
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/objects/intl-objects.h
Expand Up @@ -21,7 +21,7 @@
#include "unicode/locid.h"
#include "unicode/uversion.h"

#define V8_MINIMUM_ICU_VERSION 69
#define V8_MINIMUM_ICU_VERSION 71

namespace U_ICU_NAMESPACE {
class BreakIterator;
Expand Down
5 changes: 2 additions & 3 deletions src/objects/js-number-format.cc
Expand Up @@ -884,9 +884,8 @@ icu::number::UnlocalizedNumberFormatter SetDigitOptionsToFormatterV3(
break;
}
if (rounding_increment != 1) {
double icu_increment = rounding_increment *
std::pow(10, -digit_options.maximum_fraction_digits);
precision = ::icu::number::Precision::increment(icu_increment)
precision = ::icu::number::Precision::incrementExact(
rounding_increment, -digit_options.maximum_fraction_digits)
.withMinFraction(digit_options.minimum_fraction_digits);
}
if (trailing_zeros == JSNumberFormat::ShowTrailingZeros::kHide) {
Expand Down
8 changes: 0 additions & 8 deletions test/test262/test262.status
Expand Up @@ -3128,14 +3128,6 @@
'language/identifiers/start-unicode-9*': [FAIL],
}], # no_i18n == True

['arch == arm64', {
# Problem in V8 Android Arm64 - N5X
'intl402/NumberFormat/prototype/format/format-rounding-increment-1000': [SKIP],
'intl402/NumberFormat/prototype/format/format-rounding-increment-2000': [SKIP],
'intl402/NumberFormat/prototype/format/format-rounding-increment-2500': [SKIP],
'intl402/NumberFormat/prototype/format/format-rounding-increment-5000': [SKIP],
}], # 'arch == arm64'

['arch == arm or arch == mipsel or arch == mips or arch == arm64 or arch == mips64 or arch == mips64el', {

# Causes stack overflow on simulators due to eager compilation of
Expand Down

0 comments on commit 3ae4277

Please sign in to comment.