#include "src/heap/local-heap.h"
#include <atomic>
#include <memory>
#include <optional>
#include "src/base/logging.h"
#include "src/base/platform/mutex.h"
#include "src/common/globals.h"
#include "src/execution/isolate.h"
#include "src/handles/local-handles.h"
#include "src/heap/collection-barrier.h"
#include "src/heap/gc-tracer-inl.h"
#include "src/heap/gc-tracer.h"
#include "src/heap/heap-inl.h"
#include "src/heap/heap-write-barrier.h"
#include "src/heap/heap.h"
#include "src/heap/local-heap-inl.h"
#include "src/heap/main-allocator.h"
#include "src/heap/marking-barrier.h"
#include "src/heap/parked-scope.h"
#include "src/heap/safepoint.h"
namespace v8 {
namespace internal {
namespace {
thread_local LocalHeap* current_local_heap = …;
}
LocalHeap* LocalHeap::Current() { … }
#ifdef DEBUG
void LocalHeap::VerifyCurrent() const { … }
#endif
LocalHeap::LocalHeap(Heap* heap, ThreadKind kind,
std::unique_ptr<PersistentHandles> persistent_handles)
: … { … }
LocalHeap::~LocalHeap() { … }
void LocalHeap::SetUpMainThreadForTesting() { … }
void LocalHeap::SetUpMainThread(LinearAllocationArea& new_allocation_info,
LinearAllocationArea& old_allocation_info) { … }
void LocalHeap::SetUpMarkingBarrier() { … }
void LocalHeap::SetUpSharedMarking() { … }
void LocalHeap::EnsurePersistentHandles() { … }
void LocalHeap::AttachPersistentHandles(
std::unique_ptr<PersistentHandles> persistent_handles) { … }
std::unique_ptr<PersistentHandles> LocalHeap::DetachPersistentHandles() { … }
#ifdef DEBUG
bool LocalHeap::ContainsPersistentHandle(Address* location) { … }
bool LocalHeap::ContainsLocalHandle(Address* location) { … }
bool LocalHeap::IsHandleDereferenceAllowed() { … }
#endif
bool LocalHeap::IsParked() const { … }
bool LocalHeap::IsRunning() const { … }
void LocalHeap::ParkSlowPath() { … }
void LocalHeap::UnparkSlowPath() { … }
void LocalHeap::SleepInUnpark() { … }
void LocalHeap::EnsureParkedBeforeDestruction() { … }
void LocalHeap::SafepointSlowPath() { … }
void LocalHeap::SleepInSafepoint() { … }
#ifdef DEBUG
bool LocalHeap::IsSafeForConservativeStackScanning() const { … }
#endif
void LocalHeap::FreeLinearAllocationAreas() { … }
#if DEBUG
void LocalHeap::VerifyLinearAllocationAreas() const { … }
#endif
void LocalHeap::MakeLinearAllocationAreasIterable() { … }
void LocalHeap::MarkLinearAllocationAreasBlack() { … }
void LocalHeap::UnmarkLinearAllocationsArea() { … }
void LocalHeap::MarkSharedLinearAllocationAreasBlack() { … }
void LocalHeap::UnmarkSharedLinearAllocationsArea() { … }
void LocalHeap::AddGCEpilogueCallback(GCEpilogueCallback* callback, void* data,
GCCallbacksInSafepoint::GCType gc_type) { … }
void LocalHeap::RemoveGCEpilogueCallback(GCEpilogueCallback* callback,
void* data) { … }
void LocalHeap::InvokeGCEpilogueCallbacksInSafepoint(
GCCallbacksInSafepoint::GCType gc_type) { … }
void LocalHeap::NotifyObjectSizeChange(
Tagged<HeapObject> object, int old_size, int new_size,
ClearRecordedSlots clear_recorded_slots) { … }
void LocalHeap::WeakenDescriptorArrays(
GlobalHandleVector<DescriptorArray> strong_descriptor_arrays) { … }
}
}