#include "src/heap/read-only-heap.h"
#include <cstddef>
#include <cstring>
#include "src/base/lazy-instance.h"
#include "src/base/platform/mutex.h"
#include "src/common/globals.h"
#include "src/common/ptr-compr-inl.h"
#include "src/heap/heap-write-barrier-inl.h"
#include "src/heap/memory-chunk-metadata.h"
#include "src/heap/mutable-page-metadata.h"
#include "src/heap/read-only-spaces.h"
#include "src/objects/heap-object-inl.h"
#include "src/objects/objects-inl.h"
#include "src/objects/smi.h"
#include "src/sandbox/js-dispatch-table-inl.h"
#include "src/snapshot/read-only-deserializer.h"
#include "src/utils/allocation.h"
namespace v8 {
namespace internal {
namespace {
base::LazyMutex read_only_heap_creation_mutex_ = LAZY_MUTEX_INITIALIZER;
base::LazyInstance<std::weak_ptr<ReadOnlyArtifacts>>::type
read_only_artifacts_ = LAZY_INSTANCE_INITIALIZER;
std::shared_ptr<ReadOnlyArtifacts> InitializeSharedReadOnlyArtifacts() { … }
}
ReadOnlyHeap::~ReadOnlyHeap() { … }
bool ReadOnlyHeap::IsSharedMemoryAvailable() { … }
SoleReadOnlyHeap* SoleReadOnlyHeap::shared_ro_heap_ = …;
void ReadOnlyHeap::SetUp(Isolate* isolate,
SnapshotData* read_only_snapshot_data,
bool can_rehash) { … }
void ReadOnlyHeap::DeserializeIntoIsolate(Isolate* isolate,
SnapshotData* read_only_snapshot_data,
bool can_rehash) { … }
void ReadOnlyHeap::OnCreateRootsComplete(Isolate* isolate) { … }
void ReadOnlyHeap::OnCreateHeapObjectsComplete(Isolate* isolate) { … }
ReadOnlyHeap::ReadOnlyHeap(ReadOnlyHeap* ro_heap, ReadOnlySpace* ro_space)
: … { … }
ReadOnlyHeap* ReadOnlyHeap::CreateInitialHeapForBootstrapping(
Isolate* isolate, std::shared_ptr<ReadOnlyArtifacts> artifacts) { … }
void SoleReadOnlyHeap::InitializeIsolateRoots(Isolate* isolate) { … }
void SoleReadOnlyHeap::InitializeFromIsolateRoots(Isolate* isolate) { … }
void ReadOnlyHeap::InitFromIsolate(Isolate* isolate) { … }
ReadOnlyHeap::ReadOnlyHeap(ReadOnlySpace* ro_space)
: … { … }
void ReadOnlyHeap::OnHeapTearDown(Heap* heap) { … }
void SoleReadOnlyHeap::OnHeapTearDown(Heap* heap) { … }
void ReadOnlyHeap::PopulateReadOnlySpaceStatistics(
SharedMemoryStatistics* statistics) { … }
bool ReadOnlyHeap::Contains(Address address) { … }
bool ReadOnlyHeap::Contains(Tagged<HeapObject> object) { … }
bool ReadOnlyHeap::SandboxSafeContains(Tagged<HeapObject> object) { … }
ReadOnlyHeapObjectIterator::ReadOnlyHeapObjectIterator(
const ReadOnlyHeap* ro_heap)
: … { … }
ReadOnlyHeapObjectIterator::ReadOnlyHeapObjectIterator(
const ReadOnlySpace* ro_space)
: … { … }
Tagged<HeapObject> ReadOnlyHeapObjectIterator::Next() { … }
ReadOnlyPageObjectIterator::ReadOnlyPageObjectIterator(
const ReadOnlyPageMetadata* page,
SkipFreeSpaceOrFiller skip_free_space_or_filler)
: … { … }
ReadOnlyPageObjectIterator::ReadOnlyPageObjectIterator(
const ReadOnlyPageMetadata* page, Address current_addr,
SkipFreeSpaceOrFiller skip_free_space_or_filler)
: … { … }
Tagged<HeapObject> ReadOnlyPageObjectIterator::Next() { … }
void ReadOnlyPageObjectIterator::Reset(const ReadOnlyPageMetadata* page) { … }
}
}