31thread_local LocalHeap* g_current_local_heap_
V8_CONSTINIT =
nullptr;
37 g_current_local_heap_ = local_heap;
41void LocalHeap::VerifyCurrent()
const {
42 LocalHeap* current = LocalHeap::Current();
52 std::unique_ptr<PersistentHandles> persistent_handles)
54 ptr_compr_cage_access_scope_(
heap->isolate()),
58 thread_handle_(pthread_self()),
60 allocation_failed_(false),
61 nested_parked_scopes_(0),
65 persistent_handles_(
std::move(persistent_handles)),
66 heap_allocator_(this) {
68 (
v8_flags.concurrent_builtin_generation &&
69 heap->isolate()->IsGeneratingEmbeddedBuiltins()) ||
166 if (isolate->has_shared_space() && !isolate->is_shared_space_isolate()) {
167 if (isolate->shared_space_isolate()
169 ->incremental_marking()
170 ->IsMajorMarking()) {
184 std::unique_ptr<PersistentHandles> persistent_handles) {
196bool LocalHeap::ContainsPersistentHandle(
Address* location) {
200bool LocalHeap::ContainsLocalHandle(
Address* location) {
204bool LocalHeap::IsHandleDereferenceAllowed() {
246 if (!
heap()->ignore_local_gc_requests()) {
301 if (!
heap()->ignore_local_gc_requests()) {
321 scope_id = GCTracer::Scope::UNPARK;
324 scope_id = GCTracer::Scope::BACKGROUND_UNPARK;
364 scope_id = GCTracer::Scope::SAFEPOINT;
367 scope_id = GCTracer::Scope::BACKGROUND_SAFEPOINT;
383 std::optional<IgnoreLocalGCRequests> ignore_gc_requests;
390bool LocalHeap::IsSafeForConservativeStackScanning()
const {
391#if defined(V8_ENABLE_DIRECT_HANDLE) && defined(ENABLE_SLOW_DCHECKS)
393 if (DirectHandleBase::NumberOfHandles() > 0)
return false;
416void LocalHeap::VerifyLinearAllocationAreas()
const {
477 clear_recorded_slots);
void SetScanSimulatorCallback(StackVisitorCallback callback)
static Isolate * TryGetCurrent()
void Remove(CallbackType callback, void *data)
void Invoke(GCType gc_type) const
void Add(CallbackType callback, void *data, GCType gc_type)
void MarkLinearAllocationAreasBlack()
void MakeLinearAllocationAreasIterable()
void Setup(LinearAllocationArea *new_allocation_info=nullptr, LinearAllocationArea *old_allocation_info=nullptr)
MainAllocator * shared_space_allocator()
void FreeLinearAllocationAreas()
void UnmarkLinearAllocationsArea()
void FreeLinearAllocationAreasAndResetFreeLists()
std::unique_ptr< CollectionBarrier > collection_barrier_
IncrementalMarking * incremental_marking() const
void WeakenDescriptorArrays(GlobalHandleVector< DescriptorArray > strong_descriptor_arrays)
IsolateSafepoint * safepoint()
Isolate * isolate() const
void CollectGarbageForBackground(LocalHeap *local_heap)
void NotifyObjectSizeChange(Tagged< HeapObject >, int old_size, int new_size, ClearRecordedSlots clear_recorded_slots)
bool deserialization_complete() const
MarkingMode marking_mode() const
void AddLocalHeap(LocalHeap *local_heap, Callback callback)
void RemoveLocalHeap(LocalHeap *local_heap, Callback callback)
static void SetCurrent(Isolate *isolate)
static void IterateRegistersAndStackOfSimulator(::heap::base::StackVisitor *visitor)
static V8_INLINE Isolate * Current()
std::unique_ptr< PersistentHandles > NewPersistentHandles()
ThreadState load_relaxed() const
bool CompareExchangeStrong(ThreadState &expected, ThreadState updated)
constexpr bool IsRunning() const
constexpr bool IsCollectionRequested() const
constexpr ThreadState SetRunning() const V8_WARN_UNUSED_RESULT
static constexpr ThreadState Parked()
constexpr bool IsParked() const
constexpr ThreadState SetParked() const V8_WARN_UNUSED_RESULT
constexpr bool IsSafepointRequested() const
static constexpr ThreadState Running()
void WeakenDescriptorArrays(GlobalHandleVector< DescriptorArray > strong_descriptor_arrays)
int nested_parked_scopes_
bool is_main_thread() const
void InvokeGCEpilogueCallbacksInSafepoint(GCCallbacksInSafepoint::GCType gc_type)
Isolate * saved_current_isolate_
void MarkSharedLinearAllocationAreasBlack()
LocalHeap(Heap *heap, ThreadKind kind, std::unique_ptr< PersistentHandles > persistent_handles=nullptr)
void(void *) GCEpilogueCallback
std::unique_ptr< PersistentHandles > DetachPersistentHandles()
V8_INLINE bool is_in_trampoline() const
void SetUpSharedMarking()
::heap::base::Stack stack_
void EnsurePersistentHandles()
void FreeLinearAllocationAreasAndResetFreeLists()
void MarkLinearAllocationAreasBlack()
void UnmarkSharedLinearAllocationsArea()
std::unique_ptr< MarkingBarrier > marking_barrier_
void NotifyObjectSizeChange(Tagged< HeapObject > object, int old_size, int new_size, ClearRecordedSlots clear_recorded_slots)
void SetUpMainThreadForTesting()
void SetUpMarkingBarrier()
HeapAllocator heap_allocator_
void SetUpMainThread(LinearAllocationArea &new_allocation_info, LinearAllocationArea &old_allocation_info)
void FreeLinearAllocationAreas()
GCCallbacksInSafepoint gc_epilogue_callbacks_
void MakeLinearAllocationAreasIterable()
std::unique_ptr< LocalHandles > handles_
void EnsureParkedBeforeDestruction()
void UnmarkLinearAllocationsArea()
MarkingBarrier * saved_marking_barrier_
V8_INLINE void ExecuteWithStackMarker(Callback callback)
std::unique_ptr< PersistentHandles > persistent_handles_
void AttachPersistentHandles(std::unique_ptr< PersistentHandles > persistent_handles)
static void SetCurrent(LocalHeap *local_heap)
void RemoveGCEpilogueCallback(GCEpilogueCallback *callback, void *data)
void AddGCEpilogueCallback(GCEpilogueCallback *callback, void *data, GCCallbacksInSafepoint::GCType gc_type=GCCallbacksInSafepoint::GCType::kAll)
void FreeSharedLinearAllocationAreasAndResetFreeLists()
V8_EXPORT_PRIVATE void MarkLinearAllocationAreaBlack()
V8_EXPORT_PRIVATE void UnmarkLinearAllocationArea()
V8_EXPORT_PRIVATE void FreeLinearAllocationAreaAndResetFreeList()
static MarkingBarrier * SetForThread(MarkingBarrier *marking_barrier)
enum v8::internal::@1270::DeoptimizableCodeIterator::@67 state_
#define TRACE_GC1(tracer, scope_id, thread_kind)
thread_local Isolate::PerIsolateThreadData *g_current_per_isolate_thread_data_ V8_CONSTINIT
V8_EXPORT_PRIVATE FlagValues v8_flags
#define CHECK_IMPLIES(lhs, rhs)
#define DCHECK_IMPLIES(v1, v2)
#define DCHECK(condition)
#define DCHECK_EQ(v1, v2)
#define V8_TLS_DEFINE_GETTER(Name, Type, Member)