5#ifndef V8_HEAP_READ_ONLY_SPACES_H_
6#define V8_HEAP_READ_ONLY_SPACES_H_
26class SnapshotByteSource;
54 return address_in_page;
89 std::vector<ReadOnlyPageMetadata*>&
pages() {
return pages_; }
116 std::vector<ExternalPointerRegistryEntry>&& registry) {
127 bool read_only_heap_created);
132 std::vector<ReadOnlyPageMetadata*>
pages_;
141 std::optional<uint32_t> read_only_blob_checksum_;
191 const std::vector<ReadOnlyPageMetadata*>&
pages()
const {
return pages_; }
205 void VerifyCounters(
Heap*
heap)
const;
223 std::vector<ReadOnlyPageMetadata*>
pages_;
239 size_t area_size_in_bytes);
272struct hash<
i::ReadOnlyPageMetadata*> :
hash<i::MemoryChunkMetadata*> {};
274struct hash<const
i::ReadOnlyPageMetadata*>
275 :
hash<const i::MemoryChunkMetadata*> {};
static constexpr size_t ObjectStartOffsetInMemoryChunk(AllocationSpace space)
ReadOnlyHeap * read_only_heap() const
uint32_t initial_next_unique_sfi_id() const
std::unique_ptr< ReadOnlyHeap > read_only_heap_
std::vector< ReadOnlyPageMetadata * > pages_
void ReinstallReadOnlySpace(Isolate *isolate)
void InitializeChecksum(SnapshotData *read_only_snapshot_data)
void VerifyChecksum(SnapshotData *read_only_snapshot_data, bool read_only_heap_created)
v8::PageAllocator * page_allocator_
void set_initial_next_unique_sfi_id(uint32_t id)
void set_read_only_heap(std::unique_ptr< ReadOnlyHeap > read_only_heap)
std::vector< ExternalPointerRegistryEntry > external_pointer_registry_
std::vector< ReadOnlyPageMetadata * > & pages()
const AllocationStats & accounting_stats() const
void Initialize(Isolate *isolate, std::vector< ReadOnlyPageMetadata * > &&pages, const AllocationStats &stats)
void VerifyHeapAndSpaceRelationships(Isolate *isolate)
SharedReadOnlySpace * shared_read_only_space()
ReadOnlyArtifacts()=default
std::unique_ptr< SharedReadOnlySpace > shared_read_only_space_
void set_external_pointer_registry(std::vector< ExternalPointerRegistryEntry > &®istry)
uint32_t initial_next_unique_sfi_id_
const std::vector< ExternalPointerRegistryEntry > & external_pointer_registry() const
MemoryChunk::MainThreadFlags InitialFlags() const
void MakeHeaderRelocatable()
size_t ShrinkToHighWaterMark()
Address OffsetToAddress(size_t offset) const
ReadOnlyPageMetadata(Heap *heap, BaseSpace *space, size_t chunk_size, Address area_start, Address area_end, VirtualMemory reservation)
Address GetAreaStart() const
Tagged< HeapObject > TryAllocateLinearlyAligned(int size_in_bytes, AllocationAlignment alignment)
V8_EXPORT_PRIVATE ~ReadOnlySpace() override
V8_EXPORT_PRIVATE void Seal(SealMode ro_mode)
void RepairFreeSpacesAfterDeserialization()
AllocationResult AllocateRawAligned(int size_in_bytes, AllocationAlignment alignment)
virtual V8_EXPORT_PRIVATE void TearDown(MemoryAllocator *memory_allocator)
bool is_marked_read_only_
AllocationStats accounting_stats_
std::vector< ReadOnlyPageMetadata * > pages_
V8_EXPORT_PRIVATE void ShrinkPages()
size_t Size() const override
V8_EXPORT_PRIVATE size_t CommittedPhysicalMemory() const override
bool Contains(Address a)=delete
V8_EXPORT_PRIVATE void ClearStringPaddingIfNeeded()
bool ContainsSlow(Address addr) const
bool Contains(Tagged< Object > o)=delete
V8_EXPORT_PRIVATE AllocationResult AllocateRaw(int size_in_bytes, AllocationAlignment alignment)
size_t IndexOf(const MemoryChunkMetadata *chunk) const
V8_EXPORT_PRIVATE ReadOnlySpace(Heap *heap)
void DetachPagesAndAddToArtifacts(ReadOnlyArtifacts *artifacts)
AllocationResult AllocateRawUnaligned(int size_in_bytes)
void FreeLinearAllocationArea()
void EnsureSpaceForAllocation(int size_in_bytes)
@ kDetachFromHeapAndUnregisterMemory
size_t AllocateNextPageAt(Address pos)
void InitializePageForDeserialization(ReadOnlyPageMetadata *page, size_t area_size_in_bytes)
const std::vector< ReadOnlyPageMetadata * > & pages() const
void SetPermissionsForPages(MemoryAllocator *memory_allocator, PageAllocator::Permission access)
Address FirstPageAddress() const
size_t AllocateNextPage()
void FinalizeSpaceForDeserialization()
SharedReadOnlySpace(Heap *heap)
SharedReadOnlySpace(Heap *heap, ReadOnlyArtifacts *artifacts)
SharedReadOnlySpace(const SharedReadOnlySpace &)=delete
void TearDown(MemoryAllocator *memory_allocator) override
#define COMPRESS_POINTERS_IN_MULTIPLE_CAGES_BOOL
uint32_t ExternalPointerHandle
static constexpr Address kNullAddress
#define DCHECK_GE(v1, v2)
#define DCHECK(condition)
#define DCHECK_LT(v1, v2)
#define V8_EXPORT_PRIVATE
ExternalPointerHandle handle
ExternalPointerRegistryEntry(ExternalPointerHandle handle, Address value, ExternalPointerTag tag)