Reland "Reland "[heap] Move initial objects into RO_SPACE""

This is a reland of 6c68efac14

Updated Heap::CommittedMemory and related functions to iterate over all
spaces rather than including them manually which can lead to a space
being overlooked. Also adds a test to ensure this the case.

Original change's description:
> Revert "Reland "[heap] Move initial objects into RO_SPACE""
>
> This reverts commit 6c68efac14.
>
> Reason for revert: https://bugs.chromium.org/p/v8/issues/detail?id=7668
>
> Original change's description:
> > Reland "[heap] Move initial objects into RO_SPACE"
> >
> > This is a reland of f8ae62fe14
> >
> > Original change's description:
> > > [heap] Move initial objects into RO_SPACE
> > >
> > > This moves:
> > > * the main oddballs (null, undefined, hole, true, false) as well as
> > > their supporting maps (also adds hole as an internalized string to make
> > > this work).
> > > * most of the internalized strings
> > > * the struct maps
> > > * empty array
> > > * empty enum cache
> > > * the contents of the initial string table
> > > * the weak_cell_cache for any map in RO_SPACE (and eagerly creates the
> > > value avoid writing to it during run-time)
> > >
> > > The StartupSerializer stats change as follows:
> > >
> > >      RO_SPACE  NEW_SPACE  OLD_SPACE  CODE_SPACE  MAP_SPACE  LO_SPACE
> > > old         0          0     270264       32608      12144         0
> > > new     21776          0     253168       32608       8184         0
> > > Overall memory usage has increased by 720 bytes due to the eager
> > > initialization of the Map weak cell caches.
> > >
> > > Also extends --serialization-statistics to print out separate instance
> > > type stats for objects in RO_SPACE as shown here:
> > >
> > >   Read Only Instance types (count and bytes):
> > >        404      16736  ONE_BYTE_INTERNALIZED_STRING_TYPE
> > >          2         32  HEAP_NUMBER_TYPE
> > >          5        240  ODDBALL_TYPE
> > >         45       3960  MAP_TYPE
> > >          1         16  BYTE_ARRAY_TYPE
> > >          1         24  TUPLE2_TYPE
> > >          1         16  FIXED_ARRAY_TYPE
> > >          1         32  DESCRIPTOR_ARRAY_TYPE
> > >         45        720  WEAK_CELL_TYPE
> > >
> > > Bug: v8:7464
> > > Change-Id: I12981c39c82a7057f68bbbe03f89fb57b0b4c6a6
> > > Reviewed-on: https://chromium-review.googlesource.com/973722
> > > Commit-Queue: Dan Elphick <delphick@chromium.org>
> > > Reviewed-by: Hannes Payer <hpayer@chromium.org>
> > > Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
> > > Reviewed-by: Yang Guo <yangguo@chromium.org>
> > > Cr-Commit-Position: refs/heads/master@{#52435}
> >
> > Bug: v8:7464
> > Change-Id: I50427edfeb53ca80ec4cf46566368fb2213ccf7b
> > Reviewed-on: https://chromium-review.googlesource.com/999654
> > Commit-Queue: Dan Elphick <delphick@chromium.org>
> > Reviewed-by: Yang Guo <yangguo@chromium.org>
> > Reviewed-by: Hannes Payer <hpayer@chromium.org>
> > Cr-Commit-Position: refs/heads/master@{#52638}
>
> TBR=rmcilroy@chromium.org,yangguo@chromium.org,hpayer@chromium.org,mlippautz@chromium.org,delphick@chromium.org
>
> # Not skipping CQ checks because original CL landed > 1 day ago.
>
> Bug: v8:7464,v8:7668
> Change-Id: I10aa03623b51e997f95a3715ea9f0bf5d29d2cdb
> Reviewed-on: https://chromium-review.googlesource.com/1016600
> Commit-Queue: Peter Marshall <petermarshall@chromium.org>
> Reviewed-by: Peter Marshall <petermarshall@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#52667}

Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: If4b7490c8c4d31612de8ec132de334955a319b11
Bug: v8:7464, v8:7668
Reviewed-on: https://chromium-review.googlesource.com/1019020
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Dan Elphick <delphick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52689}
This commit is contained in:
Dan Elphick 2018-04-19 12:12:00 +01:00 committed by Commit Bot
parent b730f5eb76
commit 9ab6621ac7
14 changed files with 424 additions and 283 deletions

View File

@ -341,6 +341,10 @@ void i::V8::FatalProcessOutOfMemory(i::Isolate* isolate, const char* location,
intptr_t start_marker;
heap_stats.start_marker = &start_marker;
size_t ro_space_size;
heap_stats.ro_space_size = &ro_space_size;
size_t ro_space_capacity;
heap_stats.ro_space_capacity = &ro_space_capacity;
size_t new_space_size;
heap_stats.new_space_size = &new_space_size;
size_t new_space_capacity;

View File

@ -571,10 +571,10 @@ inline std::ostream& operator<<(std::ostream& os, WriteBarrierKind kind) {
}
// A flag that indicates whether objects should be pretenured when
// allocated (allocated directly into the old generation) or not
// (allocated in the young generation if the object size and type
// allocated (allocated directly into either the old generation or read-only
// space), or not (allocated in the young generation if the object size and type
// allows).
enum PretenureFlag { NOT_TENURED, TENURED };
enum PretenureFlag { NOT_TENURED, TENURED, TENURED_READ_ONLY };
inline std::ostream& operator<<(std::ostream& os, const PretenureFlag& flag) {
switch (flag) {
@ -582,6 +582,8 @@ inline std::ostream& operator<<(std::ostream& os, const PretenureFlag& flag) {
return os << "NotTenured";
case TENURED:
return os << "Tenured";
case TENURED_READ_ONLY:
return os << "TenuredReadOnly";
}
UNREACHABLE();
}

View File

@ -686,7 +686,11 @@ Handle<SeqOneByteString> Factory::AllocateRawOneByteInternalizedString(
Map* map = *one_byte_internalized_string_map();
int size = SeqOneByteString::SizeFor(length);
HeapObject* result = AllocateRawWithImmortalMap(size, TENURED, map);
HeapObject* result = AllocateRawWithImmortalMap(
size,
isolate()->heap()->CanAllocateInReadOnlySpace() ? TENURED_READ_ONLY
: TENURED,
map);
Handle<SeqOneByteString> answer(SeqOneByteString::cast(result), isolate());
answer->set_length(length);
answer->set_hash_field(hash_field);
@ -730,7 +734,11 @@ Handle<String> Factory::AllocateInternalizedStringImpl(T t, int chars,
size = SeqTwoByteString::SizeFor(chars);
}
HeapObject* result = AllocateRawWithImmortalMap(size, TENURED, map);
HeapObject* result = AllocateRawWithImmortalMap(
size,
isolate()->heap()->CanAllocateInReadOnlySpace() ? TENURED_READ_ONLY
: TENURED,
map);
Handle<String> answer(String::cast(result), isolate());
answer->set_length(chars);
answer->set_hash_field(hash_field);
@ -1630,13 +1638,14 @@ Handle<PropertyCell> Factory::NewPropertyCell(Handle<Name> name) {
return cell;
}
Handle<WeakCell> Factory::NewWeakCell(Handle<HeapObject> value) {
Handle<WeakCell> Factory::NewWeakCell(Handle<HeapObject> value,
PretenureFlag pretenure) {
// It is safe to dereference the value because we are embedding it
// in cell and not inspecting its fields.
AllowDeferredHandleDereference convert_to_cell;
STATIC_ASSERT(WeakCell::kSize <= kMaxRegularHeapObjectSize);
HeapObject* result =
AllocateRawWithImmortalMap(WeakCell::kSize, TENURED, *weak_cell_map());
AllocateRawWithImmortalMap(WeakCell::kSize, pretenure, *weak_cell_map());
Handle<WeakCell> cell(WeakCell::cast(result), isolate());
cell->initialize(*value);
return cell;

View File

@ -442,7 +442,8 @@ class V8_EXPORT_PRIVATE Factory {
Handle<PropertyCell> NewPropertyCell(Handle<Name> name);
Handle<WeakCell> NewWeakCell(Handle<HeapObject> value);
Handle<WeakCell> NewWeakCell(Handle<HeapObject> value,
PretenureFlag pretenure = TENURED);
Handle<FeedbackCell> NewNoClosuresCell(Handle<HeapObject> value);
Handle<FeedbackCell> NewOneClosureCell(Handle<HeapObject> value);

View File

@ -183,6 +183,7 @@ AllocationResult Heap::AllocateRaw(int size_in_bytes, AllocationSpace space,
DCHECK(isolate_->serializer_enabled());
#endif
DCHECK(!large_object);
DCHECK(CanAllocateInReadOnlySpace());
allocation = read_only_space_->AllocateRaw(size_in_bytes, alignment);
} else {
// NEW_SPACE is not allowed here.
@ -261,6 +262,12 @@ void Heap::OnMoveEvent(HeapObject* target, HeapObject* source,
}
}
bool Heap::CanAllocateInReadOnlySpace() {
return !deserialization_complete_ &&
(isolate()->serializer_enabled() ||
!isolate()->initialized_from_snapshot());
}
void Heap::UpdateAllocationsHash(HeapObject* object) {
Address object_address = object->address();
MemoryChunk* memory_chunk = MemoryChunk::FromAddress(object_address);

View File

@ -264,15 +264,25 @@ size_t Heap::Capacity() {
size_t Heap::OldGenerationCapacity() {
if (!HasBeenSetUp()) return 0;
return old_space_->Capacity() + code_space_->Capacity() +
map_space_->Capacity() + lo_space_->SizeOfObjects();
PagedSpaces spaces(this, PagedSpaces::SpacesSpecifier::kAllPagedSpaces);
size_t total = 0;
for (PagedSpace* space = spaces.next(); space != nullptr;
space = spaces.next()) {
total += space->Capacity();
}
return total + lo_space_->SizeOfObjects();
}
size_t Heap::CommittedOldGenerationMemory() {
if (!HasBeenSetUp()) return 0;
return old_space_->CommittedMemory() + code_space_->CommittedMemory() +
map_space_->CommittedMemory() + lo_space_->Size();
PagedSpaces spaces(this, PagedSpaces::SpacesSpecifier::kAllPagedSpaces);
size_t total = 0;
for (PagedSpace* space = spaces.next(); space != nullptr;
space = spaces.next()) {
total += space->CommittedMemory();
}
return total + lo_space_->Size();
}
size_t Heap::CommittedMemory() {
@ -285,11 +295,12 @@ size_t Heap::CommittedMemory() {
size_t Heap::CommittedPhysicalMemory() {
if (!HasBeenSetUp()) return 0;
return new_space_->CommittedPhysicalMemory() +
old_space_->CommittedPhysicalMemory() +
code_space_->CommittedPhysicalMemory() +
map_space_->CommittedPhysicalMemory() +
lo_space_->CommittedPhysicalMemory();
size_t total = 0;
for (SpaceIterator it(this); it.has_next();) {
total += it.next()->CommittedPhysicalMemory();
}
return total;
}
size_t Heap::CommittedMemoryExecutable() {
@ -380,6 +391,15 @@ void Heap::PrintShortHeapStatistics() {
" available: %6" PRIuS " KB\n",
memory_allocator()->Size() / KB,
memory_allocator()->Available() / KB);
PrintIsolate(isolate_,
"Read-only space, used: %6" PRIuS
" KB"
", available: %6" PRIuS
" KB"
", committed: %6" PRIuS " KB\n",
read_only_space_->Size() / KB,
read_only_space_->Available() / KB,
read_only_space_->CommittedMemory() / KB);
PrintIsolate(isolate_, "New space, used: %6" PRIuS
" KB"
", available: %6" PRIuS
@ -4141,6 +4161,8 @@ bool Heap::ConfigureHeapDefault() { return ConfigureHeap(0, 0, 0); }
void Heap::RecordStats(HeapStats* stats, bool take_snapshot) {
*stats->start_marker = HeapStats::kStartMarker;
*stats->end_marker = HeapStats::kEndMarker;
*stats->ro_space_size = read_only_space_->Size();
*stats->ro_space_capacity = read_only_space_->Capacity();
*stats->new_space_size = new_space_->Size();
*stats->new_space_capacity = new_space_->Capacity();
*stats->old_space_size = old_space_->SizeOfObjects();
@ -4181,8 +4203,13 @@ void Heap::RecordStats(HeapStats* stats, bool take_snapshot) {
}
size_t Heap::PromotedSpaceSizeOfObjects() {
return old_space_->SizeOfObjects() + code_space_->SizeOfObjects() +
map_space_->SizeOfObjects() + lo_space_->SizeOfObjects();
PagedSpaces spaces(this, PagedSpaces::SpacesSpecifier::kAllPagedSpaces);
size_t total = 0;
for (PagedSpace* space = spaces.next(); space != nullptr;
space = spaces.next()) {
total += space->SizeOfObjects();
}
return total + lo_space_->SizeOfObjects();
}
uint64_t Heap::PromotedExternalMemorySize() {

View File

@ -947,6 +947,7 @@ class Heap {
inline void OnMoveEvent(HeapObject* target, HeapObject* source,
int size_in_bytes);
inline bool CanAllocateInReadOnlySpace();
bool deserialization_complete() const { return deserialization_complete_; }
bool HasLowAllocationRate();
@ -1811,7 +1812,16 @@ class Heap {
// Selects the proper allocation space based on the pretenuring decision.
static AllocationSpace SelectSpace(PretenureFlag pretenure) {
return (pretenure == TENURED) ? OLD_SPACE : NEW_SPACE;
switch (pretenure) {
case TENURED_READ_ONLY:
return RO_SPACE;
case TENURED:
return OLD_SPACE;
case NOT_TENURED:
return NEW_SPACE;
default:
UNREACHABLE();
}
}
static size_t DefaultGetExternallyAllocatedMemoryInBytesCallback() {
@ -2136,9 +2146,11 @@ class Heap {
V8_WARN_UNUSED_RESULT AllocationResult
AllocatePartialMap(InstanceType instance_type, int instance_size);
void FinalizePartialMap(Map* map);
// Allocate empty fixed typed array of given type.
V8_WARN_UNUSED_RESULT AllocationResult
AllocateEmptyFixedTypedArray(ExternalArrayType array_type);
V8_WARN_UNUSED_RESULT AllocationResult AllocateEmptyFixedTypedArray(
ExternalArrayType array_type, AllocationSpace space = OLD_SPACE);
void set_force_oom(bool value) { force_oom_ = value; }
@ -2485,30 +2497,32 @@ class HeapStats {
static const int kEndMarker = 0xDECADE01;
intptr_t* start_marker; // 0
size_t* new_space_size; // 1
size_t* new_space_capacity; // 2
size_t* old_space_size; // 3
size_t* old_space_capacity; // 4
size_t* code_space_size; // 5
size_t* code_space_capacity; // 6
size_t* map_space_size; // 7
size_t* map_space_capacity; // 8
size_t* lo_space_size; // 9
size_t* global_handle_count; // 10
size_t* weak_global_handle_count; // 11
size_t* pending_global_handle_count; // 12
size_t* near_death_global_handle_count; // 13
size_t* free_global_handle_count; // 14
size_t* memory_allocator_size; // 15
size_t* memory_allocator_capacity; // 16
size_t* malloced_memory; // 17
size_t* malloced_peak_memory; // 18
size_t* objects_per_type; // 19
size_t* size_per_type; // 20
int* os_error; // 21
char* last_few_messages; // 22
char* js_stacktrace; // 23
intptr_t* end_marker; // 24
size_t* ro_space_size; // 1
size_t* ro_space_capacity; // 2
size_t* new_space_size; // 3
size_t* new_space_capacity; // 4
size_t* old_space_size; // 5
size_t* old_space_capacity; // 6
size_t* code_space_size; // 7
size_t* code_space_capacity; // 8
size_t* map_space_size; // 9
size_t* map_space_capacity; // 10
size_t* lo_space_size; // 11
size_t* global_handle_count; // 12
size_t* weak_global_handle_count; // 13
size_t* pending_global_handle_count; // 14
size_t* near_death_global_handle_count; // 15
size_t* free_global_handle_count; // 16
size_t* memory_allocator_size; // 17
size_t* memory_allocator_capacity; // 18
size_t* malloced_memory; // 19
size_t* malloced_peak_memory; // 20
size_t* objects_per_type; // 21
size_t* size_per_type; // 22
int* os_error; // 23
char* last_few_messages; // 24
char* js_stacktrace; // 25
intptr_t* end_marker; // 26
};

View File

@ -100,7 +100,7 @@ AllocationResult Heap::AllocateMap(InstanceType instance_type,
AllocationResult Heap::AllocatePartialMap(InstanceType instance_type,
int instance_size) {
Object* result = nullptr;
AllocationResult allocation = AllocateRaw(Map::kSize, MAP_SPACE);
AllocationResult allocation = AllocateRaw(Map::kSize, RO_SPACE);
if (!allocation.To(&result)) return allocation;
// Map::cast cannot be used due to uninitialized map field.
Map* map = reinterpret_cast<Map*>(result);
@ -130,20 +130,23 @@ AllocationResult Heap::AllocatePartialMap(InstanceType instance_type,
return map;
}
namespace {
void FinalizePartialMap(Heap* heap, Map* map) {
map->set_dependent_code(DependentCode::cast(heap->empty_fixed_array()));
void Heap::FinalizePartialMap(Map* map) {
map->set_dependent_code(DependentCode::cast(empty_fixed_array()));
map->set_raw_transitions(MaybeObject::FromSmi(Smi::kZero));
map->set_instance_descriptors(heap->empty_descriptor_array());
map->set_instance_descriptors(empty_descriptor_array());
if (FLAG_unbox_double_fields) {
map->set_layout_descriptor(LayoutDescriptor::FastPointerLayout());
}
map->set_prototype(heap->null_value());
map->set_constructor_or_backpointer(heap->null_value());
}
map->set_prototype(null_value());
map->set_constructor_or_backpointer(null_value());
} // namespace
// Eagerly initialize the WeakCell cache for the map as it will not be
// writable in RO_SPACE.
HandleScope handle_scope(isolate());
Handle<WeakCell> weak_cell =
isolate()->factory()->NewWeakCell(Handle<Map>(map), TENURED_READ_ONLY);
map->set_weak_cell_cache(*weak_cell);
}
AllocationResult Heap::Allocate(Map* map, AllocationSpace space) {
DCHECK(map->instance_type() != MAP_TYPE);
@ -159,12 +162,12 @@ AllocationResult Heap::Allocate(Map* map, AllocationSpace space) {
}
AllocationResult Heap::AllocateEmptyFixedTypedArray(
ExternalArrayType array_type) {
ExternalArrayType array_type, AllocationSpace space) {
int size = OBJECT_POINTER_ALIGN(FixedTypedArrayBase::kDataOffset);
HeapObject* object = nullptr;
AllocationResult allocation = AllocateRaw(
size, OLD_SPACE,
size, space,
array_type == kExternalFloat64Array ? kDoubleAligned : kWordAligned);
if (!allocation.To(&object)) return allocation;
@ -215,13 +218,14 @@ bool Heap::CreateInitialMaps() {
ALLOCATE_PARTIAL_MAP(ODDBALL_TYPE, Oddball::kSize, undefined);
ALLOCATE_PARTIAL_MAP(ODDBALL_TYPE, Oddball::kSize, null);
ALLOCATE_PARTIAL_MAP(ODDBALL_TYPE, Oddball::kSize, the_hole);
ALLOCATE_PARTIAL_MAP(WEAK_CELL_TYPE, WeakCell::kSize, weak_cell);
#undef ALLOCATE_PARTIAL_MAP
}
// Allocate the empty array.
{
AllocationResult alloc = AllocateRaw(FixedArray::SizeFor(0), OLD_SPACE);
AllocationResult alloc = AllocateRaw(FixedArray::SizeFor(0), RO_SPACE);
if (!alloc.To(&obj)) return false;
obj->set_map_after_allocation(fixed_array_map(), SKIP_WRITE_BARRIER);
FixedArray::cast(obj)->set_length(0);
@ -247,21 +251,21 @@ bool Heap::CreateInitialMaps() {
set_empty_weak_array_list(WeakArrayList::cast(obj));
{
AllocationResult allocation = Allocate(null_map(), OLD_SPACE);
AllocationResult allocation = Allocate(null_map(), RO_SPACE);
if (!allocation.To(&obj)) return false;
}
set_null_value(Oddball::cast(obj));
Oddball::cast(obj)->set_kind(Oddball::kNull);
{
AllocationResult allocation = Allocate(undefined_map(), OLD_SPACE);
AllocationResult allocation = Allocate(undefined_map(), RO_SPACE);
if (!allocation.To(&obj)) return false;
}
set_undefined_value(Oddball::cast(obj));
Oddball::cast(obj)->set_kind(Oddball::kUndefined);
DCHECK(!InNewSpace(undefined_value()));
{
AllocationResult allocation = Allocate(the_hole_map(), OLD_SPACE);
AllocationResult allocation = Allocate(the_hole_map(), RO_SPACE);
if (!allocation.To(&obj)) return false;
}
set_the_hole_value(Oddball::cast(obj));
@ -280,7 +284,7 @@ bool Heap::CreateInitialMaps() {
// Allocate the empty enum cache.
{
AllocationResult allocation = Allocate(tuple2_map(), OLD_SPACE);
AllocationResult allocation = Allocate(tuple2_map(), RO_SPACE);
if (!allocation.To(&obj)) return false;
}
set_empty_enum_cache(EnumCache::cast(obj));
@ -292,7 +296,7 @@ bool Heap::CreateInitialMaps() {
STATIC_ASSERT(DescriptorArray::kFirstIndex != 0);
int length = DescriptorArray::kFirstIndex;
int size = FixedArray::SizeFor(length);
if (!AllocateRaw(size, OLD_SPACE).To(&obj)) return false;
if (!AllocateRaw(size, RO_SPACE).To(&obj)) return false;
obj->set_map_after_allocation(descriptor_array_map(), SKIP_WRITE_BARRIER);
DescriptorArray::cast(obj)->set_length(length);
}
@ -303,20 +307,21 @@ bool Heap::CreateInitialMaps() {
empty_enum_cache());
// Fix the instance_descriptors for the existing maps.
FinalizePartialMap(this, meta_map());
FinalizePartialMap(this, fixed_array_map());
FinalizePartialMap(this, weak_fixed_array_map());
FinalizePartialMap(this, weak_array_list_map());
FinalizePartialMap(this, fixed_cow_array_map());
FinalizePartialMap(this, descriptor_array_map());
FinalizePartialMap(this, undefined_map());
FinalizePartialMap(meta_map());
FinalizePartialMap(weak_cell_map());
FinalizePartialMap(fixed_array_map());
FinalizePartialMap(weak_fixed_array_map());
FinalizePartialMap(weak_array_list_map());
FinalizePartialMap(fixed_cow_array_map());
FinalizePartialMap(descriptor_array_map());
FinalizePartialMap(undefined_map());
undefined_map()->set_is_undetectable(true);
FinalizePartialMap(this, null_map());
FinalizePartialMap(null_map());
null_map()->set_is_undetectable(true);
FinalizePartialMap(this, the_hole_map());
FinalizePartialMap(the_hole_map());
for (unsigned i = 0; i < arraysize(struct_table); ++i) {
const StructTable& entry = struct_table[i];
FinalizePartialMap(this, Map::cast(roots_[entry.index]));
FinalizePartialMap(Map::cast(roots_[entry.index]));
}
{ // Map allocation
@ -415,7 +420,6 @@ bool Heap::CreateInitialMaps() {
}
ALLOCATE_MAP(PROPERTY_CELL_TYPE, PropertyCell::kSize, global_property_cell)
ALLOCATE_MAP(WEAK_CELL_TYPE, WeakCell::kSize, weak_cell)
ALLOCATE_MAP(FILLER_TYPE, kPointerSize, one_pointer_filler)
ALLOCATE_MAP(FILLER_TYPE, 2 * kPointerSize, two_pointer_filler)
@ -492,14 +496,14 @@ bool Heap::CreateInitialMaps() {
set_empty_boilerplate_description(BoilerplateDescription::cast(obj));
{
AllocationResult allocation = Allocate(boolean_map(), OLD_SPACE);
AllocationResult allocation = Allocate(boolean_map(), RO_SPACE);
if (!allocation.To(&obj)) return false;
}
set_true_value(Oddball::cast(obj));
Oddball::cast(obj)->set_kind(Oddball::kTrue);
{
AllocationResult allocation = Allocate(boolean_map(), OLD_SPACE);
AllocationResult allocation = Allocate(boolean_map(), RO_SPACE);
if (!allocation.To(&obj)) return false;
}
set_false_value(Oddball::cast(obj));
@ -507,7 +511,7 @@ bool Heap::CreateInitialMaps() {
// Empty arrays.
{
if (!AllocateRaw(ByteArray::SizeFor(0), OLD_SPACE).To(&obj)) return false;
if (!AllocateRaw(ByteArray::SizeFor(0), RO_SPACE).To(&obj)) return false;
obj->set_map_after_allocation(byte_array_map(), SKIP_WRITE_BARRIER);
ByteArray::cast(obj)->set_length(0);
set_empty_byte_array(ByteArray::cast(obj));
@ -558,16 +562,26 @@ void Heap::CreateInitialObjects() {
DCHECK(std::signbit(minus_zero_value()->Number()));
set_nan_value(*factory->NewHeapNumber(
std::numeric_limits<double>::quiet_NaN(), IMMUTABLE, TENURED));
set_hole_nan_value(
*factory->NewHeapNumberFromBits(kHoleNanInt64, IMMUTABLE, TENURED));
std::numeric_limits<double>::quiet_NaN(), IMMUTABLE, TENURED_READ_ONLY));
set_hole_nan_value(*factory->NewHeapNumberFromBits(kHoleNanInt64, IMMUTABLE,
TENURED_READ_ONLY));
set_infinity_value(*factory->NewHeapNumber(V8_INFINITY, IMMUTABLE, TENURED));
set_minus_infinity_value(
*factory->NewHeapNumber(-V8_INFINITY, IMMUTABLE, TENURED));
// Allocate cache for single character one byte strings.
set_single_character_string_cache(
*factory->NewFixedArray(String::kMaxOneByteCharCode + 1, TENURED));
// Allocate initial string table.
set_string_table(*StringTable::New(isolate(), kInitialStringTableSize));
for (unsigned i = 0; i < arraysize(constant_string_table); i++) {
Handle<String> str =
factory->InternalizeUtf8String(constant_string_table[i].contents);
roots_[constant_string_table[i].index] = *str;
}
// Allocate
// Finish initializing oddballs after creating the string table.
@ -621,12 +635,6 @@ void Heap::CreateInitialObjects() {
handle(Smi::FromInt(-7), isolate()), "undefined",
Oddball::kStaleRegister));
for (unsigned i = 0; i < arraysize(constant_string_table); i++) {
Handle<String> str =
factory->InternalizeUtf8String(constant_string_table[i].contents);
roots_[constant_string_table[i].index] = *str;
}
// Create the code_stubs dictionary. The initial size is set to avoid
// expanding the dictionary during bootstrapping.
set_code_stubs(*SimpleNumberDictionary::New(isolate(), 128));
@ -677,10 +685,6 @@ void Heap::CreateInitialObjects() {
set_number_string_cache(
*factory->NewFixedArray(kInitialNumberStringCacheSize * 2, TENURED));
// Allocate cache for single character one byte strings.
set_single_character_string_cache(
*factory->NewFixedArray(String::kMaxOneByteCharCode + 1, TENURED));
// Allocate cache for string split and regexp-multiple.
set_string_split_cache(*factory->NewFixedArray(
RegExpResultsCache::kRegExpResultsCacheSize, TENURED));

View File

@ -315,6 +315,7 @@ HeapObject* PagedSpace::TryAllocateLinearlyAligned(
AllocationResult PagedSpace::AllocateRawUnaligned(
int size_in_bytes, UpdateSkipList update_skip_list) {
DCHECK_IMPLIES(identity() == RO_SPACE, heap()->CanAllocateInReadOnlySpace());
if (!EnsureLinearAllocationArea(size_in_bytes)) {
return AllocationResult::Retry(identity());
}
@ -330,7 +331,8 @@ AllocationResult PagedSpace::AllocateRawUnaligned(
AllocationResult PagedSpace::AllocateRawAligned(int size_in_bytes,
AllocationAlignment alignment) {
DCHECK(identity() == OLD_SPACE);
DCHECK(identity() == OLD_SPACE || identity() == RO_SPACE);
DCHECK_IMPLIES(identity() == RO_SPACE, heap()->CanAllocateInReadOnlySpace());
int allocation_size = size_in_bytes;
HeapObject* object = TryAllocateLinearlyAligned(&allocation_size, alignment);
if (object == nullptr) {

View File

@ -1923,7 +1923,8 @@ void PagedSpace::Verify(ObjectVisitor* visitor) {
// be in map space.
Map* map = object->map();
CHECK(map->IsMap());
CHECK(heap()->map_space()->Contains(map));
CHECK(heap()->map_space()->Contains(map) ||
heap()->read_only_space()->Contains(map));
// Perform space-specific object verification.
VerifyObject(object);
@ -2374,10 +2375,11 @@ void NewSpace::Verify() {
HeapObject* object = HeapObject::FromAddress(current);
// The first word should be a map, and we expect all map pointers to
// be in map space.
// be in map space or read-only space.
Map* map = object->map();
CHECK(map->IsMap());
CHECK(heap()->map_space()->Contains(map));
CHECK(heap()->map_space()->Contains(map) ||
heap()->read_only_space()->Contains(map));
// The object should not be code or a map.
CHECK(!object->IsMap());
@ -3452,10 +3454,11 @@ void LargeObjectSpace::Verify() {
CHECK(object->address() == page->area_start());
// The first word should be a map, and we expect all map pointers to be
// in map space.
// in map space or read-only space.
Map* map = object->map();
CHECK(map->IsMap());
CHECK(heap()->map_space()->Contains(map));
CHECK(heap()->map_space()->Contains(map) ||
heap()->read_only_space()->Contains(map));
// We have only code, sequential strings, external strings (sequential
// strings that have been morphed into external strings), thin strings

View File

@ -25,13 +25,19 @@ Serializer<AllocatorT>::Serializer(Isolate* isolate)
if (FLAG_serialization_statistics) {
instance_type_count_ = NewArray<int>(kInstanceTypes);
instance_type_size_ = NewArray<size_t>(kInstanceTypes);
read_only_instance_type_count_ = NewArray<int>(kInstanceTypes);
read_only_instance_type_size_ = NewArray<size_t>(kInstanceTypes);
for (int i = 0; i < kInstanceTypes; i++) {
instance_type_count_[i] = 0;
instance_type_size_[i] = 0;
read_only_instance_type_count_[i] = 0;
read_only_instance_type_size_[i] = 0;
}
} else {
instance_type_count_ = nullptr;
instance_type_size_ = nullptr;
read_only_instance_type_count_ = nullptr;
read_only_instance_type_size_ = nullptr;
}
#endif // OBJECT_PRINT
}
@ -43,16 +49,24 @@ Serializer<AllocatorT>::~Serializer() {
if (instance_type_count_ != nullptr) {
DeleteArray(instance_type_count_);
DeleteArray(instance_type_size_);
DeleteArray(read_only_instance_type_count_);
DeleteArray(read_only_instance_type_size_);
}
#endif // OBJECT_PRINT
}
#ifdef OBJECT_PRINT
template <class AllocatorT>
void Serializer<AllocatorT>::CountInstanceType(Map* map, int size) {
void Serializer<AllocatorT>::CountInstanceType(Map* map, int size,
AllocationSpace space) {
int instance_type = map->instance_type();
if (space != RO_SPACE) {
instance_type_count_[instance_type]++;
instance_type_size_[instance_type] += size;
} else {
read_only_instance_type_count_[instance_type]++;
read_only_instance_type_size_[instance_type] += size;
}
}
#endif // OBJECT_PRINT
@ -72,6 +86,21 @@ void Serializer<AllocatorT>::OutputStatistics(const char* name) {
}
INSTANCE_TYPE_LIST(PRINT_INSTANCE_TYPE)
#undef PRINT_INSTANCE_TYPE
size_t read_only_total = 0;
#define UPDATE_TOTAL(Name) \
read_only_total += read_only_instance_type_size_[Name];
INSTANCE_TYPE_LIST(UPDATE_TOTAL)
#undef UPDATE_TOTAL
if (read_only_total > 0) {
PrintF("\n Read Only Instance types (count and bytes):\n");
#define PRINT_INSTANCE_TYPE(Name) \
if (read_only_instance_type_count_[Name]) { \
PrintF("%10d %10" PRIuS " %s\n", read_only_instance_type_count_[Name], \
read_only_instance_type_size_[Name], #Name); \
}
INSTANCE_TYPE_LIST(PRINT_INSTANCE_TYPE)
#undef PRINT_INSTANCE_TYPE
}
PrintF("\n");
#endif // OBJECT_PRINT
}
@ -362,7 +391,7 @@ void Serializer<AllocatorT>::ObjectSerializer::SerializePrologue(
#ifdef OBJECT_PRINT
if (FLAG_serialization_statistics) {
serializer_->CountInstanceType(map, size);
serializer_->CountInstanceType(map, size, space);
}
#endif // OBJECT_PRINT

View File

@ -226,7 +226,7 @@ class Serializer : public SerializerDeserializer {
void OutputStatistics(const char* name);
#ifdef OBJECT_PRINT
void CountInstanceType(Map* map, int size);
void CountInstanceType(Map* map, int size, AllocationSpace space);
#endif // OBJECT_PRINT
#ifdef DEBUG
@ -256,6 +256,8 @@ class Serializer : public SerializerDeserializer {
static const int kInstanceTypes = LAST_TYPE + 1;
int* instance_type_count_;
size_t* instance_type_size_;
int* read_only_instance_type_count_;
size_t* read_only_instance_type_size_;
#endif // OBJECT_PRINT
#ifdef DEBUG

View File

@ -18570,6 +18570,43 @@ THREADED_TEST(GetHeapStatistics) {
CHECK_NE(static_cast<int>(heap_statistics.used_heap_size()), 0);
}
TEST(GetHeapSpaceStatistics) {
LocalContext c1;
v8::Isolate* isolate = c1->GetIsolate();
v8::HandleScope scope(isolate);
v8::HeapStatistics heap_statistics;
// Force allocation in LO_SPACE so that every space has non-zero size.
v8::internal::Isolate* i_isolate =
reinterpret_cast<v8::internal::Isolate*>(isolate);
(void)i_isolate->factory()->TryNewFixedArray(512 * 1024);
isolate->GetHeapStatistics(&heap_statistics);
// Ensure that the sum of all the spaces matches the totals from
// GetHeapSpaceStatics.
size_t total_size = 0u;
size_t total_used_size = 0u;
size_t total_available_size = 0u;
size_t total_physical_size = 0u;
for (size_t i = 0; i < isolate->NumberOfHeapSpaces(); ++i) {
v8::HeapSpaceStatistics space_statistics;
isolate->GetHeapSpaceStatistics(&space_statistics, i);
CHECK_NOT_NULL(space_statistics.space_name());
CHECK_GT(space_statistics.space_size(), 0u);
total_size += space_statistics.space_size();
CHECK_GT(space_statistics.space_used_size(), 0u);
total_used_size += space_statistics.space_used_size();
total_available_size += space_statistics.space_available_size();
CHECK_GT(space_statistics.physical_space_size(), 0u);
total_physical_size += space_statistics.physical_space_size();
}
CHECK_EQ(total_size, heap_statistics.total_heap_size());
CHECK_EQ(total_used_size, heap_statistics.used_heap_size());
CHECK_EQ(total_available_size, heap_statistics.total_available_size());
CHECK_EQ(total_physical_size, heap_statistics.total_physical_size());
}
TEST(NumberOfNativeContexts) {
static const size_t kNumTestContexts = 10;
i::Isolate* isolate = CcTest::i_isolate();

View File

@ -159,187 +159,187 @@ INSTANCE_TYPES = {
# List of known V8 maps.
KNOWN_MAPS = {
("RO_SPACE", 0x02201): (132, "MetaMap"),
("RO_SPACE", 0x02289): (131, "NullMap"),
("RO_SPACE", 0x02301): (185, "DescriptorArrayMap"),
("RO_SPACE", 0x02369): (183, "FixedArrayMap"),
("RO_SPACE", 0x023d1): (211, "WeakCellMap"),
("RO_SPACE", 0x024e9): (131, "UndefinedMap"),
("RO_SPACE", 0x02591): (131, "TheHoleMap"),
("RO_SPACE", 0x02701): (183, "FixedCOWArrayMap"),
("RO_SPACE", 0x02839): (197, "WeakFixedArrayMap"),
("RO_SPACE", 0x028a1): (212, "WeakArrayListMap"),
("RO_SPACE", 0x02921): (173, "Tuple2Map"),
("RO_SPACE", 0x02999): (171, "ScriptMap"),
("RO_SPACE", 0x02a01): (163, "InterceptorInfoMap"),
("RO_SPACE", 0x06891): (154, "AccessorInfoMap"),
("RO_SPACE", 0x06aa1): (153, "AccessCheckInfoMap"),
("RO_SPACE", 0x06b09): (155, "AccessorPairMap"),
("RO_SPACE", 0x06b71): (156, "AliasedArgumentsEntryMap"),
("RO_SPACE", 0x06bd9): (157, "AllocationMementoMap"),
("RO_SPACE", 0x06c41): (158, "AllocationSiteMap"),
("RO_SPACE", 0x06ca9): (159, "AsyncGeneratorRequestMap"),
("RO_SPACE", 0x06d11): (160, "ContextExtensionMap"),
("RO_SPACE", 0x06d79): (161, "DebugInfoMap"),
("RO_SPACE", 0x06de1): (162, "FunctionTemplateInfoMap"),
("RO_SPACE", 0x06e49): (164, "InterpreterDataMap"),
("RO_SPACE", 0x06eb1): (165, "ModuleInfoEntryMap"),
("RO_SPACE", 0x06f19): (166, "ModuleMap"),
("RO_SPACE", 0x06f81): (167, "ObjectTemplateInfoMap"),
("RO_SPACE", 0x06fe9): (168, "PromiseCapabilityMap"),
("RO_SPACE", 0x07051): (169, "PromiseReactionMap"),
("RO_SPACE", 0x070b9): (170, "PrototypeInfoMap"),
("RO_SPACE", 0x07121): (172, "StackFrameInfoMap"),
("RO_SPACE", 0x07189): (174, "Tuple3Map"),
("RO_SPACE", 0x071f1): (175, "WasmCompiledModuleMap"),
("RO_SPACE", 0x07259): (176, "WasmDebugInfoMap"),
("RO_SPACE", 0x072c1): (177, "WasmSharedModuleDataMap"),
("RO_SPACE", 0x07329): (178, "CallableTaskMap"),
("RO_SPACE", 0x07391): (179, "CallbackTaskMap"),
("RO_SPACE", 0x073f9): (180, "PromiseFulfillReactionJobTaskMap"),
("RO_SPACE", 0x07461): (181, "PromiseRejectReactionJobTaskMap"),
("RO_SPACE", 0x074c9): (182, "PromiseResolveThenableJobTaskMap"),
("MAP_SPACE", 0x02201): (138, "FreeSpaceMap"),
("MAP_SPACE", 0x02259): (132, "MetaMap"),
("MAP_SPACE", 0x022b1): (131, "NullMap"),
("MAP_SPACE", 0x02309): (185, "DescriptorArrayMap"),
("MAP_SPACE", 0x02361): (183, "FixedArrayMap"),
("MAP_SPACE", 0x023b9): (152, "OnePointerFillerMap"),
("MAP_SPACE", 0x02411): (152, "TwoPointerFillerMap"),
("MAP_SPACE", 0x02469): (131, "UninitializedMap"),
("MAP_SPACE", 0x024c1): (8, "OneByteInternalizedStringMap"),
("MAP_SPACE", 0x02519): (131, "UndefinedMap"),
("MAP_SPACE", 0x02571): (129, "HeapNumberMap"),
("MAP_SPACE", 0x025c9): (131, "TheHoleMap"),
("MAP_SPACE", 0x02621): (131, "BooleanMap"),
("MAP_SPACE", 0x02679): (136, "ByteArrayMap"),
("MAP_SPACE", 0x026d1): (183, "FixedCOWArrayMap"),
("MAP_SPACE", 0x02729): (186, "HashTableMap"),
("MAP_SPACE", 0x02781): (128, "SymbolMap"),
("MAP_SPACE", 0x027d9): (72, "OneByteStringMap"),
("MAP_SPACE", 0x02831): (187, "ScopeInfoMap"),
("MAP_SPACE", 0x02889): (207, "SharedFunctionInfoMap"),
("MAP_SPACE", 0x028e1): (133, "CodeMap"),
("MAP_SPACE", 0x02939): (192, "FunctionContextMap"),
("MAP_SPACE", 0x02991): (200, "CellMap"),
("MAP_SPACE", 0x029e9): (211, "WeakCellMap"),
("MAP_SPACE", 0x02a41): (206, "GlobalPropertyCellMap"),
("MAP_SPACE", 0x02a99): (135, "ForeignMap"),
("MAP_SPACE", 0x02af1): (198, "TransitionArrayMap"),
("MAP_SPACE", 0x02b49): (203, "FeedbackVectorMap"),
("MAP_SPACE", 0x02ba1): (131, "ArgumentsMarkerMap"),
("MAP_SPACE", 0x02bf9): (131, "ExceptionMap"),
("MAP_SPACE", 0x02c51): (131, "TerminationExceptionMap"),
("MAP_SPACE", 0x02ca9): (131, "OptimizedOutMap"),
("MAP_SPACE", 0x02d01): (131, "StaleRegisterMap"),
("MAP_SPACE", 0x02d59): (194, "NativeContextMap"),
("MAP_SPACE", 0x02db1): (193, "ModuleContextMap"),
("MAP_SPACE", 0x02e09): (191, "EvalContextMap"),
("MAP_SPACE", 0x02e61): (195, "ScriptContextMap"),
("MAP_SPACE", 0x02eb9): (188, "BlockContextMap"),
("MAP_SPACE", 0x02f11): (189, "CatchContextMap"),
("MAP_SPACE", 0x02f69): (196, "WithContextMap"),
("MAP_SPACE", 0x02fc1): (190, "DebugEvaluateContextMap"),
("MAP_SPACE", 0x03019): (183, "ScriptContextTableMap"),
("MAP_SPACE", 0x03071): (151, "FeedbackMetadataArrayMap"),
("MAP_SPACE", 0x030c9): (183, "ArrayListMap"),
("MAP_SPACE", 0x03121): (130, "BigIntMap"),
("MAP_SPACE", 0x03179): (184, "BoilerplateDescriptionMap"),
("MAP_SPACE", 0x031d1): (137, "BytecodeArrayMap"),
("MAP_SPACE", 0x03229): (201, "CodeDataContainerMap"),
("MAP_SPACE", 0x03281): (1057, "ExternalMap"),
("MAP_SPACE", 0x032d9): (150, "FixedDoubleArrayMap"),
("MAP_SPACE", 0x03331): (186, "GlobalDictionaryMap"),
("MAP_SPACE", 0x03389): (202, "ManyClosuresCellMap"),
("MAP_SPACE", 0x033e1): (1072, "JSMessageObjectMap"),
("MAP_SPACE", 0x03439): (183, "ModuleInfoMap"),
("MAP_SPACE", 0x03491): (134, "MutableHeapNumberMap"),
("MAP_SPACE", 0x034e9): (186, "NameDictionaryMap"),
("MAP_SPACE", 0x03541): (202, "NoClosuresCellMap"),
("MAP_SPACE", 0x03599): (186, "NumberDictionaryMap"),
("MAP_SPACE", 0x035f1): (202, "OneClosureCellMap"),
("MAP_SPACE", 0x03649): (186, "OrderedHashMapMap"),
("MAP_SPACE", 0x036a1): (186, "OrderedHashSetMap"),
("MAP_SPACE", 0x036f9): (205, "PropertyArrayMap"),
("MAP_SPACE", 0x03751): (199, "SideEffectCallHandlerInfoMap"),
("MAP_SPACE", 0x037a9): (199, "SideEffectFreeCallHandlerInfoMap"),
("MAP_SPACE", 0x03801): (186, "SimpleNumberDictionaryMap"),
("MAP_SPACE", 0x03859): (183, "SloppyArgumentsElementsMap"),
("MAP_SPACE", 0x038b1): (208, "SmallOrderedHashMapMap"),
("MAP_SPACE", 0x03909): (209, "SmallOrderedHashSetMap"),
("MAP_SPACE", 0x03961): (186, "StringTableMap"),
("MAP_SPACE", 0x039b9): (197, "WeakFixedArrayMap"),
("MAP_SPACE", 0x03a11): (212, "WeakArrayListMap"),
("MAP_SPACE", 0x03a69): (106, "NativeSourceStringMap"),
("MAP_SPACE", 0x03ac1): (64, "StringMap"),
("MAP_SPACE", 0x03b19): (73, "ConsOneByteStringMap"),
("MAP_SPACE", 0x03b71): (65, "ConsStringMap"),
("MAP_SPACE", 0x03bc9): (77, "ThinOneByteStringMap"),
("MAP_SPACE", 0x03c21): (69, "ThinStringMap"),
("MAP_SPACE", 0x03c79): (67, "SlicedStringMap"),
("MAP_SPACE", 0x03cd1): (75, "SlicedOneByteStringMap"),
("MAP_SPACE", 0x03d29): (66, "ExternalStringMap"),
("MAP_SPACE", 0x03d81): (82, "ExternalStringWithOneByteDataMap"),
("MAP_SPACE", 0x03dd9): (74, "ExternalOneByteStringMap"),
("MAP_SPACE", 0x03e31): (98, "ShortExternalStringMap"),
("MAP_SPACE", 0x03e89): (114, "ShortExternalStringWithOneByteDataMap"),
("MAP_SPACE", 0x03ee1): (0, "InternalizedStringMap"),
("MAP_SPACE", 0x03f39): (2, "ExternalInternalizedStringMap"),
("MAP_SPACE", 0x03f91): (18, "ExternalInternalizedStringWithOneByteDataMap"),
("MAP_SPACE", 0x03fe9): (10, "ExternalOneByteInternalizedStringMap"),
("MAP_SPACE", 0x04041): (34, "ShortExternalInternalizedStringMap"),
("MAP_SPACE", 0x04099): (50, "ShortExternalInternalizedStringWithOneByteDataMap"),
("MAP_SPACE", 0x040f1): (42, "ShortExternalOneByteInternalizedStringMap"),
("MAP_SPACE", 0x04149): (106, "ShortExternalOneByteStringMap"),
("MAP_SPACE", 0x041a1): (140, "FixedUint8ArrayMap"),
("MAP_SPACE", 0x041f9): (139, "FixedInt8ArrayMap"),
("MAP_SPACE", 0x04251): (142, "FixedUint16ArrayMap"),
("MAP_SPACE", 0x042a9): (141, "FixedInt16ArrayMap"),
("MAP_SPACE", 0x04301): (144, "FixedUint32ArrayMap"),
("MAP_SPACE", 0x04359): (143, "FixedInt32ArrayMap"),
("MAP_SPACE", 0x043b1): (145, "FixedFloat32ArrayMap"),
("MAP_SPACE", 0x04409): (146, "FixedFloat64ArrayMap"),
("MAP_SPACE", 0x04461): (147, "FixedUint8ClampedArrayMap"),
("MAP_SPACE", 0x044b9): (149, "FixedBigUint64ArrayMap"),
("MAP_SPACE", 0x04511): (148, "FixedBigInt64ArrayMap"),
("MAP_SPACE", 0x04569): (173, "Tuple2Map"),
("MAP_SPACE", 0x045c1): (171, "ScriptMap"),
("MAP_SPACE", 0x04619): (163, "InterceptorInfoMap"),
("MAP_SPACE", 0x04671): (154, "AccessorInfoMap"),
("MAP_SPACE", 0x046c9): (153, "AccessCheckInfoMap"),
("MAP_SPACE", 0x04721): (155, "AccessorPairMap"),
("MAP_SPACE", 0x04779): (156, "AliasedArgumentsEntryMap"),
("MAP_SPACE", 0x047d1): (157, "AllocationMementoMap"),
("MAP_SPACE", 0x04829): (158, "AllocationSiteMap"),
("MAP_SPACE", 0x04881): (159, "AsyncGeneratorRequestMap"),
("MAP_SPACE", 0x048d9): (160, "ContextExtensionMap"),
("MAP_SPACE", 0x04931): (161, "DebugInfoMap"),
("MAP_SPACE", 0x04989): (162, "FunctionTemplateInfoMap"),
("MAP_SPACE", 0x049e1): (164, "InterpreterDataMap"),
("MAP_SPACE", 0x04a39): (165, "ModuleInfoEntryMap"),
("MAP_SPACE", 0x04a91): (166, "ModuleMap"),
("MAP_SPACE", 0x04ae9): (167, "ObjectTemplateInfoMap"),
("MAP_SPACE", 0x04b41): (168, "PromiseCapabilityMap"),
("MAP_SPACE", 0x04b99): (169, "PromiseReactionMap"),
("MAP_SPACE", 0x04bf1): (170, "PrototypeInfoMap"),
("MAP_SPACE", 0x04c49): (172, "StackFrameInfoMap"),
("MAP_SPACE", 0x04ca1): (174, "Tuple3Map"),
("MAP_SPACE", 0x04cf9): (175, "WasmCompiledModuleMap"),
("MAP_SPACE", 0x04d51): (176, "WasmDebugInfoMap"),
("MAP_SPACE", 0x04da9): (177, "WasmSharedModuleDataMap"),
("MAP_SPACE", 0x04e01): (178, "CallableTaskMap"),
("MAP_SPACE", 0x04e59): (179, "CallbackTaskMap"),
("MAP_SPACE", 0x04eb1): (180, "PromiseFulfillReactionJobTaskMap"),
("MAP_SPACE", 0x04f09): (181, "PromiseRejectReactionJobTaskMap"),
("MAP_SPACE", 0x04f61): (182, "PromiseResolveThenableJobTaskMap"),
("MAP_SPACE", 0x02259): (152, "OnePointerFillerMap"),
("MAP_SPACE", 0x022b1): (152, "TwoPointerFillerMap"),
("MAP_SPACE", 0x02309): (131, "UninitializedMap"),
("MAP_SPACE", 0x02361): (8, "OneByteInternalizedStringMap"),
("MAP_SPACE", 0x023b9): (129, "HeapNumberMap"),
("MAP_SPACE", 0x02411): (131, "BooleanMap"),
("MAP_SPACE", 0x02469): (136, "ByteArrayMap"),
("MAP_SPACE", 0x024c1): (186, "HashTableMap"),
("MAP_SPACE", 0x02519): (128, "SymbolMap"),
("MAP_SPACE", 0x02571): (72, "OneByteStringMap"),
("MAP_SPACE", 0x025c9): (187, "ScopeInfoMap"),
("MAP_SPACE", 0x02621): (207, "SharedFunctionInfoMap"),
("MAP_SPACE", 0x02679): (133, "CodeMap"),
("MAP_SPACE", 0x026d1): (192, "FunctionContextMap"),
("MAP_SPACE", 0x02729): (200, "CellMap"),
("MAP_SPACE", 0x02781): (206, "GlobalPropertyCellMap"),
("MAP_SPACE", 0x027d9): (135, "ForeignMap"),
("MAP_SPACE", 0x02831): (198, "TransitionArrayMap"),
("MAP_SPACE", 0x02889): (203, "FeedbackVectorMap"),
("MAP_SPACE", 0x028e1): (131, "ArgumentsMarkerMap"),
("MAP_SPACE", 0x02939): (131, "ExceptionMap"),
("MAP_SPACE", 0x02991): (131, "TerminationExceptionMap"),
("MAP_SPACE", 0x029e9): (131, "OptimizedOutMap"),
("MAP_SPACE", 0x02a41): (131, "StaleRegisterMap"),
("MAP_SPACE", 0x02a99): (194, "NativeContextMap"),
("MAP_SPACE", 0x02af1): (193, "ModuleContextMap"),
("MAP_SPACE", 0x02b49): (191, "EvalContextMap"),
("MAP_SPACE", 0x02ba1): (195, "ScriptContextMap"),
("MAP_SPACE", 0x02bf9): (188, "BlockContextMap"),
("MAP_SPACE", 0x02c51): (189, "CatchContextMap"),
("MAP_SPACE", 0x02ca9): (196, "WithContextMap"),
("MAP_SPACE", 0x02d01): (190, "DebugEvaluateContextMap"),
("MAP_SPACE", 0x02d59): (183, "ScriptContextTableMap"),
("MAP_SPACE", 0x02db1): (151, "FeedbackMetadataArrayMap"),
("MAP_SPACE", 0x02e09): (183, "ArrayListMap"),
("MAP_SPACE", 0x02e61): (130, "BigIntMap"),
("MAP_SPACE", 0x02eb9): (184, "BoilerplateDescriptionMap"),
("MAP_SPACE", 0x02f11): (137, "BytecodeArrayMap"),
("MAP_SPACE", 0x02f69): (201, "CodeDataContainerMap"),
("MAP_SPACE", 0x02fc1): (1057, "ExternalMap"),
("MAP_SPACE", 0x03019): (150, "FixedDoubleArrayMap"),
("MAP_SPACE", 0x03071): (186, "GlobalDictionaryMap"),
("MAP_SPACE", 0x030c9): (202, "ManyClosuresCellMap"),
("MAP_SPACE", 0x03121): (1072, "JSMessageObjectMap"),
("MAP_SPACE", 0x03179): (183, "ModuleInfoMap"),
("MAP_SPACE", 0x031d1): (134, "MutableHeapNumberMap"),
("MAP_SPACE", 0x03229): (186, "NameDictionaryMap"),
("MAP_SPACE", 0x03281): (202, "NoClosuresCellMap"),
("MAP_SPACE", 0x032d9): (186, "NumberDictionaryMap"),
("MAP_SPACE", 0x03331): (202, "OneClosureCellMap"),
("MAP_SPACE", 0x03389): (186, "OrderedHashMapMap"),
("MAP_SPACE", 0x033e1): (186, "OrderedHashSetMap"),
("MAP_SPACE", 0x03439): (205, "PropertyArrayMap"),
("MAP_SPACE", 0x03491): (199, "SideEffectCallHandlerInfoMap"),
("MAP_SPACE", 0x034e9): (199, "SideEffectFreeCallHandlerInfoMap"),
("MAP_SPACE", 0x03541): (186, "SimpleNumberDictionaryMap"),
("MAP_SPACE", 0x03599): (183, "SloppyArgumentsElementsMap"),
("MAP_SPACE", 0x035f1): (208, "SmallOrderedHashMapMap"),
("MAP_SPACE", 0x03649): (209, "SmallOrderedHashSetMap"),
("MAP_SPACE", 0x036a1): (186, "StringTableMap"),
("MAP_SPACE", 0x036f9): (106, "NativeSourceStringMap"),
("MAP_SPACE", 0x03751): (64, "StringMap"),
("MAP_SPACE", 0x037a9): (73, "ConsOneByteStringMap"),
("MAP_SPACE", 0x03801): (65, "ConsStringMap"),
("MAP_SPACE", 0x03859): (77, "ThinOneByteStringMap"),
("MAP_SPACE", 0x038b1): (69, "ThinStringMap"),
("MAP_SPACE", 0x03909): (67, "SlicedStringMap"),
("MAP_SPACE", 0x03961): (75, "SlicedOneByteStringMap"),
("MAP_SPACE", 0x039b9): (66, "ExternalStringMap"),
("MAP_SPACE", 0x03a11): (82, "ExternalStringWithOneByteDataMap"),
("MAP_SPACE", 0x03a69): (74, "ExternalOneByteStringMap"),
("MAP_SPACE", 0x03ac1): (98, "ShortExternalStringMap"),
("MAP_SPACE", 0x03b19): (114, "ShortExternalStringWithOneByteDataMap"),
("MAP_SPACE", 0x03b71): (0, "InternalizedStringMap"),
("MAP_SPACE", 0x03bc9): (2, "ExternalInternalizedStringMap"),
("MAP_SPACE", 0x03c21): (18, "ExternalInternalizedStringWithOneByteDataMap"),
("MAP_SPACE", 0x03c79): (10, "ExternalOneByteInternalizedStringMap"),
("MAP_SPACE", 0x03cd1): (34, "ShortExternalInternalizedStringMap"),
("MAP_SPACE", 0x03d29): (50, "ShortExternalInternalizedStringWithOneByteDataMap"),
("MAP_SPACE", 0x03d81): (42, "ShortExternalOneByteInternalizedStringMap"),
("MAP_SPACE", 0x03dd9): (106, "ShortExternalOneByteStringMap"),
("MAP_SPACE", 0x03e31): (140, "FixedUint8ArrayMap"),
("MAP_SPACE", 0x03e89): (139, "FixedInt8ArrayMap"),
("MAP_SPACE", 0x03ee1): (142, "FixedUint16ArrayMap"),
("MAP_SPACE", 0x03f39): (141, "FixedInt16ArrayMap"),
("MAP_SPACE", 0x03f91): (144, "FixedUint32ArrayMap"),
("MAP_SPACE", 0x03fe9): (143, "FixedInt32ArrayMap"),
("MAP_SPACE", 0x04041): (145, "FixedFloat32ArrayMap"),
("MAP_SPACE", 0x04099): (146, "FixedFloat64ArrayMap"),
("MAP_SPACE", 0x040f1): (147, "FixedUint8ClampedArrayMap"),
("MAP_SPACE", 0x04149): (149, "FixedBigUint64ArrayMap"),
("MAP_SPACE", 0x041a1): (148, "FixedBigInt64ArrayMap"),
}
# List of known V8 objects.
KNOWN_OBJECTS = {
("OLD_SPACE", 0x02201): "NullValue",
("OLD_SPACE", 0x02231): "EmptyDescriptorArray",
("OLD_SPACE", 0x02251): "EmptyFixedArray",
("OLD_SPACE", 0x02261): "UninitializedValue",
("OLD_SPACE", 0x022e1): "UndefinedValue",
("OLD_SPACE", 0x02311): "NanValue",
("OLD_SPACE", 0x02321): "TheHoleValue",
("OLD_SPACE", 0x02371): "HoleNanValue",
("OLD_SPACE", 0x02381): "TrueValue",
("OLD_SPACE", 0x023f1): "FalseValue",
("OLD_SPACE", 0x02441): "empty_string",
("OLD_SPACE", 0x02459): "EmptyScopeInfo",
("OLD_SPACE", 0x02469): "ArgumentsMarker",
("OLD_SPACE", 0x024c1): "Exception",
("OLD_SPACE", 0x02519): "TerminationException",
("OLD_SPACE", 0x02579): "OptimizedOut",
("OLD_SPACE", 0x025d1): "StaleRegister",
("OLD_SPACE", 0x02661): "EmptyByteArray",
("OLD_SPACE", 0x02681): "EmptyFixedUint8Array",
("OLD_SPACE", 0x026a1): "EmptyFixedInt8Array",
("OLD_SPACE", 0x026c1): "EmptyFixedUint16Array",
("OLD_SPACE", 0x026e1): "EmptyFixedInt16Array",
("OLD_SPACE", 0x02701): "EmptyFixedUint32Array",
("OLD_SPACE", 0x02721): "EmptyFixedInt32Array",
("OLD_SPACE", 0x02741): "EmptyFixedFloat32Array",
("OLD_SPACE", 0x02761): "EmptyFixedFloat64Array",
("OLD_SPACE", 0x02781): "EmptyFixedUint8ClampedArray",
("OLD_SPACE", 0x027e1): "EmptyScript",
("OLD_SPACE", 0x02879): "ManyClosuresCell",
("OLD_SPACE", 0x02889): "EmptySloppyArgumentsElements",
("OLD_SPACE", 0x028a9): "EmptySlowElementDictionary",
("OLD_SPACE", 0x028f1): "EmptyOrderedHashMap",
("OLD_SPACE", 0x02919): "EmptyOrderedHashSet",
("OLD_SPACE", 0x02951): "EmptyPropertyCell",
("OLD_SPACE", 0x02979): "EmptyWeakCell",
("OLD_SPACE", 0x02a01): "NoElementsProtector",
("OLD_SPACE", 0x02a29): "IsConcatSpreadableProtector",
("OLD_SPACE", 0x02a39): "SpeciesProtector",
("OLD_SPACE", 0x02a61): "StringLengthProtector",
("OLD_SPACE", 0x02a71): "ArrayIteratorProtector",
("OLD_SPACE", 0x02a99): "ArrayBufferNeuteringProtector",
("OLD_SPACE", 0x02b21): "InfinityValue",
("OLD_SPACE", 0x02b31): "MinusZeroValue",
("OLD_SPACE", 0x02b41): "MinusInfinityValue",
("RO_SPACE", 0x02259): "NullValue",
("RO_SPACE", 0x022e1): "EmptyDescriptorArray",
("RO_SPACE", 0x02359): "EmptyFixedArray",
("RO_SPACE", 0x024b9): "UndefinedValue",
("RO_SPACE", 0x02551): "NanValue",
("RO_SPACE", 0x02561): "TheHoleValue",
("RO_SPACE", 0x02619): "HoleNanValue",
("RO_SPACE", 0x02629): "TrueValue",
("RO_SPACE", 0x02699): "FalseValue",
("RO_SPACE", 0x026e9): "empty_string",
("RO_SPACE", 0x02989): "EmptyByteArray",
("OLD_SPACE", 0x02201): "UninitializedValue",
("OLD_SPACE", 0x02231): "EmptyScopeInfo",
("OLD_SPACE", 0x02241): "ArgumentsMarker",
("OLD_SPACE", 0x02271): "Exception",
("OLD_SPACE", 0x022a1): "TerminationException",
("OLD_SPACE", 0x022d1): "OptimizedOut",
("OLD_SPACE", 0x02301): "StaleRegister",
("OLD_SPACE", 0x02361): "EmptyFixedUint8Array",
("OLD_SPACE", 0x02381): "EmptyFixedInt8Array",
("OLD_SPACE", 0x023a1): "EmptyFixedUint16Array",
("OLD_SPACE", 0x023c1): "EmptyFixedInt16Array",
("OLD_SPACE", 0x023e1): "EmptyFixedUint32Array",
("OLD_SPACE", 0x02401): "EmptyFixedInt32Array",
("OLD_SPACE", 0x02421): "EmptyFixedFloat32Array",
("OLD_SPACE", 0x02441): "EmptyFixedFloat64Array",
("OLD_SPACE", 0x02461): "EmptyFixedUint8ClampedArray",
("OLD_SPACE", 0x024c1): "EmptyScript",
("OLD_SPACE", 0x02559): "ManyClosuresCell",
("OLD_SPACE", 0x02569): "EmptySloppyArgumentsElements",
("OLD_SPACE", 0x02589): "EmptySlowElementDictionary",
("OLD_SPACE", 0x025d1): "EmptyOrderedHashMap",
("OLD_SPACE", 0x025f9): "EmptyOrderedHashSet",
("OLD_SPACE", 0x02631): "EmptyPropertyCell",
("OLD_SPACE", 0x02659): "EmptyWeakCell",
("OLD_SPACE", 0x026e1): "NoElementsProtector",
("OLD_SPACE", 0x02709): "IsConcatSpreadableProtector",
("OLD_SPACE", 0x02719): "SpeciesProtector",
("OLD_SPACE", 0x02741): "StringLengthProtector",
("OLD_SPACE", 0x02751): "ArrayIteratorProtector",
("OLD_SPACE", 0x02779): "ArrayBufferNeuteringProtector",
("OLD_SPACE", 0x02801): "InfinityValue",
("OLD_SPACE", 0x02811): "MinusZeroValue",
("OLD_SPACE", 0x02821): "MinusInfinityValue",
}
# List of known V8 Frame Markers.