Commit 250b2e29 authored by Frank Tang's avatar Frank Tang Committed by V8 LUCI CQ

[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/+/3405649Reviewed-by: 's avatarShu-yu Guo <syg@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78878}
parent cdb20294
...@@ -85,8 +85,15 @@ BUILTIN(NumberFormatPrototypeFormatToParts) { ...@@ -85,8 +85,15 @@ BUILTIN(NumberFormatPrototypeFormatToParts) {
Handle<Object> x; Handle<Object> x;
if (args.length() >= 2) { if (args.length() >= 2) {
ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, x, Handle<Object> value = args.at(1);
Object::ToNumeric(isolate, args.at(1))); if (FLAG_harmony_intl_number_format_v3) {
ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
isolate, x,
Intl::ToIntlMathematicalValueAsNumberBigIntOrString(isolate, value));
} else {
ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, x,
Object::ToNumeric(isolate, value));
}
} else { } else {
x = isolate->factory()->nan_value(); x = isolate->factory()->nan_value();
} }
...@@ -501,8 +508,14 @@ BUILTIN(NumberFormatInternalFormatNumber) { ...@@ -501,8 +508,14 @@ BUILTIN(NumberFormatInternalFormatNumber) {
// 4. Let x be ? ToNumeric(value). // 4. Let x be ? ToNumeric(value).
Handle<Object> numeric_obj; Handle<Object> numeric_obj;
ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, numeric_obj, if (FLAG_harmony_intl_number_format_v3) {
Object::ToNumeric(isolate, value)); ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
isolate, numeric_obj,
Intl::ToIntlMathematicalValueAsNumberBigIntOrString(isolate, value));
} else {
ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, numeric_obj,
Object::ToNumeric(isolate, value));
}
icu::number::LocalizedNumberFormatter* icu_localized_number_formatter = icu::number::LocalizedNumberFormatter* icu_localized_number_formatter =
number_format->icu_number_formatter().raw(); number_format->icu_number_formatter().raw();
...@@ -902,20 +915,18 @@ BUILTIN(PluralRulesPrototypeResolvedOptions) { ...@@ -902,20 +915,18 @@ BUILTIN(PluralRulesPrototypeResolvedOptions) {
BUILTIN(PluralRulesPrototypeSelect) { BUILTIN(PluralRulesPrototypeSelect) {
HandleScope scope(isolate); HandleScope scope(isolate);
// 1. Let pr be the this value. // 1. 1. Let pr be the this value.
// 2. If Type(pr) is not Object, throw a TypeError exception. // 2. Perform ? RequireInternalSlot(pr, [[InitializedPluralRules]]).
// 3. If pr does not have an [[InitializedPluralRules]] internal slot, throw a
// TypeError exception.
CHECK_RECEIVER(JSPluralRules, plural_rules, CHECK_RECEIVER(JSPluralRules, plural_rules,
"Intl.PluralRules.prototype.select"); "Intl.PluralRules.prototype.select");
// 4. Let n be ? ToNumber(value). // 3. Let n be ? ToNumber(value).
Handle<Object> number = args.atOrUndefined(isolate, 1); Handle<Object> number = args.atOrUndefined(isolate, 1);
ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, number, ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, number,
Object::ToNumber(isolate, number)); Object::ToNumber(isolate, number));
double number_double = number->Number(); double number_double = number->Number();
// 5. Return ? ResolvePlural(pr, n). // 4. Return ! ResolvePlural(pr, n).
RETURN_RESULT_OR_FAILURE(isolate, JSPluralRules::ResolvePlural( RETURN_RESULT_OR_FAILURE(isolate, JSPluralRules::ResolvePlural(
isolate, plural_rules, number_double)); isolate, plural_rules, number_double));
} }
......
...@@ -311,7 +311,9 @@ DEFINE_BOOL(harmony_shipping, true, "enable all shipped harmony features") ...@@ -311,7 +311,9 @@ DEFINE_BOOL(harmony_shipping, true, "enable all shipped harmony features")
V(harmony_array_grouping, "harmony array grouping") V(harmony_array_grouping, "harmony array grouping")
#ifdef V8_INTL_SUPPORT #ifdef V8_INTL_SUPPORT
#define HARMONY_INPROGRESS(V) HARMONY_INPROGRESS_BASE(V) #define HARMONY_INPROGRESS(V) \
HARMONY_INPROGRESS_BASE(V) \
V(harmony_intl_number_format_v3, "Intl.NumberFormat v3")
#else #else
#define HARMONY_INPROGRESS(V) HARMONY_INPROGRESS_BASE(V) #define HARMONY_INPROGRESS(V) HARMONY_INPROGRESS_BASE(V)
#endif #endif
......
...@@ -4404,6 +4404,7 @@ EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_error_cause) ...@@ -4404,6 +4404,7 @@ EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_error_cause)
#ifdef V8_INTL_SUPPORT #ifdef V8_INTL_SUPPORT
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_intl_best_fit_matcher) EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_intl_best_fit_matcher)
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_intl_number_format_v3)
#endif // V8_INTL_SUPPORT #endif // V8_INTL_SUPPORT
#undef EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE #undef EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE
......
...@@ -78,6 +78,7 @@ ...@@ -78,6 +78,7 @@
V(_, minusSign_string, "minusSign") \ V(_, minusSign_string, "minusSign") \
V(_, nan_string, "nan") \ V(_, nan_string, "nan") \
V(_, narrowSymbol_string, "narrowSymbol") \ V(_, narrowSymbol_string, "narrowSymbol") \
V(_, negative_string, "negative") \
V(_, never_string, "never") \ V(_, never_string, "never") \
V(_, none_string, "none") \ V(_, none_string, "none") \
V(_, notation_string, "notation") \ V(_, notation_string, "notation") \
......
This diff is collapsed.
...@@ -35,6 +35,19 @@ class UnicodeString; ...@@ -35,6 +35,19 @@ class UnicodeString;
namespace v8 { namespace v8 {
namespace internal { namespace internal {
struct NumberFormatSpan {
int32_t field_id;
int32_t begin_pos;
int32_t end_pos;
NumberFormatSpan() = default;
NumberFormatSpan(int32_t field_id, int32_t begin_pos, int32_t end_pos)
: field_id(field_id), begin_pos(begin_pos), end_pos(end_pos) {}
};
V8_EXPORT_PRIVATE std::vector<NumberFormatSpan> FlattenRegionsToParts(
std::vector<NumberFormatSpan>* regions);
template <typename T> template <typename T>
class Handle; class Handle;
class JSCollator; class JSCollator;
...@@ -115,6 +128,21 @@ class Intl { ...@@ -115,6 +128,21 @@ class Intl {
Isolate* isolate, Handle<Object> num, Handle<Object> locales, Isolate* isolate, Handle<Object> num, Handle<Object> locales,
Handle<Object> options, const char* method_name); Handle<Object> options, const char* method_name);
// [[RoundingPriority]] is one of the String values "auto", "morePrecision",
// or "lessPrecision", specifying the rounding priority for the number.
enum class RoundingPriority {
kAuto,
kMorePrecision,
kLessPrecision,
};
enum class RoundingType {
kFractionDigits,
kSignificantDigits,
kMorePrecision,
kLessPrecision,
};
// ecma402/#sec-setnfdigitoptions // ecma402/#sec-setnfdigitoptions
struct NumberFormatDigitOptions { struct NumberFormatDigitOptions {
int minimum_integer_digits; int minimum_integer_digits;
...@@ -122,6 +150,8 @@ class Intl { ...@@ -122,6 +150,8 @@ class Intl {
int maximum_fraction_digits; int maximum_fraction_digits;
int minimum_significant_digits; int minimum_significant_digits;
int maximum_significant_digits; int maximum_significant_digits;
RoundingPriority rounding_priority;
RoundingType rounding_type;
}; };
V8_WARN_UNUSED_RESULT static Maybe<NumberFormatDigitOptions> V8_WARN_UNUSED_RESULT static Maybe<NumberFormatDigitOptions>
SetNumberFormatDigitOptions(Isolate* isolate, Handle<JSReceiver> options, SetNumberFormatDigitOptions(Isolate* isolate, Handle<JSReceiver> options,
...@@ -143,8 +173,9 @@ class Intl { ...@@ -143,8 +173,9 @@ class Intl {
// Helper function to convert number field id to type string. // Helper function to convert number field id to type string.
static Handle<String> NumberFieldToType(Isolate* isolate, static Handle<String> NumberFieldToType(Isolate* isolate,
Handle<Object> numeric_obj, const NumberFormatSpan& part,
int32_t field_id); const icu::UnicodeString& text,
bool is_nan);
// A helper function to implement formatToParts which add element to array as // A helper function to implement formatToParts which add element to array as
// $array[$index] = { type: $field_type_string, value: $value } // $array[$index] = { type: $field_type_string, value: $value }
...@@ -312,6 +343,16 @@ class Intl { ...@@ -312,6 +343,16 @@ class Intl {
V8_WARN_UNUSED_RESULT static MaybeHandle<String> CanonicalizeTimeZoneName( V8_WARN_UNUSED_RESULT static MaybeHandle<String> CanonicalizeTimeZoneName(
Isolate* isolate, Handle<String> identifier); Isolate* isolate, Handle<String> identifier);
// ecma402/#sec-coerceoptionstoobject
V8_WARN_UNUSED_RESULT static MaybeHandle<JSReceiver> CoerceOptionsToObject(
Isolate* isolate, Handle<Object> options, const char* service);
// #sec-tointlmathematicalvalue
// The implementation preserve the Object in String, BigInt or Number
V8_WARN_UNUSED_RESULT static MaybeHandle<Object>
ToIntlMathematicalValueAsNumberBigIntOrString(Isolate* isolate,
Handle<Object> input);
}; };
} // namespace internal } // namespace internal
......
This diff is collapsed.
...@@ -26,8 +26,9 @@ namespace U_ICU_NAMESPACE { ...@@ -26,8 +26,9 @@ namespace U_ICU_NAMESPACE {
class UnicodeString; class UnicodeString;
namespace number { namespace number {
class LocalizedNumberFormatter; class LocalizedNumberFormatter;
} // namespace number class UnlocalizedNumberFormatter;
} // namespace U_ICU_NAMESPACE } // namespace number
} // namespace U_ICU_NAMESPACE
namespace v8 { namespace v8 {
namespace internal { namespace internal {
...@@ -68,9 +69,13 @@ class JSNumberFormat ...@@ -68,9 +69,13 @@ class JSNumberFormat
int32_t* minimum, int32_t* maximum); int32_t* minimum, int32_t* maximum);
static bool SignificantDigitsFromSkeleton(const icu::UnicodeString& skeleton, static bool SignificantDigitsFromSkeleton(const icu::UnicodeString& skeleton,
int32_t* minimum, int32_t* maximum); int32_t* minimum, int32_t* maximum);
static icu::number::LocalizedNumberFormatter SetDigitOptionsToFormatter(
const icu::number::LocalizedNumberFormatter& icu_number_formatter, enum class ShowTrailingZeros { kShow, kHide };
const Intl::NumberFormatDigitOptions& digit_options);
static icu::number::UnlocalizedNumberFormatter SetDigitOptionsToFormatter(
const icu::number::UnlocalizedNumberFormatter& settings,
const Intl::NumberFormatDigitOptions& digit_options,
int rounding_increment, ShowTrailingZeros show);
DECL_PRINTER(JSNumberFormat) DECL_PRINTER(JSNumberFormat)
...@@ -80,19 +85,6 @@ class JSNumberFormat ...@@ -80,19 +85,6 @@ class JSNumberFormat
TQ_OBJECT_CONSTRUCTORS(JSNumberFormat) TQ_OBJECT_CONSTRUCTORS(JSNumberFormat)
}; };
struct NumberFormatSpan {
int32_t field_id;
int32_t begin_pos;
int32_t end_pos;
NumberFormatSpan() = default;
NumberFormatSpan(int32_t field_id, int32_t begin_pos, int32_t end_pos)
: field_id(field_id), begin_pos(begin_pos), end_pos(end_pos) {}
};
V8_EXPORT_PRIVATE std::vector<NumberFormatSpan> FlattenRegionsToParts(
std::vector<NumberFormatSpan>* regions);
} // namespace internal } // namespace internal
} // namespace v8 } // namespace v8
......
...@@ -115,21 +115,19 @@ MaybeHandle<JSPluralRules> JSPluralRules::New(Isolate* isolate, Handle<Map> map, ...@@ -115,21 +115,19 @@ MaybeHandle<JSPluralRules> JSPluralRules::New(Isolate* isolate, Handle<Map> map,
Handle<String> locale_str = Handle<String> locale_str =
isolate->factory()->NewStringFromAsciiChecked(r.locale.c_str()); isolate->factory()->NewStringFromAsciiChecked(r.locale.c_str());
icu::number::LocalizedNumberFormatter icu_number_formatter = icu::Locale icu_locale = r.icu_locale;
icu::number::NumberFormatter::withLocale(r.icu_locale) icu::number::UnlocalizedNumberFormatter settings =
.roundingMode(UNUM_ROUND_HALFUP); icu::number::UnlocalizedNumberFormatter().roundingMode(UNUM_ROUND_HALFUP);
std::unique_ptr<icu::PluralRules> icu_plural_rules; std::unique_ptr<icu::PluralRules> icu_plural_rules;
bool success = bool success =
CreateICUPluralRules(isolate, r.icu_locale, type, &icu_plural_rules); CreateICUPluralRules(isolate, r.icu_locale, type, &icu_plural_rules);
if (!success || icu_plural_rules.get() == nullptr) { if (!success || icu_plural_rules.get() == nullptr) {
// Remove extensions and try again. // Remove extensions and try again.
icu::Locale no_extension_locale(r.icu_locale.getBaseName()); icu::Locale no_extension_locale(icu_locale.getBaseName());
success = CreateICUPluralRules(isolate, no_extension_locale, type, success = CreateICUPluralRules(isolate, no_extension_locale, type,
&icu_plural_rules); &icu_plural_rules);
icu_number_formatter = icu_locale = no_extension_locale;
icu::number::NumberFormatter::withLocale(no_extension_locale)
.roundingMode(UNUM_ROUND_HALFUP);
if (!success || icu_plural_rules.get() == nullptr) { if (!success || icu_plural_rules.get() == nullptr) {
THROW_NEW_ERROR(isolate, NewRangeError(MessageTemplate::kIcuError), THROW_NEW_ERROR(isolate, NewRangeError(MessageTemplate::kIcuError),
...@@ -142,8 +140,11 @@ MaybeHandle<JSPluralRules> JSPluralRules::New(Isolate* isolate, Handle<Map> map, ...@@ -142,8 +140,11 @@ MaybeHandle<JSPluralRules> JSPluralRules::New(Isolate* isolate, Handle<Map> map,
Intl::SetNumberFormatDigitOptions(isolate, options, 0, 3, false); Intl::SetNumberFormatDigitOptions(isolate, options, 0, 3, false);
MAYBE_RETURN(maybe_digit_options, MaybeHandle<JSPluralRules>()); MAYBE_RETURN(maybe_digit_options, MaybeHandle<JSPluralRules>());
Intl::NumberFormatDigitOptions digit_options = maybe_digit_options.FromJust(); Intl::NumberFormatDigitOptions digit_options = maybe_digit_options.FromJust();
icu_number_formatter = JSNumberFormat::SetDigitOptionsToFormatter( settings = JSNumberFormat::SetDigitOptionsToFormatter(
icu_number_formatter, digit_options); settings, digit_options, 1, JSNumberFormat::ShowTrailingZeros::kShow);
icu::number::LocalizedNumberFormatter icu_number_formatter =
settings.locale(icu_locale);
Handle<Managed<icu::PluralRules>> managed_plural_rules = Handle<Managed<icu::PluralRules>> managed_plural_rules =
Managed<icu::PluralRules>::FromUniquePtr(isolate, 0, Managed<icu::PluralRules>::FromUniquePtr(isolate, 0,
......
...@@ -343,9 +343,9 @@ template <typename T> ...@@ -343,9 +343,9 @@ template <typename T>
MaybeHandle<T> FormatCommon( MaybeHandle<T> FormatCommon(
Isolate* isolate, Handle<JSRelativeTimeFormat> format, Isolate* isolate, Handle<JSRelativeTimeFormat> format,
Handle<Object> value_obj, Handle<Object> unit_obj, const char* func_name, Handle<Object> value_obj, Handle<Object> unit_obj, const char* func_name,
const std::function< MaybeHandle<T> (*formatToResult)(Isolate*,
MaybeHandle<T>(Isolate*, const icu::FormattedRelativeDateTime&, const icu::FormattedRelativeDateTime&,
Handle<Object>, Handle<String>)>& formatToResult) { Handle<String>, bool)) {
// 3. Let value be ? ToNumber(value). // 3. Let value be ? ToNumber(value).
Handle<Object> value; Handle<Object> value;
ASSIGN_RETURN_ON_EXCEPTION(isolate, value, ASSIGN_RETURN_ON_EXCEPTION(isolate, value,
...@@ -382,13 +382,13 @@ MaybeHandle<T> FormatCommon( ...@@ -382,13 +382,13 @@ MaybeHandle<T> FormatCommon(
if (U_FAILURE(status)) { if (U_FAILURE(status)) {
THROW_NEW_ERROR(isolate, NewTypeError(MessageTemplate::kIcuError), T); THROW_NEW_ERROR(isolate, NewTypeError(MessageTemplate::kIcuError), T);
} }
return formatToResult(isolate, formatted, value, return formatToResult(isolate, formatted, UnitAsString(isolate, unit_enum),
UnitAsString(isolate, unit_enum)); value->IsNaN());
} }
MaybeHandle<String> FormatToString( MaybeHandle<String> FormatToString(
Isolate* isolate, const icu::FormattedRelativeDateTime& formatted, Isolate* isolate, const icu::FormattedRelativeDateTime& formatted,
Handle<Object> value, Handle<String> unit) { Handle<String> unit, bool is_nan) {
UErrorCode status = U_ZERO_ERROR; UErrorCode status = U_ZERO_ERROR;
icu::UnicodeString result = formatted.toString(status); icu::UnicodeString result = formatted.toString(status);
if (U_FAILURE(status)) { if (U_FAILURE(status)) {
...@@ -411,21 +411,22 @@ Maybe<bool> AddLiteral(Isolate* isolate, Handle<JSArray> array, ...@@ -411,21 +411,22 @@ Maybe<bool> AddLiteral(Isolate* isolate, Handle<JSArray> array,
Maybe<bool> AddUnit(Isolate* isolate, Handle<JSArray> array, Maybe<bool> AddUnit(Isolate* isolate, Handle<JSArray> array,
const icu::UnicodeString& string, int32_t index, const icu::UnicodeString& string, int32_t index,
int32_t start, int32_t limit, int32_t field_id, const NumberFormatSpan& part, Handle<String> unit,
Handle<Object> value, Handle<String> unit) { bool is_nan) {
Handle<String> substring; Handle<String> substring;
ASSIGN_RETURN_ON_EXCEPTION_VALUE( ASSIGN_RETURN_ON_EXCEPTION_VALUE(
isolate, substring, Intl::ToString(isolate, string, start, limit), isolate, substring,
Intl::ToString(isolate, string, part.begin_pos, part.end_pos),
Nothing<bool>()); Nothing<bool>());
Intl::AddElement(isolate, array, index, Intl::AddElement(isolate, array, index,
Intl::NumberFieldToType(isolate, value, field_id), substring, Intl::NumberFieldToType(isolate, part, string, is_nan),
isolate->factory()->unit_string(), unit); substring, isolate->factory()->unit_string(), unit);
return Just(true); return Just(true);
} }
MaybeHandle<JSArray> FormatToJSArray( MaybeHandle<JSArray> FormatToJSArray(
Isolate* isolate, const icu::FormattedRelativeDateTime& formatted, Isolate* isolate, const icu::FormattedRelativeDateTime& formatted,
Handle<Object> value, Handle<String> unit) { Handle<String> unit, bool is_nan) {
UErrorCode status = U_ZERO_ERROR; UErrorCode status = U_ZERO_ERROR;
icu::UnicodeString string = formatted.toString(status); icu::UnicodeString string = formatted.toString(status);
...@@ -457,19 +458,23 @@ MaybeHandle<JSArray> FormatToJSArray( ...@@ -457,19 +458,23 @@ MaybeHandle<JSArray> FormatToJSArray(
for (auto start_limit : groups) { for (auto start_limit : groups) {
if (start_limit.first > start) { if (start_limit.first > start) {
Maybe<bool> maybe_added = Maybe<bool> maybe_added =
AddUnit(isolate, array, string, index++, start, AddUnit(isolate, array, string, index++,
start_limit.first, field, value, unit); NumberFormatSpan(field, start, start_limit.first), unit,
is_nan);
MAYBE_RETURN(maybe_added, Handle<JSArray>()); MAYBE_RETURN(maybe_added, Handle<JSArray>());
maybe_added = AddUnit(isolate, array, string, index++, maybe_added =
start_limit.first, start_limit.second, AddUnit(isolate, array, string, index++,
UNUM_GROUPING_SEPARATOR_FIELD, value, unit); NumberFormatSpan(UNUM_GROUPING_SEPARATOR_FIELD,
start_limit.first, start_limit.second),
unit, is_nan);
MAYBE_RETURN(maybe_added, Handle<JSArray>()); MAYBE_RETURN(maybe_added, Handle<JSArray>());
start = start_limit.second; start = start_limit.second;
} }
} }
} }
Maybe<bool> maybe_added = AddUnit(isolate, array, string, index++, start, Maybe<bool> maybe_added =
limit, field, value, unit); AddUnit(isolate, array, string, index++,
NumberFormatSpan(field, start, limit), unit, is_nan);
MAYBE_RETURN(maybe_added, Handle<JSArray>()); MAYBE_RETURN(maybe_added, Handle<JSArray>());
previous_end = limit; previous_end = limit;
} }
......
...@@ -65,6 +65,75 @@ V8_WARN_UNUSED_RESULT static Maybe<T> GetStringOption( ...@@ -65,6 +65,75 @@ V8_WARN_UNUSED_RESULT static Maybe<T> GetStringOption(
return Just(default_value); return Just(default_value);
} }
// A helper template to get string from option into a enum.
// The enum in the enum_values is the corresponding value to the strings
// in the str_values. If the option does not contains name,
// default_value will be return.
template <typename T>
V8_WARN_UNUSED_RESULT static Maybe<T> GetStringOrBooleanOption(
Isolate* isolate, Handle<JSReceiver> options, const char* property,
const char* method, const std::vector<const char*>& str_values,
const std::vector<T>& enum_values, T true_value, T false_value,
T fallback_value) {
DCHECK_EQ(str_values.size(), enum_values.size());
Handle<String> property_str =
isolate->factory()->NewStringFromAsciiChecked(property);
// 1. Let value be ? Get(options, property).
Handle<Object> value;
ASSIGN_RETURN_ON_EXCEPTION_VALUE(
isolate, value,
Object::GetPropertyOrElement(isolate, options, property_str),
Nothing<T>());
// 2. If value is undefined, then return fallback.
if (value->IsUndefined(isolate)) {
return Just(fallback_value);
}
// 3. If value is true, then return trueValue.
if (value->IsTrue(isolate)) {
return Just(true_value);
}
// 4. Let valueBoolean be ToBoolean(value).
bool valueBoolean = value->BooleanValue(isolate);
// 5. If valueBoolean is false, then return valueBoolean.
if (!valueBoolean) {
return Just(false_value);
}
Handle<String> value_str;
// 6. Let value be ? ToString(value).
ASSIGN_RETURN_ON_EXCEPTION_VALUE(
isolate, value_str, Object::ToString(isolate, value), Nothing<T>());
// 7. If values does not contain an element equal to value, throw a
// RangeError exception.
// 8. Return value.
value_str = String::Flatten(isolate, value_str);
DisallowGarbageCollection no_gc;
const String::FlatContent& flat = value_str->GetFlatContent(no_gc);
int32_t length = value_str->length();
for (size_t i = 0; i < str_values.size(); i++) {
if (static_cast<int32_t>(strlen(str_values.at(i))) == length) {
if (flat.IsOneByte()) {
if (CompareCharsEqual(str_values.at(i), flat.ToOneByteVector().begin(),
length)) {
return Just(enum_values[i]);
}
} else {
if (CompareCharsEqual(str_values.at(i), flat.ToUC16Vector().begin(),
length)) {
return Just(enum_values[i]);
}
}
}
}
THROW_NEW_ERROR_RETURN_VALUE(
isolate,
NewRangeError(MessageTemplate::kValueOutOfRange, value,
isolate->factory()->NewStringFromAsciiChecked(method),
property_str),
Nothing<T>());
}
// ECMA402 9.2.10. GetOption( options, property, type, values, fallback) // ECMA402 9.2.10. GetOption( options, property, type, values, fallback)
// ecma402/#sec-getoption // ecma402/#sec-getoption
// //
......
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
[ALWAYS, { [ALWAYS, {
# TODO(ftang,jshin): The following test is flaky. # TODO(ftang,jshin): The following test is flaky.
'overrides/caching': [PASS, FAIL], 'overrides/caching': [PASS, FAIL],
'number-format/rounding-increment-resolved-match-v3': [FAIL],
}], # ALWAYS }], # ALWAYS
################################################################################ ################################################################################
......
// Copyright 2021 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --harmony-intl-number-format-v3
let validRoundingIncrements = [
1, 2, 5, 10, 20, 25, 50, 100, 200, 250, 500, 1000, 2000, 2500, 5000];
validRoundingIncrements.forEach(function(roundingIncrement) {
let nf = new Intl.NumberFormat(undefined, {roundingIncrement});
assertEquals(roundingIncrement, nf.resolvedOptions().roundingIncrement);
});
// Copyright 2021 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --harmony-intl-number-format-v3
let validRoundingIncrements = [
1, 2, 5, 10, 20, 25, 50, 100, 200, 250, 500, 1000, 2000, 2500, 5000];
let invalidRoundingIncrements = [
-1, -5, 0, 3, 1001, 1100, 5500, 10000, 20000, 25000, 100000, 200000, 500005, 10000000
];
validRoundingIncrements.forEach(function(roundingIncrement) {
assertDoesNotThrow(() => {
new Intl.NumberFormat(undefined, {roundingIncrement})});
});
invalidRoundingIncrements.forEach(function(roundingIncrement) {
assertThrows(() => {
let nf = new Intl.NumberFormat(undefined, {roundingIncrement})},
RangeError);
});
// Copyright 2021 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --harmony-intl-number-format-v3
let penny = new Intl.NumberFormat(
"en", { minimumFractionDigits: 2, maximumFractionDigits: 2, roundingIncrement: 1 });
let nickel = new Intl.NumberFormat(
"en", { minimumFractionDigits: 2, maximumFractionDigits: 2, roundingIncrement: 5 });
let dime = new Intl.NumberFormat(
"en", { minimumFractionDigits: 2, maximumFractionDigits: 2, roundingIncrement: 10 });
// https://necs.com/knowledgebase/sysprefs_prc_mod_roundmeth.htm
assertEquals("10.15", penny.format(10.154));
assertEquals("10.16", penny.format(10.155));
assertEquals("10.10", nickel.format(10.124));
assertEquals("10.15", nickel.format(10.125));
assertEquals("10.40", dime.format(10.444));
// mistake in the above page, the result should be 10.40 not 10.50
// assertEquals("10.50", dime.format(10.445));
assertEquals("10.40", dime.format(10.445));
assertEquals("10.50", dime.format(10.45));
// Copyright 2021 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// Flags: --harmony-intl-number-format-v3
// Test default.
let nf = new Intl.NumberFormat();
assertEquals("auto", nf.resolvedOptions().signDisplay);
nf = new Intl.NumberFormat("en");
assertEquals("auto", nf.resolvedOptions().signDisplay);
const testData = [
["auto", "-123", "-0", "0", "123"],
["always", "-123", "-0", "+0", "+123"],
["never", "123", "0", "0", "123"],
["exceptZero", "-123", "0", "0", "+123"],
["negative", "-123", "0", "0", "123"],
];
for (const [signDisplay, neg, negZero, zero, pos] of testData) {
nf = new Intl.NumberFormat("en", {signDisplay});
assertEquals(signDisplay, nf.resolvedOptions().signDisplay);
assertEquals(neg, nf.format(-123));
assertEquals(negZero, nf.format(-0));
assertEquals(zero, nf.format(0));
assertEquals(pos, nf.format(123));
}
// Copyright 2021 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --harmony-intl-number-format-v3
let defaultFmt = new Intl.NumberFormat("en",
{ minimumFractionDigits: 2, maximumFractionDigits: 2 });
let autoFmt = new Intl.NumberFormat("en",
{ minimumFractionDigits: 2, maximumFractionDigits: 2,
trailingZeroDisplay: 'auto'});
let stripIfIntegerFmt = new Intl.NumberFormat("en",
{ minimumFractionDigits: 2, maximumFractionDigits: 2,
trailingZeroDisplay: 'stripIfInteger'});
assertEquals("3.14", defaultFmt.format(3.1411));
assertEquals("3.14", autoFmt.format(3.1411));
assertEquals("3.14", stripIfIntegerFmt.format(3.1411));
assertEquals("3.00", defaultFmt.format(3.001411));
assertEquals("3.00", autoFmt.format(3.001411));
assertEquals("3", stripIfIntegerFmt.format(3.001411));
assertEquals("3.00", defaultFmt.format(2.999411));
assertEquals("3.00", autoFmt.format(2.999411));
assertEquals("3", stripIfIntegerFmt.format(2.999411));
...@@ -2578,66 +2578,11 @@ ...@@ -2578,66 +2578,11 @@
# https://bugs.chromium.org/p/v8/issues/detail?id=10776 # https://bugs.chromium.org/p/v8/issues/detail?id=10776
'intl402/NumberFormat/constructor-options-roundingMode-invalid': [FAIL],
'intl402/NumberFormat/constructor-options-throwing-getters-rounding-mode': [FAIL],
'intl402/NumberFormat/constructor-signDisplay-negative': [FAIL],
'intl402/NumberFormat/prototype/format/format-rounding-mode-ceil': [FAIL],
'intl402/NumberFormat/prototype/format/format-rounding-mode-expand': [FAIL],
'intl402/NumberFormat/prototype/format/format-rounding-mode-floor': [FAIL],
'intl402/NumberFormat/prototype/format/format-rounding-mode-half-ceil': [FAIL],
'intl402/NumberFormat/prototype/format/format-rounding-mode-half-even': [FAIL],
'intl402/NumberFormat/prototype/format/format-rounding-mode-half-floor': [FAIL],
'intl402/NumberFormat/prototype/format/format-rounding-mode-half-trunc': [FAIL],
'intl402/NumberFormat/prototype/format/format-rounding-mode-trunc': [FAIL],
'intl402/NumberFormat/prototype/format/signDisplay-negative-currency-de-DE': [FAIL],
'intl402/NumberFormat/prototype/format/signDisplay-negative-currency-en-US': [FAIL],
'intl402/NumberFormat/prototype/format/signDisplay-negative-currency-ja-JP': [FAIL],
'intl402/NumberFormat/prototype/format/signDisplay-negative-currency-ko-KR': [FAIL],
'intl402/NumberFormat/prototype/format/signDisplay-negative-currency-zh-TW': [FAIL],
'intl402/NumberFormat/prototype/format/signDisplay-negative-de-DE': [FAIL],
'intl402/NumberFormat/prototype/format/signDisplay-negative-en-US': [FAIL],
'intl402/NumberFormat/prototype/format/signDisplay-negative-ja-JP': [FAIL],
'intl402/NumberFormat/prototype/format/signDisplay-negative-ko-KR': [FAIL],
'intl402/NumberFormat/prototype/format/signDisplay-negative-zh-TW': [FAIL],
'intl402/NumberFormat/prototype/formatToParts/signDisplay-negative-currency-de-DE': [FAIL],
'intl402/NumberFormat/prototype/formatToParts/signDisplay-negative-currency-en-US': [FAIL],
'intl402/NumberFormat/prototype/formatToParts/signDisplay-negative-currency-ja-JP': [FAIL],
'intl402/NumberFormat/prototype/formatToParts/signDisplay-negative-currency-ko-KR': [FAIL],
'intl402/NumberFormat/prototype/formatToParts/signDisplay-negative-currency-zh-TW': [FAIL],
'intl402/NumberFormat/prototype/formatToParts/signDisplay-negative-de-DE': [FAIL],
'intl402/NumberFormat/prototype/formatToParts/signDisplay-negative-en-US': [FAIL],
'intl402/NumberFormat/prototype/formatToParts/signDisplay-negative-ja-JP': [FAIL],
'intl402/NumberFormat/prototype/formatToParts/signDisplay-negative-ko-KR': [FAIL],
'intl402/NumberFormat/prototype/formatToParts/signDisplay-negative-zh-TW': [FAIL],
'intl402/NumberFormat/prototype/resolvedOptions/roundingMode': [FAIL],
'intl402/NumberFormat/prototype/format/useGrouping-extended-de-DE': [FAIL],
'intl402/NumberFormat/prototype/format/useGrouping-extended-en-IN': [FAIL],
'intl402/NumberFormat/prototype/format/useGrouping-extended-en-US': [FAIL],
'intl402/NumberFormat/test-option-useGrouping-extended': [FAIL],
'intl402/NumberFormat/prototype/format/value-decimal-string': [FAIL],
'intl402/NumberFormat/constructor-options-throwing-getters-rounding-increment': [FAIL],
'intl402/NumberFormat/constructor-options-throwing-getters-rounding-priority': [FAIL],
'intl402/NumberFormat/constructor-options-throwing-getters-trailing-zero-display': [FAIL],
'intl402/NumberFormat/constructor-roundingIncrement': [FAIL], 'intl402/NumberFormat/constructor-roundingIncrement': [FAIL],
'intl402/NumberFormat/constructor-roundingIncrement-invalid': [FAIL], 'intl402/NumberFormat/test-option-roundingPriority': [FAIL],
'intl402/NumberFormat/constructor-trailingZeroDisplay': [FAIL], # NumberFormat.prototype.format
'intl402/NumberFormat/constructor-trailingZeroDisplay-invalid': [FAIL],
'intl402/NumberFormat/prototype/format/format-rounding-increment-1000': [FAIL],
'intl402/NumberFormat/prototype/format/format-rounding-increment-100': [FAIL],
'intl402/NumberFormat/prototype/format/format-rounding-increment-10': [FAIL],
'intl402/NumberFormat/prototype/format/format-rounding-increment-2000': [FAIL],
'intl402/NumberFormat/prototype/format/format-rounding-increment-200': [FAIL],
'intl402/NumberFormat/prototype/format/format-rounding-increment-20': [FAIL],
'intl402/NumberFormat/prototype/format/format-rounding-increment-2500': [FAIL],
'intl402/NumberFormat/prototype/format/format-rounding-increment-250': [FAIL],
'intl402/NumberFormat/prototype/format/format-rounding-increment-25': [FAIL],
'intl402/NumberFormat/prototype/format/format-rounding-increment-2': [FAIL],
'intl402/NumberFormat/prototype/format/format-rounding-increment-5000': [FAIL],
'intl402/NumberFormat/prototype/format/format-rounding-increment-500': [FAIL],
'intl402/NumberFormat/prototype/format/format-rounding-increment-50': [FAIL],
'intl402/NumberFormat/prototype/format/format-rounding-increment-5': [FAIL],
'intl402/NumberFormat/prototype/format/format-rounding-priority-less-precision': [FAIL], 'intl402/NumberFormat/prototype/format/format-rounding-priority-less-precision': [FAIL],
'intl402/NumberFormat/prototype/format/format-rounding-priority-more-precision': [FAIL], # NumberFormat.prototype.formatRange
'intl402/NumberFormat/prototype/formatRange/builtin': [FAIL], 'intl402/NumberFormat/prototype/formatRange/builtin': [FAIL],
'intl402/NumberFormat/prototype/formatRange/en-US': [FAIL], 'intl402/NumberFormat/prototype/formatRange/en-US': [FAIL],
'intl402/NumberFormat/prototype/formatRange/invoked-as-func': [FAIL], 'intl402/NumberFormat/prototype/formatRange/invoked-as-func': [FAIL],
...@@ -2646,6 +2591,8 @@ ...@@ -2646,6 +2591,8 @@
'intl402/NumberFormat/prototype/formatRange/nan-arguments-throws': [FAIL], 'intl402/NumberFormat/prototype/formatRange/nan-arguments-throws': [FAIL],
'intl402/NumberFormat/prototype/formatRange/prop-desc': [FAIL], 'intl402/NumberFormat/prototype/formatRange/prop-desc': [FAIL],
'intl402/NumberFormat/prototype/formatRange/pt-PT': [FAIL], 'intl402/NumberFormat/prototype/formatRange/pt-PT': [FAIL],
'intl402/NumberFormat/prototype/formatRange/x-greater-than-y-throws': [FAIL],
# NumberFormat.prototype.formatRangeToParts
'intl402/NumberFormat/prototype/formatRangeToParts/builtin': [FAIL], 'intl402/NumberFormat/prototype/formatRangeToParts/builtin': [FAIL],
'intl402/NumberFormat/prototype/formatRangeToParts/en-US': [FAIL], 'intl402/NumberFormat/prototype/formatRangeToParts/en-US': [FAIL],
'intl402/NumberFormat/prototype/formatRangeToParts/invoked-as-func': [FAIL], 'intl402/NumberFormat/prototype/formatRangeToParts/invoked-as-func': [FAIL],
...@@ -2654,19 +2601,22 @@ ...@@ -2654,19 +2601,22 @@
'intl402/NumberFormat/prototype/formatRangeToParts/nan-arguments-throws': [FAIL], 'intl402/NumberFormat/prototype/formatRangeToParts/nan-arguments-throws': [FAIL],
'intl402/NumberFormat/prototype/formatRangeToParts/prop-desc': [FAIL], 'intl402/NumberFormat/prototype/formatRangeToParts/prop-desc': [FAIL],
'intl402/NumberFormat/prototype/formatRangeToParts/x-greater-than-y-throws': [FAIL], 'intl402/NumberFormat/prototype/formatRangeToParts/x-greater-than-y-throws': [FAIL],
'intl402/NumberFormat/prototype/formatRange/x-greater-than-y-throws': [FAIL],
# NumberFormat.prototype.resolvedOptions
'intl402/NumberFormat/constructor-trailingZeroDisplay': [FAIL],
'intl402/NumberFormat/prototype/resolvedOptions/basic': [FAIL], 'intl402/NumberFormat/prototype/resolvedOptions/basic': [FAIL],
'intl402/NumberFormat/test-option-roundingPriority': [FAIL], 'intl402/NumberFormat/prototype/resolvedOptions/roundingMode': [FAIL],
'intl402/NumberFormat/test-option-useGrouping': [FAIL], 'intl402/NumberFormat/test-option-useGrouping': [FAIL],
'intl402/NumberFormat/test-option-useGrouping-extended': [FAIL],
# PluralRules.prototype.selectRange
'intl402/PluralRules/prototype/selectRange/default-en-us': [FAIL], 'intl402/PluralRules/prototype/selectRange/default-en-us': [FAIL],
'intl402/PluralRules/prototype/selectRange/invoked-as-func': [FAIL], 'intl402/PluralRules/prototype/selectRange/invoked-as-func': [FAIL],
'intl402/PluralRules/prototype/selectRange/length': [FAIL], 'intl402/PluralRules/prototype/selectRange/length': [FAIL],
'intl402/PluralRules/prototype/selectRange/name': [FAIL], 'intl402/PluralRules/prototype/selectRange/name': [FAIL],
'intl402/PluralRules/prototype/selectRange/nan-arguments-throws': [FAIL],
'intl402/PluralRules/prototype/selectRange/prop-desc': [FAIL], 'intl402/PluralRules/prototype/selectRange/prop-desc': [FAIL],
'intl402/PluralRules/prototype/selectRange/nan-arguments-throws': [FAIL],
'intl402/PluralRules/prototype/selectRange/x-greater-than-y-throws': [FAIL], 'intl402/PluralRules/prototype/selectRange/x-greater-than-y-throws': [FAIL],
# https://bugs.chromium.org/p/v8/issues/detail?id=11660 # https://bugs.chromium.org/p/v8/issues/detail?id=11660
'intl402/DurationFormat/prototype/prototype_attributes': [FAIL], 'intl402/DurationFormat/prototype/prototype_attributes': [FAIL],
'intl402/DurationFormat/prototype/toStringTag': [FAIL], 'intl402/DurationFormat/prototype/toStringTag': [FAIL],
......
...@@ -46,6 +46,7 @@ from testrunner.outproc import test262 ...@@ -46,6 +46,7 @@ from testrunner.outproc import test262
FEATURE_FLAGS = { FEATURE_FLAGS = {
'Intl.Locale-info': '--harmony_intl_locale_info', 'Intl.Locale-info': '--harmony_intl_locale_info',
'Intl-enumeration': '--harmony_intl_enumeration', 'Intl-enumeration': '--harmony_intl_enumeration',
'Intl.NumberFormat-v3': '--harmony_intl_number_format_v3',
'Symbol.prototype.description': '--harmony-symbol-description', 'Symbol.prototype.description': '--harmony-symbol-description',
'FinalizationRegistry': '--harmony-weak-refs-with-cleanup-some', 'FinalizationRegistry': '--harmony-weak-refs-with-cleanup-some',
'WeakRef': '--harmony-weak-refs-with-cleanup-some', 'WeakRef': '--harmony-weak-refs-with-cleanup-some',
......
...@@ -371,76 +371,76 @@ KNOWN_MAPS = { ...@@ -371,76 +371,76 @@ KNOWN_MAPS = {
("read_only_space", 0x033d9): (131, "BasicBlockCountersMarkerMap"), ("read_only_space", 0x033d9): (131, "BasicBlockCountersMarkerMap"),
("read_only_space", 0x0341d): (147, "ArrayBoilerplateDescriptionMap"), ("read_only_space", 0x0341d): (147, "ArrayBoilerplateDescriptionMap"),
("read_only_space", 0x0351d): (161, "InterceptorInfoMap"), ("read_only_space", 0x0351d): (161, "InterceptorInfoMap"),
("read_only_space", 0x05e25): (132, "PromiseFulfillReactionJobTaskMap"), ("read_only_space", 0x05e39): (132, "PromiseFulfillReactionJobTaskMap"),
("read_only_space", 0x05e4d): (133, "PromiseRejectReactionJobTaskMap"), ("read_only_space", 0x05e61): (133, "PromiseRejectReactionJobTaskMap"),
("read_only_space", 0x05e75): (134, "CallableTaskMap"), ("read_only_space", 0x05e89): (134, "CallableTaskMap"),
("read_only_space", 0x05e9d): (135, "CallbackTaskMap"), ("read_only_space", 0x05eb1): (135, "CallbackTaskMap"),
("read_only_space", 0x05ec5): (136, "PromiseResolveThenableJobTaskMap"), ("read_only_space", 0x05ed9): (136, "PromiseResolveThenableJobTaskMap"),
("read_only_space", 0x05eed): (139, "FunctionTemplateInfoMap"), ("read_only_space", 0x05f01): (139, "FunctionTemplateInfoMap"),
("read_only_space", 0x05f15): (140, "ObjectTemplateInfoMap"), ("read_only_space", 0x05f29): (140, "ObjectTemplateInfoMap"),
("read_only_space", 0x05f3d): (141, "AccessCheckInfoMap"), ("read_only_space", 0x05f51): (141, "AccessCheckInfoMap"),
("read_only_space", 0x05f65): (142, "AccessorInfoMap"), ("read_only_space", 0x05f79): (142, "AccessorInfoMap"),
("read_only_space", 0x05f8d): (143, "AccessorPairMap"), ("read_only_space", 0x05fa1): (143, "AccessorPairMap"),
("read_only_space", 0x05fb5): (144, "AliasedArgumentsEntryMap"), ("read_only_space", 0x05fc9): (144, "AliasedArgumentsEntryMap"),
("read_only_space", 0x05fdd): (145, "AllocationMementoMap"), ("read_only_space", 0x05ff1): (145, "AllocationMementoMap"),
("read_only_space", 0x06005): (148, "AsmWasmDataMap"), ("read_only_space", 0x06019): (148, "AsmWasmDataMap"),
("read_only_space", 0x0602d): (149, "AsyncGeneratorRequestMap"), ("read_only_space", 0x06041): (149, "AsyncGeneratorRequestMap"),
("read_only_space", 0x06055): (150, "BreakPointMap"), ("read_only_space", 0x06069): (150, "BreakPointMap"),
("read_only_space", 0x0607d): (151, "BreakPointInfoMap"), ("read_only_space", 0x06091): (151, "BreakPointInfoMap"),
("read_only_space", 0x060a5): (152, "CachedTemplateObjectMap"), ("read_only_space", 0x060b9): (152, "CachedTemplateObjectMap"),
("read_only_space", 0x060cd): (154, "CallSiteInfoMap"), ("read_only_space", 0x060e1): (154, "CallSiteInfoMap"),
("read_only_space", 0x060f5): (155, "ClassPositionsMap"), ("read_only_space", 0x06109): (155, "ClassPositionsMap"),
("read_only_space", 0x0611d): (156, "DebugInfoMap"), ("read_only_space", 0x06131): (156, "DebugInfoMap"),
("read_only_space", 0x06145): (158, "ErrorStackDataMap"), ("read_only_space", 0x06159): (158, "ErrorStackDataMap"),
("read_only_space", 0x0616d): (160, "FunctionTemplateRareDataMap"), ("read_only_space", 0x06181): (160, "FunctionTemplateRareDataMap"),
("read_only_space", 0x06195): (162, "InterpreterDataMap"), ("read_only_space", 0x061a9): (162, "InterpreterDataMap"),
("read_only_space", 0x061bd): (163, "ModuleRequestMap"), ("read_only_space", 0x061d1): (163, "ModuleRequestMap"),
("read_only_space", 0x061e5): (164, "PromiseCapabilityMap"), ("read_only_space", 0x061f9): (164, "PromiseCapabilityMap"),
("read_only_space", 0x0620d): (165, "PromiseReactionMap"), ("read_only_space", 0x06221): (165, "PromiseReactionMap"),
("read_only_space", 0x06235): (166, "PropertyDescriptorObjectMap"), ("read_only_space", 0x06249): (166, "PropertyDescriptorObjectMap"),
("read_only_space", 0x0625d): (167, "PrototypeInfoMap"), ("read_only_space", 0x06271): (167, "PrototypeInfoMap"),
("read_only_space", 0x06285): (168, "RegExpBoilerplateDescriptionMap"), ("read_only_space", 0x06299): (168, "RegExpBoilerplateDescriptionMap"),
("read_only_space", 0x062ad): (169, "ScriptMap"), ("read_only_space", 0x062c1): (169, "ScriptMap"),
("read_only_space", 0x062d5): (170, "ScriptOrModuleMap"), ("read_only_space", 0x062e9): (170, "ScriptOrModuleMap"),
("read_only_space", 0x062fd): (171, "SourceTextModuleInfoEntryMap"), ("read_only_space", 0x06311): (171, "SourceTextModuleInfoEntryMap"),
("read_only_space", 0x06325): (172, "StackFrameInfoMap"), ("read_only_space", 0x06339): (172, "StackFrameInfoMap"),
("read_only_space", 0x0634d): (173, "TemplateObjectDescriptionMap"), ("read_only_space", 0x06361): (173, "TemplateObjectDescriptionMap"),
("read_only_space", 0x06375): (174, "Tuple2Map"), ("read_only_space", 0x06389): (174, "Tuple2Map"),
("read_only_space", 0x0639d): (175, "WasmContinuationObjectMap"), ("read_only_space", 0x063b1): (175, "WasmContinuationObjectMap"),
("read_only_space", 0x063c5): (176, "WasmExceptionTagMap"), ("read_only_space", 0x063d9): (176, "WasmExceptionTagMap"),
("read_only_space", 0x063ed): (177, "WasmIndirectFunctionTableMap"), ("read_only_space", 0x06401): (177, "WasmIndirectFunctionTableMap"),
("read_only_space", 0x06415): (196, "SloppyArgumentsElementsMap"), ("read_only_space", 0x06429): (196, "SloppyArgumentsElementsMap"),
("read_only_space", 0x0643d): (231, "DescriptorArrayMap"), ("read_only_space", 0x06451): (231, "DescriptorArrayMap"),
("read_only_space", 0x06465): (219, "UncompiledDataWithoutPreparseDataMap"), ("read_only_space", 0x06479): (219, "UncompiledDataWithoutPreparseDataMap"),
("read_only_space", 0x0648d): (217, "UncompiledDataWithPreparseDataMap"), ("read_only_space", 0x064a1): (217, "UncompiledDataWithPreparseDataMap"),
("read_only_space", 0x064b5): (220, "UncompiledDataWithoutPreparseDataWithJobMap"), ("read_only_space", 0x064c9): (220, "UncompiledDataWithoutPreparseDataWithJobMap"),
("read_only_space", 0x064dd): (218, "UncompiledDataWithPreparseDataAndJobMap"), ("read_only_space", 0x064f1): (218, "UncompiledDataWithPreparseDataAndJobMap"),
("read_only_space", 0x06505): (250, "OnHeapBasicBlockProfilerDataMap"), ("read_only_space", 0x06519): (250, "OnHeapBasicBlockProfilerDataMap"),
("read_only_space", 0x0652d): (197, "TurbofanBitsetTypeMap"), ("read_only_space", 0x06541): (197, "TurbofanBitsetTypeMap"),
("read_only_space", 0x06555): (201, "TurbofanUnionTypeMap"), ("read_only_space", 0x06569): (201, "TurbofanUnionTypeMap"),
("read_only_space", 0x0657d): (200, "TurbofanRangeTypeMap"), ("read_only_space", 0x06591): (200, "TurbofanRangeTypeMap"),
("read_only_space", 0x065a5): (198, "TurbofanHeapConstantTypeMap"), ("read_only_space", 0x065b9): (198, "TurbofanHeapConstantTypeMap"),
("read_only_space", 0x065cd): (199, "TurbofanOtherNumberConstantTypeMap"), ("read_only_space", 0x065e1): (199, "TurbofanOtherNumberConstantTypeMap"),
("read_only_space", 0x065f5): (246, "InternalClassMap"), ("read_only_space", 0x06609): (246, "InternalClassMap"),
("read_only_space", 0x0661d): (257, "SmiPairMap"), ("read_only_space", 0x06631): (257, "SmiPairMap"),
("read_only_space", 0x06645): (256, "SmiBoxMap"), ("read_only_space", 0x06659): (256, "SmiBoxMap"),
("read_only_space", 0x0666d): (225, "ExportedSubClassBaseMap"), ("read_only_space", 0x06681): (225, "ExportedSubClassBaseMap"),
("read_only_space", 0x06695): (226, "ExportedSubClassMap"), ("read_only_space", 0x066a9): (226, "ExportedSubClassMap"),
("read_only_space", 0x066bd): (202, "AbstractInternalClassSubclass1Map"), ("read_only_space", 0x066d1): (202, "AbstractInternalClassSubclass1Map"),
("read_only_space", 0x066e5): (203, "AbstractInternalClassSubclass2Map"), ("read_only_space", 0x066f9): (203, "AbstractInternalClassSubclass2Map"),
("read_only_space", 0x0670d): (195, "InternalClassWithSmiElementsMap"), ("read_only_space", 0x06721): (195, "InternalClassWithSmiElementsMap"),
("read_only_space", 0x06735): (247, "InternalClassWithStructElementsMap"), ("read_only_space", 0x06749): (247, "InternalClassWithStructElementsMap"),
("read_only_space", 0x0675d): (227, "ExportedSubClass2Map"), ("read_only_space", 0x06771): (227, "ExportedSubClass2Map"),
("read_only_space", 0x06785): (258, "SortStateMap"), ("read_only_space", 0x06799): (258, "SortStateMap"),
("read_only_space", 0x067ad): (146, "AllocationSiteWithWeakNextMap"), ("read_only_space", 0x067c1): (146, "AllocationSiteWithWeakNextMap"),
("read_only_space", 0x067d5): (146, "AllocationSiteWithoutWeakNextMap"), ("read_only_space", 0x067e9): (146, "AllocationSiteWithoutWeakNextMap"),
("read_only_space", 0x067fd): (137, "LoadHandler1Map"), ("read_only_space", 0x06811): (137, "LoadHandler1Map"),
("read_only_space", 0x06825): (137, "LoadHandler2Map"), ("read_only_space", 0x06839): (137, "LoadHandler2Map"),
("read_only_space", 0x0684d): (137, "LoadHandler3Map"), ("read_only_space", 0x06861): (137, "LoadHandler3Map"),
("read_only_space", 0x06875): (138, "StoreHandler0Map"), ("read_only_space", 0x06889): (138, "StoreHandler0Map"),
("read_only_space", 0x0689d): (138, "StoreHandler1Map"), ("read_only_space", 0x068b1): (138, "StoreHandler1Map"),
("read_only_space", 0x068c5): (138, "StoreHandler2Map"), ("read_only_space", 0x068d9): (138, "StoreHandler2Map"),
("read_only_space", 0x068ed): (138, "StoreHandler3Map"), ("read_only_space", 0x06901): (138, "StoreHandler3Map"),
("map_space", 0x02149): (1057, "ExternalMap"), ("map_space", 0x02149): (1057, "ExternalMap"),
("map_space", 0x02171): (2114, "JSMessageObjectMap"), ("map_space", 0x02171): (2114, "JSMessageObjectMap"),
} }
......
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