[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}
This commit is contained in:
Frank Tang 2022-02-17 22:01:07 -08:00 committed by V8 LUCI CQ
parent 1b437aa87d
commit dfab3f44e8
9 changed files with 549 additions and 152 deletions

View File

@ -14,6 +14,7 @@
V(_, calendars_string, "calendars") \
V(_, cardinal_string, "cardinal") \
V(_, caseFirst_string, "caseFirst") \
V(_, ceil_string, "ceil") \
V(_, compare_string, "compare") \
V(_, collation_string, "collation") \
V(_, collations_string, "collations") \
@ -33,12 +34,14 @@
V(_, era_string, "era") \
V(_, eraYear_string, "eraYear") \
V(_, exceptZero_string, "exceptZero") \
V(_, expand_string, "expand") \
V(_, exponentInteger_string, "exponentInteger") \
V(_, exponentMinusSign_string, "exponentMinusSign") \
V(_, exponentSeparator_string, "exponentSeparator") \
V(_, fallback_string, "fallback") \
V(_, first_string, "first") \
V(_, firstDay_string, "firstDay") \
V(_, floor_string, "floor") \
V(_, format_string, "format") \
V(_, fraction_string, "fraction") \
V(_, fractionalSecond_string, "fractionalSecond") \
@ -51,6 +54,11 @@
V(_, h12_string, "h12") \
V(_, h23_string, "h23") \
V(_, h24_string, "h24") \
V(_, halfCeil_string, "halfCeil") \
V(_, halfEven_string, "halfEven") \
V(_, halfExpand_string, "halfExpand") \
V(_, halfFloor_string, "halfFloor") \
V(_, halfTrunc_string, "halfTrunc") \
V(_, hour12_string, "hour12") \
V(_, hourCycle_string, "hourCycle") \
V(_, hourCycles_string, "hourCycles") \
@ -62,6 +70,7 @@
V(_, kana_string, "kana") \
V(_, language_string, "language") \
V(_, languageDisplay_string, "languageDisplay") \
V(_, lessPrecision_string, "lessPrecision") \
V(_, letter_string, "letter") \
V(_, list_string, "list") \
V(_, literal_string, "literal") \
@ -71,11 +80,13 @@
V(_, ltr_string, "ltr") \
V(_, maximumFractionDigits_string, "maximumFractionDigits") \
V(_, maximumSignificantDigits_string, "maximumSignificantDigits") \
V(_, min2_string, "min2") \
V(_, minimalDays_string, "minimalDays") \
V(_, minimumFractionDigits_string, "minimumFractionDigits") \
V(_, minimumIntegerDigits_string, "minimumIntegerDigits") \
V(_, minimumSignificantDigits_string, "minimumSignificantDigits") \
V(_, minusSign_string, "minusSign") \
V(_, morePrecision_string, "morePrecision") \
V(_, nan_string, "nan") \
V(_, narrowSymbol_string, "narrowSymbol") \
V(_, negative_string, "negative") \
@ -92,6 +103,8 @@
V(_, quarter_string, "quarter") \
V(_, region_string, "region") \
V(_, relatedYear_string, "relatedYear") \
V(_, roundingMode_string, "roundingMode") \
V(_, roundingPriority_string, "roundingPriority") \
V(_, rtl_string, "rtl") \
V(_, scientific_string, "scientific") \
V(_, segment_string, "segment") \
@ -104,12 +117,15 @@
V(_, standard_string, "standard") \
V(_, startRange_string, "startRange") \
V(_, strict_string, "strict") \
V(_, stripIfInteger_string, "stripIfInteger") \
V(_, style_string, "style") \
V(_, term_string, "term") \
V(_, textInfo_string, "textInfo") \
V(_, timeStyle_string, "timeStyle") \
V(_, timeZones_string, "timeZones") \
V(_, timeZoneName_string, "timeZoneName") \
V(_, trailingZeroDisplay_string, "trailingZeroDisplay") \
V(_, trunc_string, "trunc") \
V(_, type_string, "type") \
V(_, unknown_string, "unknown") \
V(_, upper_string, "upper") \

View File

@ -411,6 +411,35 @@ bool UseGroupingFromSkeleton(const icu::UnicodeString& skeleton) {
return skeleton.indexOf("group-off") == -1;
}
Handle<Object> UseGroupingFromSkeleton(Isolate* isolate,
const icu::UnicodeString& skeleton) {
Factory* factory = isolate->factory();
static const char* group = "group-";
int32_t start = skeleton.indexOf(group);
if (start >= 0) {
DCHECK_EQ(6, strlen(group));
icu::UnicodeString check = skeleton.tempSubString(start + 6);
// Ex: skeleton as
// .### rounding-mode-half-up group-off
if (check.startsWith("off")) {
return factory->false_value();
}
// Ex: skeleton as
// .### rounding-mode-half-up group-min2
if (check.startsWith("min2")) {
return ReadOnlyRoots(isolate).min2_string_handle();
}
// Ex: skeleton as
// .### rounding-mode-half-up group-on-aligned
if (check.startsWith("on-aligned")) {
return ReadOnlyRoots(isolate).always_string_handle();
}
}
// Ex: skeleton as
// .###
return ReadOnlyRoots(isolate).auto_string_handle();
}
// Parse currency code from skeleton. For example, skeleton as
// "currency/TWD .00 rounding-mode-half-up unit-width-full-name;"
const icu::UnicodeString CurrencyFromSkeleton(
@ -547,6 +576,109 @@ Handle<String> SignDisplayString(Isolate* isolate,
return ReadOnlyRoots(isolate).auto_string_handle();
}
// Return RoundingMode as string based on skeleton.
Handle<String> RoundingModeString(Isolate* isolate,
const icu::UnicodeString& skeleton) {
static const char* rounding_mode = "rounding-mode-";
int32_t start = skeleton.indexOf(rounding_mode);
if (start >= 0) {
DCHECK_EQ(14, strlen(rounding_mode));
icu::UnicodeString check = skeleton.tempSubString(start + 14);
// Ex: skeleton as
// .### rounding-mode-ceiling
if (check.startsWith("ceiling")) {
return ReadOnlyRoots(isolate).ceil_string_handle();
}
// Ex: skeleton as
// .### rounding-mode-down
if (check.startsWith("down")) {
return ReadOnlyRoots(isolate).trunc_string_handle();
}
// Ex: skeleton as
// .### rounding-mode-floor
if (check.startsWith("floor")) {
return ReadOnlyRoots(isolate).floor_string_handle();
}
// Ex: skeleton as
// .### rounding-mode-half-ceiling
if (check.startsWith("half-ceiling")) {
return ReadOnlyRoots(isolate).halfCeil_string_handle();
}
// Ex: skeleton as
// .### rounding-mode-half-down
if (check.startsWith("half-down")) {
return ReadOnlyRoots(isolate).halfTrunc_string_handle();
}
// Ex: skeleton as
// .### rounding-mode-half-floor
if (check.startsWith("half-floor")) {
return ReadOnlyRoots(isolate).halfFloor_string_handle();
}
// Ex: skeleton as
// .### rounding-mode-half-up
if (check.startsWith("half-up")) {
return ReadOnlyRoots(isolate).halfExpand_string_handle();
}
// Ex: skeleton as
// .### rounding-mode-up
if (check.startsWith("up")) {
return ReadOnlyRoots(isolate).expand_string_handle();
}
}
// Ex: skeleton as
// .###
return ReadOnlyRoots(isolate).halfEven_string_handle();
}
Handle<Object> RoundingIncrement(Isolate* isolate,
const icu::UnicodeString& skeleton) {
int32_t cur = skeleton.indexOf(u"precision-increment/");
if (cur < 0) return isolate->factory()->NewNumberFromInt(1);
cur += 20; // length of "precision-increment/"
int32_t increment = 0;
while (cur < skeleton.length()) {
char16_t c = skeleton[cur++];
if (c == u'.') continue;
if (!IsDecimalDigit(c)) break;
increment = increment * 10 + (c - '0');
}
return isolate->factory()->NewNumberFromInt(increment);
}
// Return RoundingPriority as string based on skeleton.
Handle<String> RoundingPriorityString(Isolate* isolate,
const icu::UnicodeString& skeleton) {
int32_t found;
// If #r or @r is followed by a SPACE or in the end of line.
if ((found = skeleton.indexOf("#r")) >= 0 ||
(found = skeleton.indexOf("@r")) >= 0) {
if (found + 2 == skeleton.length() || skeleton[found + 2] == ' ') {
return ReadOnlyRoots(isolate).morePrecision_string_handle();
}
}
// If #s or @s is followed by a SPACE or in the end of line.
if ((found = skeleton.indexOf("#s")) >= 0 ||
(found = skeleton.indexOf("@s")) >= 0) {
if (found + 2 == skeleton.length() || skeleton[found + 2] == ' ') {
return ReadOnlyRoots(isolate).morePrecision_string_handle();
}
}
return ReadOnlyRoots(isolate).auto_string_handle();
}
// Return trailingZeroDisplay as string based on skeleton.
Handle<String> TrailingZeroDisplayString(Isolate* isolate,
const icu::UnicodeString& skeleton) {
int32_t found;
if ((found = skeleton.indexOf("/w")) >= 0) {
if (found + 2 == skeleton.length() || skeleton[found + 2] == ' ') {
return ReadOnlyRoots(isolate).stripIfInteger_string_handle();
}
}
return ReadOnlyRoots(isolate).auto_string_handle();
}
} // anonymous namespace
// Return the minimum integer digits by counting the number of '0' after
@ -815,6 +947,11 @@ Handle<JSObject> JSNumberFormat::ResolvedOptions(
// [[Notation]] "notation"
// [[CompactDisplay]] "compactDisplay"
// [[SignDisplay]] "signDisplay"
//
// For v3
// [[RoundingMode]] "roundingMode"
// [[RoundingIncrement]] "roundingIncrement"
// [[TrailingZeroDisplay]] "trailingZeroDisplay"
CHECK(JSReceiver::CreateDataProperty(isolate, options,
factory->locale_string(), locale,
@ -895,11 +1032,18 @@ Handle<JSObject> JSNumberFormat::ResolvedOptions(
.FromJust());
}
CHECK(JSReceiver::CreateDataProperty(
isolate, options, factory->useGrouping_string(),
factory->ToBoolean(UseGroupingFromSkeleton(skeleton)),
Just(kDontThrow))
.FromJust());
if (FLAG_harmony_intl_number_format_v3) {
CHECK(JSReceiver::CreateDataProperty(
isolate, options, factory->useGrouping_string(),
UseGroupingFromSkeleton(isolate, skeleton), Just(kDontThrow))
.FromJust());
} else {
CHECK(JSReceiver::CreateDataProperty(
isolate, options, factory->useGrouping_string(),
factory->ToBoolean(UseGroupingFromSkeleton(skeleton)),
Just(kDontThrow))
.FromJust());
}
Notation notation = NotationFromSkeleton(skeleton);
CHECK(JSReceiver::CreateDataProperty(
@ -917,6 +1061,24 @@ Handle<JSObject> JSNumberFormat::ResolvedOptions(
isolate, options, factory->signDisplay_string(),
SignDisplayString(isolate, skeleton), Just(kDontThrow))
.FromJust());
if (FLAG_harmony_intl_number_format_v3) {
CHECK(JSReceiver::CreateDataProperty(
isolate, options, factory->roundingMode_string(),
RoundingModeString(isolate, skeleton), Just(kDontThrow))
.FromJust());
CHECK(JSReceiver::CreateDataProperty(
isolate, options, factory->roundingIncrement_string(),
RoundingIncrement(isolate, skeleton), Just(kDontThrow))
.FromJust());
CHECK(JSReceiver::CreateDataProperty(
isolate, options, factory->trailingZeroDisplay_string(),
TrailingZeroDisplayString(isolate, skeleton), Just(kDontThrow))
.FromJust());
CHECK(JSReceiver::CreateDataProperty(
isolate, options, factory->roundingPriority_string(),
RoundingPriorityString(isolate, skeleton), Just(kDontThrow))
.FromJust());
}
return options;
}

View File

@ -108,24 +108,26 @@ V8_WARN_UNUSED_RESULT static Maybe<T> GetStringOrBooleanOption(
// 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]);
{
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]);
}
}
}
}
}
} // end of no_gc
THROW_NEW_ERROR_RETURN_VALUE(
isolate,
NewRangeError(MessageTemplate::kValueOutOfRange, value,

View File

@ -0,0 +1,30 @@
// Copyright 2022 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
// Check the rounding behavior.
// Based on https://tc39.es/proposal-intl-numberformat-v3/out/numberformat/diff.html#table-intl-rounding-modes
let inputs = [-1.5, 0.4, 0.5, 0.6, 1.5];
let expectations = {
"ceil": ["-1", "1", "1", "1", "2"],
"floor": ["-2", "0", "0", "0", "1"],
"expand": ["-2", "1", "1", "1", "2"],
"trunc": ["-1", "0", "0", "0", "1"],
"halfCeil": ["-1", "0", "1", "1", "2"],
"halfFloor": ["-2", "0", "0", "1", "1"],
"halfExpand": ["-2", "0", "1", "1", "2"],
"halfTrunc": ["-1", "0", "0", "1", "1"],
"halfEven": ["-2", "0", "0", "1", "2"],
};
Object.keys(expectations).forEach(function(roundingMode) {
let exp = expectations[roundingMode];
let idx = 0;
let nf = new Intl.NumberFormat("en", {roundingMode, maximumFractionDigits: 0});
assertEquals(roundingMode, nf.resolvedOptions().roundingMode);
inputs.forEach(function(input) {
let msg = "input: " + input + " with roundingMode: " + roundingMode;
assertEquals(exp[idx++], nf.format(input), msg);
})
});

View File

@ -0,0 +1,60 @@
// 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 validRoundingMode = [
"ceil",
"floor",
"expand",
"halfCeil",
"halfExpand",
"halfFloor",
"halfTrunc",
"halfEven",
"trunc",
];
let invalidRoundingMode = [
"ceiling",
"down",
"Down",
"flooring",
"halfDown",
"halfUp",
"halfup",
"halfeven",
"halfdown",
"half-up",
"half-even",
"half-down",
"up",
"Up",
];
validRoundingMode.forEach(function(roundingMode) {
let nf = new Intl.NumberFormat(undefined, {roundingMode});
assertEquals(roundingMode, nf.resolvedOptions().roundingMode);
});
invalidRoundingMode.forEach(function(roundingMode) {
assertThrows(() => {
let nf = new Intl.NumberFormat(undefined, {roundingMode}); });
});
// Check default is "halfExpand"
assertEquals("halfExpand", (new Intl.NumberFormat().resolvedOptions().roundingMode));
assertEquals("halfExpand", (new Intl.NumberFormat(
undefined, {roundingMode: undefined}).resolvedOptions().roundingMode));
// Check roundingMode is read once after reading signDisplay
let read = [];
let options = {
get signDisplay() { read.push('signDisplay'); return undefined; },
get roundingMode() { read.push('roundingMode'); return undefined; },
};
assertDoesNotThrow(() => new Intl.NumberFormat(undefined, options));
assertEquals("signDisplay,roundingMode", read.join(","));

View File

@ -0,0 +1,19 @@
// 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("auto", defaultFmt.resolvedOptions().trailingZeroDisplay);
assertEquals("auto", autoFmt.resolvedOptions().trailingZeroDisplay);
assertEquals("stripIfInteger",
stripIfIntegerFmt.resolvedOptions().trailingZeroDisplay);

View File

@ -0,0 +1,114 @@
// Copyright 2020 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 validUseGrouping = [
"min2",
"auto",
"always",
false,
];
let invalidUseGrouping = [
"min-2",
"true",
];
validUseGrouping.forEach(function(useGrouping) {
let nf = new Intl.NumberFormat(undefined, {useGrouping});
assertEquals(useGrouping, nf.resolvedOptions().useGrouping);
});
invalidUseGrouping.forEach(function(useGrouping) {
assertThrows(() => {
let nf = new Intl.NumberFormat(undefined, {useGrouping}); });
});
// useGrouping: undefined get "auto"
assertEquals("auto",
(new Intl.NumberFormat()).resolvedOptions().useGrouping);
assertEquals("auto",
(new Intl.NumberFormat(undefined, {useGrouping: undefined}))
.resolvedOptions().useGrouping);
// useGrouping: true get "always"
assertEquals("always",
(new Intl.NumberFormat(undefined, {useGrouping: true}))
.resolvedOptions().useGrouping);
// useGrouping: false get false
// useGrouping: "" get false
assertEquals(false,
(new Intl.NumberFormat(undefined, {useGrouping: false}))
.resolvedOptions().useGrouping);
assertEquals(false,
(new Intl.NumberFormat(undefined, {useGrouping: ""}))
.resolvedOptions().useGrouping);
// Some locales with default minimumGroupingDigits
let mgd1 = ["en"];
// Some locales with default minimumGroupingDigits{"2"}
let mgd2 = ["es", "pl", "lv"];
let all = mgd1.concat(mgd2);
// Check "always"
all.forEach(function(locale) {
let off = new Intl.NumberFormat(locale, {useGrouping: false});
let msg = "locale: " + locale + " useGrouping: false";
// In useGrouping: false, no grouping.
assertEquals(3, off.format(123).length, msg);
assertEquals(4, off.format(1234).length, msg);
assertEquals(5, off.format(12345).length, msg);
assertEquals(6, off.format(123456).length, msg);
assertEquals(7, off.format(1234567).length, msg);
});
// Check false
all.forEach(function(locale) {
let always = new Intl.NumberFormat(locale, {useGrouping: "always"});
let msg = "locale: " + locale + " useGrouping: 'always'";
assertEquals(3, always.format(123).length);
// In useGrouping: "always", has grouping when more than 3 digits..
assertEquals(4 + 1, always.format(1234).length, msg);
assertEquals(5 + 1, always.format(12345).length, msg);
assertEquals(6 + 1, always.format(123456).length, msg);
assertEquals(7 + 2, always.format(1234567).length, msg);
});
// Check "min2"
all.forEach(function(locale) {
let always = new Intl.NumberFormat(locale, {useGrouping: "min2"});
let msg = "locale: " + locale + " useGrouping: 'min2'";
assertEquals(3, always.format(123).length);
// In useGrouping: "min2", no grouping for 4 digits but has grouping
// when more than 4 digits..
assertEquals(4, always.format(1234).length, msg);
assertEquals(5 + 1, always.format(12345).length, msg);
assertEquals(6 + 1, always.format(123456).length, msg);
assertEquals(7 + 2, always.format(1234567).length, msg);
});
// Check "auto"
mgd1.forEach(function(locale) {
let auto = new Intl.NumberFormat(locale, {useGrouping: "auto"});
let msg = "locale: " + locale + " useGrouping: 'auto'";
assertEquals(3, auto.format(123).length, msg);
assertEquals(4 + 1, auto.format(1234).length, msg);
assertEquals(5 + 1, auto.format(12345).length, msg);
assertEquals(6 + 1, auto.format(123456).length, msg);
assertEquals(7 + 2, auto.format(1234567).length, msg);
});
mgd2.forEach(function(locale) {
let auto = new Intl.NumberFormat(locale, {useGrouping: "auto"});
let msg = "locale: " + locale + " useGrouping: 'auto'";
assertEquals(3, auto.format(123).length, msg);
// In useGrouping: "auto", since these locales has
// minimumGroupingDigits{"2"}, no grouping for 4 digits but has grouping
// when more than 4 digits..
assertEquals(4, auto.format(1234).length, msg);
assertEquals(5 + 1, auto.format(12345).length, msg);
assertEquals(6 + 1, auto.format(123456).length, msg);
assertEquals(7 + 2, auto.format(1234567).length, msg);
});

View File

@ -2549,12 +2549,6 @@
'intl402/NumberFormat/prototype/formatRangeToParts/prop-desc': [FAIL],
'intl402/NumberFormat/prototype/formatRangeToParts/x-greater-than-y-throws': [FAIL],
# NumberFormat.prototype.resolvedOptions
'intl402/NumberFormat/constructor-trailingZeroDisplay': [FAIL],
'intl402/NumberFormat/prototype/resolvedOptions/basic': [FAIL],
'intl402/NumberFormat/prototype/resolvedOptions/roundingMode': [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/invoked-as-func': [FAIL],

View File

@ -374,76 +374,76 @@ KNOWN_MAPS = {
("read_only_space", 0x033d9): (131, "BasicBlockCountersMarkerMap"),
("read_only_space", 0x0341d): (147, "ArrayBoilerplateDescriptionMap"),
("read_only_space", 0x0351d): (161, "InterceptorInfoMap"),
("read_only_space", 0x05e69): (132, "PromiseFulfillReactionJobTaskMap"),
("read_only_space", 0x05e91): (133, "PromiseRejectReactionJobTaskMap"),
("read_only_space", 0x05eb9): (134, "CallableTaskMap"),
("read_only_space", 0x05ee1): (135, "CallbackTaskMap"),
("read_only_space", 0x05f09): (136, "PromiseResolveThenableJobTaskMap"),
("read_only_space", 0x05f31): (139, "FunctionTemplateInfoMap"),
("read_only_space", 0x05f59): (140, "ObjectTemplateInfoMap"),
("read_only_space", 0x05f81): (141, "AccessCheckInfoMap"),
("read_only_space", 0x05fa9): (142, "AccessorInfoMap"),
("read_only_space", 0x05fd1): (143, "AccessorPairMap"),
("read_only_space", 0x05ff9): (144, "AliasedArgumentsEntryMap"),
("read_only_space", 0x06021): (145, "AllocationMementoMap"),
("read_only_space", 0x06049): (148, "AsmWasmDataMap"),
("read_only_space", 0x06071): (149, "AsyncGeneratorRequestMap"),
("read_only_space", 0x06099): (150, "BreakPointMap"),
("read_only_space", 0x060c1): (151, "BreakPointInfoMap"),
("read_only_space", 0x060e9): (152, "CachedTemplateObjectMap"),
("read_only_space", 0x06111): (154, "CallSiteInfoMap"),
("read_only_space", 0x06139): (155, "ClassPositionsMap"),
("read_only_space", 0x06161): (156, "DebugInfoMap"),
("read_only_space", 0x06189): (158, "ErrorStackDataMap"),
("read_only_space", 0x061b1): (160, "FunctionTemplateRareDataMap"),
("read_only_space", 0x061d9): (162, "InterpreterDataMap"),
("read_only_space", 0x06201): (163, "ModuleRequestMap"),
("read_only_space", 0x06229): (164, "PromiseCapabilityMap"),
("read_only_space", 0x06251): (165, "PromiseReactionMap"),
("read_only_space", 0x06279): (166, "PropertyDescriptorObjectMap"),
("read_only_space", 0x062a1): (167, "PrototypeInfoMap"),
("read_only_space", 0x062c9): (168, "RegExpBoilerplateDescriptionMap"),
("read_only_space", 0x062f1): (169, "ScriptMap"),
("read_only_space", 0x06319): (170, "ScriptOrModuleMap"),
("read_only_space", 0x06341): (171, "SourceTextModuleInfoEntryMap"),
("read_only_space", 0x06369): (172, "StackFrameInfoMap"),
("read_only_space", 0x06391): (173, "TemplateObjectDescriptionMap"),
("read_only_space", 0x063b9): (174, "Tuple2Map"),
("read_only_space", 0x063e1): (175, "WasmContinuationObjectMap"),
("read_only_space", 0x06409): (176, "WasmExceptionTagMap"),
("read_only_space", 0x06431): (177, "WasmIndirectFunctionTableMap"),
("read_only_space", 0x06459): (196, "SloppyArgumentsElementsMap"),
("read_only_space", 0x06481): (231, "DescriptorArrayMap"),
("read_only_space", 0x064a9): (219, "UncompiledDataWithoutPreparseDataMap"),
("read_only_space", 0x064d1): (217, "UncompiledDataWithPreparseDataMap"),
("read_only_space", 0x064f9): (220, "UncompiledDataWithoutPreparseDataWithJobMap"),
("read_only_space", 0x06521): (218, "UncompiledDataWithPreparseDataAndJobMap"),
("read_only_space", 0x06549): (250, "OnHeapBasicBlockProfilerDataMap"),
("read_only_space", 0x06571): (197, "TurbofanBitsetTypeMap"),
("read_only_space", 0x06599): (201, "TurbofanUnionTypeMap"),
("read_only_space", 0x065c1): (200, "TurbofanRangeTypeMap"),
("read_only_space", 0x065e9): (198, "TurbofanHeapConstantTypeMap"),
("read_only_space", 0x06611): (199, "TurbofanOtherNumberConstantTypeMap"),
("read_only_space", 0x06639): (246, "InternalClassMap"),
("read_only_space", 0x06661): (257, "SmiPairMap"),
("read_only_space", 0x06689): (256, "SmiBoxMap"),
("read_only_space", 0x066b1): (225, "ExportedSubClassBaseMap"),
("read_only_space", 0x066d9): (226, "ExportedSubClassMap"),
("read_only_space", 0x06701): (202, "AbstractInternalClassSubclass1Map"),
("read_only_space", 0x06729): (203, "AbstractInternalClassSubclass2Map"),
("read_only_space", 0x06751): (195, "InternalClassWithSmiElementsMap"),
("read_only_space", 0x06779): (247, "InternalClassWithStructElementsMap"),
("read_only_space", 0x067a1): (227, "ExportedSubClass2Map"),
("read_only_space", 0x067c9): (258, "SortStateMap"),
("read_only_space", 0x067f1): (146, "AllocationSiteWithWeakNextMap"),
("read_only_space", 0x06819): (146, "AllocationSiteWithoutWeakNextMap"),
("read_only_space", 0x06841): (137, "LoadHandler1Map"),
("read_only_space", 0x06869): (137, "LoadHandler2Map"),
("read_only_space", 0x06891): (137, "LoadHandler3Map"),
("read_only_space", 0x068b9): (138, "StoreHandler0Map"),
("read_only_space", 0x068e1): (138, "StoreHandler1Map"),
("read_only_space", 0x06909): (138, "StoreHandler2Map"),
("read_only_space", 0x06931): (138, "StoreHandler3Map"),
("read_only_space", 0x05fdd): (132, "PromiseFulfillReactionJobTaskMap"),
("read_only_space", 0x06005): (133, "PromiseRejectReactionJobTaskMap"),
("read_only_space", 0x0602d): (134, "CallableTaskMap"),
("read_only_space", 0x06055): (135, "CallbackTaskMap"),
("read_only_space", 0x0607d): (136, "PromiseResolveThenableJobTaskMap"),
("read_only_space", 0x060a5): (139, "FunctionTemplateInfoMap"),
("read_only_space", 0x060cd): (140, "ObjectTemplateInfoMap"),
("read_only_space", 0x060f5): (141, "AccessCheckInfoMap"),
("read_only_space", 0x0611d): (142, "AccessorInfoMap"),
("read_only_space", 0x06145): (143, "AccessorPairMap"),
("read_only_space", 0x0616d): (144, "AliasedArgumentsEntryMap"),
("read_only_space", 0x06195): (145, "AllocationMementoMap"),
("read_only_space", 0x061bd): (148, "AsmWasmDataMap"),
("read_only_space", 0x061e5): (149, "AsyncGeneratorRequestMap"),
("read_only_space", 0x0620d): (150, "BreakPointMap"),
("read_only_space", 0x06235): (151, "BreakPointInfoMap"),
("read_only_space", 0x0625d): (152, "CachedTemplateObjectMap"),
("read_only_space", 0x06285): (154, "CallSiteInfoMap"),
("read_only_space", 0x062ad): (155, "ClassPositionsMap"),
("read_only_space", 0x062d5): (156, "DebugInfoMap"),
("read_only_space", 0x062fd): (158, "ErrorStackDataMap"),
("read_only_space", 0x06325): (160, "FunctionTemplateRareDataMap"),
("read_only_space", 0x0634d): (162, "InterpreterDataMap"),
("read_only_space", 0x06375): (163, "ModuleRequestMap"),
("read_only_space", 0x0639d): (164, "PromiseCapabilityMap"),
("read_only_space", 0x063c5): (165, "PromiseReactionMap"),
("read_only_space", 0x063ed): (166, "PropertyDescriptorObjectMap"),
("read_only_space", 0x06415): (167, "PrototypeInfoMap"),
("read_only_space", 0x0643d): (168, "RegExpBoilerplateDescriptionMap"),
("read_only_space", 0x06465): (169, "ScriptMap"),
("read_only_space", 0x0648d): (170, "ScriptOrModuleMap"),
("read_only_space", 0x064b5): (171, "SourceTextModuleInfoEntryMap"),
("read_only_space", 0x064dd): (172, "StackFrameInfoMap"),
("read_only_space", 0x06505): (173, "TemplateObjectDescriptionMap"),
("read_only_space", 0x0652d): (174, "Tuple2Map"),
("read_only_space", 0x06555): (175, "WasmContinuationObjectMap"),
("read_only_space", 0x0657d): (176, "WasmExceptionTagMap"),
("read_only_space", 0x065a5): (177, "WasmIndirectFunctionTableMap"),
("read_only_space", 0x065cd): (196, "SloppyArgumentsElementsMap"),
("read_only_space", 0x065f5): (231, "DescriptorArrayMap"),
("read_only_space", 0x0661d): (219, "UncompiledDataWithoutPreparseDataMap"),
("read_only_space", 0x06645): (217, "UncompiledDataWithPreparseDataMap"),
("read_only_space", 0x0666d): (220, "UncompiledDataWithoutPreparseDataWithJobMap"),
("read_only_space", 0x06695): (218, "UncompiledDataWithPreparseDataAndJobMap"),
("read_only_space", 0x066bd): (250, "OnHeapBasicBlockProfilerDataMap"),
("read_only_space", 0x066e5): (197, "TurbofanBitsetTypeMap"),
("read_only_space", 0x0670d): (201, "TurbofanUnionTypeMap"),
("read_only_space", 0x06735): (200, "TurbofanRangeTypeMap"),
("read_only_space", 0x0675d): (198, "TurbofanHeapConstantTypeMap"),
("read_only_space", 0x06785): (199, "TurbofanOtherNumberConstantTypeMap"),
("read_only_space", 0x067ad): (246, "InternalClassMap"),
("read_only_space", 0x067d5): (257, "SmiPairMap"),
("read_only_space", 0x067fd): (256, "SmiBoxMap"),
("read_only_space", 0x06825): (225, "ExportedSubClassBaseMap"),
("read_only_space", 0x0684d): (226, "ExportedSubClassMap"),
("read_only_space", 0x06875): (202, "AbstractInternalClassSubclass1Map"),
("read_only_space", 0x0689d): (203, "AbstractInternalClassSubclass2Map"),
("read_only_space", 0x068c5): (195, "InternalClassWithSmiElementsMap"),
("read_only_space", 0x068ed): (247, "InternalClassWithStructElementsMap"),
("read_only_space", 0x06915): (227, "ExportedSubClass2Map"),
("read_only_space", 0x0693d): (258, "SortStateMap"),
("read_only_space", 0x06965): (146, "AllocationSiteWithWeakNextMap"),
("read_only_space", 0x0698d): (146, "AllocationSiteWithoutWeakNextMap"),
("read_only_space", 0x069b5): (137, "LoadHandler1Map"),
("read_only_space", 0x069dd): (137, "LoadHandler2Map"),
("read_only_space", 0x06a05): (137, "LoadHandler3Map"),
("read_only_space", 0x06a2d): (138, "StoreHandler0Map"),
("read_only_space", 0x06a55): (138, "StoreHandler1Map"),
("read_only_space", 0x06a7d): (138, "StoreHandler2Map"),
("read_only_space", 0x06aa5): (138, "StoreHandler3Map"),
("map_space", 0x02149): (1057, "ExternalMap"),
("map_space", 0x02171): (2114, "JSMessageObjectMap"),
}
@ -494,62 +494,62 @@ KNOWN_OBJECTS = {
("read_only_space", 0x03665): "EmptyFunctionScopeInfo",
("read_only_space", 0x03689): "NativeScopeInfo",
("read_only_space", 0x036a1): "HashSeed",
("old_space", 0x0422d): "ArgumentsIteratorAccessor",
("old_space", 0x04271): "ArrayLengthAccessor",
("old_space", 0x042b5): "BoundFunctionLengthAccessor",
("old_space", 0x042f9): "BoundFunctionNameAccessor",
("old_space", 0x0433d): "ErrorStackAccessor",
("old_space", 0x04381): "FunctionArgumentsAccessor",
("old_space", 0x043c5): "FunctionCallerAccessor",
("old_space", 0x04409): "FunctionNameAccessor",
("old_space", 0x0444d): "FunctionLengthAccessor",
("old_space", 0x04491): "FunctionPrototypeAccessor",
("old_space", 0x044d5): "StringLengthAccessor",
("old_space", 0x04519): "InvalidPrototypeValidityCell",
("old_space", 0x04521): "EmptyScript",
("old_space", 0x04561): "ManyClosuresCell",
("old_space", 0x0456d): "ArrayConstructorProtector",
("old_space", 0x04581): "NoElementsProtector",
("old_space", 0x04595): "MegaDOMProtector",
("old_space", 0x045a9): "IsConcatSpreadableProtector",
("old_space", 0x045bd): "ArraySpeciesProtector",
("old_space", 0x045d1): "TypedArraySpeciesProtector",
("old_space", 0x045e5): "PromiseSpeciesProtector",
("old_space", 0x045f9): "RegExpSpeciesProtector",
("old_space", 0x0460d): "StringLengthProtector",
("old_space", 0x04621): "ArrayIteratorProtector",
("old_space", 0x04635): "ArrayBufferDetachingProtector",
("old_space", 0x04649): "PromiseHookProtector",
("old_space", 0x0465d): "PromiseResolveProtector",
("old_space", 0x04671): "MapIteratorProtector",
("old_space", 0x04685): "PromiseThenProtector",
("old_space", 0x04699): "SetIteratorProtector",
("old_space", 0x046ad): "StringIteratorProtector",
("old_space", 0x046c1): "SingleCharacterStringCache",
("old_space", 0x04ac9): "StringSplitCache",
("old_space", 0x04ed1): "RegExpMultipleCache",
("old_space", 0x052d9): "BuiltinsConstantsTable",
("old_space", 0x05705): "AsyncFunctionAwaitRejectSharedFun",
("old_space", 0x05729): "AsyncFunctionAwaitResolveSharedFun",
("old_space", 0x0574d): "AsyncGeneratorAwaitRejectSharedFun",
("old_space", 0x05771): "AsyncGeneratorAwaitResolveSharedFun",
("old_space", 0x05795): "AsyncGeneratorYieldResolveSharedFun",
("old_space", 0x057b9): "AsyncGeneratorReturnResolveSharedFun",
("old_space", 0x057dd): "AsyncGeneratorReturnClosedRejectSharedFun",
("old_space", 0x05801): "AsyncGeneratorReturnClosedResolveSharedFun",
("old_space", 0x05825): "AsyncIteratorValueUnwrapSharedFun",
("old_space", 0x05849): "PromiseAllResolveElementSharedFun",
("old_space", 0x0586d): "PromiseAllSettledResolveElementSharedFun",
("old_space", 0x05891): "PromiseAllSettledRejectElementSharedFun",
("old_space", 0x058b5): "PromiseAnyRejectElementSharedFun",
("old_space", 0x058d9): "PromiseCapabilityDefaultRejectSharedFun",
("old_space", 0x058fd): "PromiseCapabilityDefaultResolveSharedFun",
("old_space", 0x05921): "PromiseCatchFinallySharedFun",
("old_space", 0x05945): "PromiseGetCapabilitiesExecutorSharedFun",
("old_space", 0x05969): "PromiseThenFinallySharedFun",
("old_space", 0x0598d): "PromiseThrowerFinallySharedFun",
("old_space", 0x059b1): "PromiseValueThunkFinallySharedFun",
("old_space", 0x059d5): "ProxyRevokeSharedFun",
("old_space", 0x041f5): "ArgumentsIteratorAccessor",
("old_space", 0x04239): "ArrayLengthAccessor",
("old_space", 0x0427d): "BoundFunctionLengthAccessor",
("old_space", 0x042c1): "BoundFunctionNameAccessor",
("old_space", 0x04305): "ErrorStackAccessor",
("old_space", 0x04349): "FunctionArgumentsAccessor",
("old_space", 0x0438d): "FunctionCallerAccessor",
("old_space", 0x043d1): "FunctionNameAccessor",
("old_space", 0x04415): "FunctionLengthAccessor",
("old_space", 0x04459): "FunctionPrototypeAccessor",
("old_space", 0x0449d): "StringLengthAccessor",
("old_space", 0x044e1): "InvalidPrototypeValidityCell",
("old_space", 0x044e9): "EmptyScript",
("old_space", 0x04529): "ManyClosuresCell",
("old_space", 0x04535): "ArrayConstructorProtector",
("old_space", 0x04549): "NoElementsProtector",
("old_space", 0x0455d): "MegaDOMProtector",
("old_space", 0x04571): "IsConcatSpreadableProtector",
("old_space", 0x04585): "ArraySpeciesProtector",
("old_space", 0x04599): "TypedArraySpeciesProtector",
("old_space", 0x045ad): "PromiseSpeciesProtector",
("old_space", 0x045c1): "RegExpSpeciesProtector",
("old_space", 0x045d5): "StringLengthProtector",
("old_space", 0x045e9): "ArrayIteratorProtector",
("old_space", 0x045fd): "ArrayBufferDetachingProtector",
("old_space", 0x04611): "PromiseHookProtector",
("old_space", 0x04625): "PromiseResolveProtector",
("old_space", 0x04639): "MapIteratorProtector",
("old_space", 0x0464d): "PromiseThenProtector",
("old_space", 0x04661): "SetIteratorProtector",
("old_space", 0x04675): "StringIteratorProtector",
("old_space", 0x04689): "SingleCharacterStringCache",
("old_space", 0x04a91): "StringSplitCache",
("old_space", 0x04e99): "RegExpMultipleCache",
("old_space", 0x052a1): "BuiltinsConstantsTable",
("old_space", 0x056cd): "AsyncFunctionAwaitRejectSharedFun",
("old_space", 0x056f1): "AsyncFunctionAwaitResolveSharedFun",
("old_space", 0x05715): "AsyncGeneratorAwaitRejectSharedFun",
("old_space", 0x05739): "AsyncGeneratorAwaitResolveSharedFun",
("old_space", 0x0575d): "AsyncGeneratorYieldResolveSharedFun",
("old_space", 0x05781): "AsyncGeneratorReturnResolveSharedFun",
("old_space", 0x057a5): "AsyncGeneratorReturnClosedRejectSharedFun",
("old_space", 0x057c9): "AsyncGeneratorReturnClosedResolveSharedFun",
("old_space", 0x057ed): "AsyncIteratorValueUnwrapSharedFun",
("old_space", 0x05811): "PromiseAllResolveElementSharedFun",
("old_space", 0x05835): "PromiseAllSettledResolveElementSharedFun",
("old_space", 0x05859): "PromiseAllSettledRejectElementSharedFun",
("old_space", 0x0587d): "PromiseAnyRejectElementSharedFun",
("old_space", 0x058a1): "PromiseCapabilityDefaultRejectSharedFun",
("old_space", 0x058c5): "PromiseCapabilityDefaultResolveSharedFun",
("old_space", 0x058e9): "PromiseCatchFinallySharedFun",
("old_space", 0x0590d): "PromiseGetCapabilitiesExecutorSharedFun",
("old_space", 0x05931): "PromiseThenFinallySharedFun",
("old_space", 0x05955): "PromiseThrowerFinallySharedFun",
("old_space", 0x05979): "PromiseValueThunkFinallySharedFun",
("old_space", 0x0599d): "ProxyRevokeSharedFun",
}
# Lower 32 bits of first page addresses for various heap spaces.