V8 Project
|
#include <global-handles.h>
Classes | |
class | Node |
class | NodeBlock |
class | NodeIterator |
Public Types | |
typedef WeakCallbackData< v8::Value, void >::Callback | WeakCallback |
Static Public Member Functions | |
static Handle< Object > | CopyGlobal (Object **location) |
static void | Destroy (Object **location) |
static void | MakeWeak (Object **location, void *parameter, WeakCallback weak_callback) |
static void * | ClearWeakness (Object **location) |
static void | MarkIndependent (Object **location) |
static void | MarkPartiallyDependent (Object **location) |
static bool | IsIndependent (Object **location) |
static bool | IsNearDeath (Object **location) |
static bool | IsWeak (Object **location) |
Private Member Functions | |
GlobalHandles (Isolate *isolate) | |
void | ComputeObjectGroupsAndImplicitReferences () |
DISALLOW_COPY_AND_ASSIGN (GlobalHandles) | |
Static Private Attributes | |
static const int | kObjectGroupConnectionsCapacity = 20 |
Friends | |
class | Isolate |
Definition at line 100 of file global-handles.h.
typedef WeakCallbackData<v8::Value, void>::Callback v8::internal::GlobalHandles::WeakCallback |
Definition at line 113 of file global-handles.h.
v8::internal::GlobalHandles::~GlobalHandles | ( | ) |
Definition at line 437 of file global-handles.cc.
References first_block_, v8::internal::GlobalHandles::NodeBlock::next(), and NULL.
|
explicitprivate |
Definition at line 427 of file global-handles.cc.
void v8::internal::GlobalHandles::AddObjectGroup | ( | Object *** | handles, |
size_t | length, | ||
v8::RetainedObjectInfo * | info | ||
) |
Definition at line 816 of file global-handles.cc.
References DCHECK, v8::RetainedObjectInfo::Dispose(), v8::internal::GlobalHandles::Node::FromLocation(), v8::internal::ObjectGroup::info, NULL, object_groups_, and v8::internal::ObjectGroup::objects.
|
static |
Definition at line 485 of file global-handles.cc.
References v8::internal::GlobalHandles::Node::ClearWeakness(), and v8::internal::GlobalHandles::Node::FromLocation().
Referenced by v8::internal::ScriptCache::Clear(), and v8::V8::ClearWeak().
|
private |
Definition at line 888 of file global-handles.cc.
References v8::internal::ImplicitRefGroup::children, v8::RetainedObjectInfo::Dispose(), implicit_ref_connections_, implicit_ref_groups_, v8::internal::ObjectGroup::info, kObjectGroupConnectionsCapacity, NULL, object_group_connections_, object_groups_, v8::internal::ObjectGroup::objects, and retainer_infos_.
Referenced by implicit_ref_groups(), IterateObjectGroups(), and object_groups().
Definition at line 467 of file global-handles.cc.
References Create(), DCHECK, v8::internal::GlobalHandles::Node::FromLocation(), v8::internal::GlobalHandles::Node::GetGlobalHandles(), and NULL.
Referenced by v8::V8::CopyPersistent().
Definition at line 448 of file global-handles.cc.
References v8::internal::GlobalHandles::Node::Acquire(), DCHECK, first_block_, first_free_, v8::internal::GlobalHandles::Node::handle(), v8::internal::Isolate::heap(), v8::internal::Heap::InNewSpace(), v8::internal::GlobalHandles::Node::is_in_new_space_list(), isolate_, new_space_nodes_, v8::internal::GlobalHandles::Node::next_free, NULL, v8::internal::GlobalHandles::NodeBlock::PutNodesOnFreeList(), and v8::internal::GlobalHandles::Node::set_in_new_space_list().
Referenced by v8::internal::ScriptCache::Add(), CopyGlobal(), v8::internal::DebugInfoListNode::DebugInfoListNode(), v8::V8::GlobalizeReference(), v8::internal::Debug::Load(), v8::internal::ArrayConcatVisitor::set_storage(), v8::internal::Debug::SetEventListener(), and v8::internal::AllocationTracker::UnresolvedLocation::UnresolvedLocation().
|
static |
Definition at line 473 of file global-handles.cc.
References v8::internal::GlobalHandles::Node::FromLocation(), NULL, and v8::internal::GlobalHandles::Node::Release().
Referenced by v8::internal::ScriptCache::Clear(), v8::internal::ArrayConcatVisitor::clear_storage(), v8::internal::DestroyGlobalHandle(), v8::V8::DisposeGlobal(), v8::internal::AllocationTracker::UnresolvedLocation::HandleWeakScript(), v8::internal::ScriptCache::HandleWeakScript(), v8::internal::Isolate::PopPromise(), v8::internal::Debug::SetEventListener(), v8::internal::Debug::Unload(), v8::internal::DebugInfoListNode::~DebugInfoListNode(), and v8::internal::AllocationTracker::UnresolvedLocation::~UnresolvedLocation().
|
private |
|
inline |
Definition at line 135 of file global-handles.h.
References number_of_global_handles_.
void v8::internal::GlobalHandles::IdentifyNewSpaceWeakIndependentHandles | ( | WeakSlotCallbackWithHeap | f | ) |
Definition at line 543 of file global-handles.cc.
References DCHECK, v8::internal::Isolate::heap(), v8::internal::GlobalHandles::Node::is_in_new_space_list(), v8::internal::GlobalHandles::Node::is_independent(), v8::internal::GlobalHandles::Node::is_partially_dependent(), isolate_, v8::internal::GlobalHandles::Node::IsWeak(), v8::internal::GlobalHandles::Node::location(), v8::internal::GlobalHandles::Node::MarkPending(), and new_space_nodes_.
Referenced by v8::internal::Heap::Scavenge().
void v8::internal::GlobalHandles::IdentifyWeakHandles | ( | WeakSlotCallback | f | ) |
Definition at line 522 of file global-handles.cc.
References v8::internal::GlobalHandles::NodeIterator::done().
Referenced by v8::internal::MarkCompactCollector::MarkLiveObjects().
|
inline |
Definition at line 233 of file global-handles.h.
References ComputeObjectGroupsAndImplicitReferences(), and implicit_ref_groups_.
Referenced by v8::internal::NativeObjectsExplorer::FillImplicitReferences(), and v8::internal::MarkCompactCollector::MarkImplicitRefGroups().
Definition at line 500 of file global-handles.cc.
References v8::internal::GlobalHandles::Node::FromLocation(), and v8::internal::GlobalHandles::Node::is_independent().
Definition at line 505 of file global-handles.cc.
References v8::internal::GlobalHandles::Node::FromLocation(), and v8::internal::GlobalHandles::Node::IsNearDeath().
|
inline |
Definition at line 245 of file global-handles.h.
References isolate_.
Referenced by v8::internal::GlobalHandles::Node::DecreaseBlockUses(), v8::internal::GlobalHandles::Node::IncreaseBlockUses(), v8::internal::GlobalHandles::Node::MarkPartiallyDependent(), and v8::internal::GlobalHandles::Node::PostGarbageCollectionProcessing().
Definition at line 510 of file global-handles.cc.
References v8::internal::GlobalHandles::Node::FromLocation(), and v8::internal::GlobalHandles::Node::IsWeak().
void v8::internal::GlobalHandles::IterateAllRoots | ( | ObjectVisitor * | v | ) |
Definition at line 702 of file global-handles.cc.
References v8::internal::GlobalHandles::NodeIterator::done().
Referenced by v8::internal::Heap::IterateStrongRoots(), and v8::internal::V8HeapExplorer::TagGlobalObjects().
void v8::internal::GlobalHandles::IterateAllRootsInNewSpaceWithClassIds | ( | ObjectVisitor * | v | ) |
Definition at line 721 of file global-handles.cc.
References v8::internal::GlobalHandles::Node::has_wrapper_class_id(), v8::internal::GlobalHandles::Node::IsRetainer(), v8::internal::GlobalHandles::Node::location(), new_space_nodes_, and v8::internal::GlobalHandles::Node::wrapper_class_id().
Referenced by v8::V8::VisitHandlesForPartialDependence().
void v8::internal::GlobalHandles::IterateAllRootsWithClassIds | ( | ObjectVisitor * | v | ) |
Definition at line 711 of file global-handles.cc.
References v8::internal::GlobalHandles::NodeIterator::done().
Referenced by v8::internal::NativeObjectsExplorer::FillRetainedObjects(), and v8::V8::VisitHandlesWithClassIds().
void v8::internal::GlobalHandles::IterateNewSpaceStrongAndDependentRoots | ( | ObjectVisitor * | v | ) |
Definition at line 531 of file global-handles.cc.
References v8::internal::GlobalHandles::Node::is_independent(), v8::internal::GlobalHandles::Node::is_partially_dependent(), v8::internal::GlobalHandles::Node::IsStrongRetainer(), v8::internal::GlobalHandles::Node::IsWeakRetainer(), v8::internal::GlobalHandles::Node::location(), and new_space_nodes_.
Referenced by v8::internal::Heap::IterateStrongRoots().
void v8::internal::GlobalHandles::IterateNewSpaceWeakIndependentRoots | ( | ObjectVisitor * | v | ) |
Definition at line 556 of file global-handles.cc.
References DCHECK, v8::internal::GlobalHandles::Node::is_in_new_space_list(), v8::internal::GlobalHandles::Node::is_independent(), v8::internal::GlobalHandles::Node::is_partially_dependent(), v8::internal::GlobalHandles::Node::IsWeakRetainer(), v8::internal::GlobalHandles::Node::location(), and new_space_nodes_.
Referenced by v8::internal::Heap::Scavenge().
bool v8::internal::GlobalHandles::IterateObjectGroups | ( | ObjectVisitor * | v, |
WeakSlotCallbackWithHeap | can_skip | ||
) |
Definition at line 568 of file global-handles.cc.
References ComputeObjectGroupsAndImplicitReferences(), DCHECK, v8::internal::Isolate::heap(), isolate_, v8::internal::ObjectGroup::length, NULL, object_groups_, and v8::internal::ObjectGroup::objects.
Referenced by v8::internal::MarkCompactCollector::ProcessEphemeralMarking().
void v8::internal::GlobalHandles::IterateStrongRoots | ( | ObjectVisitor * | v | ) |
Definition at line 693 of file global-handles.cc.
References v8::internal::GlobalHandles::NodeIterator::done().
Referenced by v8::internal::Heap::IterateStrongRoots().
void v8::internal::GlobalHandles::IterateWeakRoots | ( | ObjectVisitor * | v | ) |
Definition at line 515 of file global-handles.cc.
References v8::internal::GlobalHandles::NodeIterator::done().
Referenced by v8::internal::MarkCompactCollector::MarkLiveObjects().
|
static |
Definition at line 478 of file global-handles.cc.
References v8::internal::GlobalHandles::Node::FromLocation(), and v8::internal::GlobalHandles::Node::MakeWeak().
Referenced by v8::internal::ScriptCache::Add(), v8::internal::DebugInfoListNode::DebugInfoListNode(), v8::V8::MakeWeak(), and v8::internal::AllocationTracker::UnresolvedLocation::UnresolvedLocation().
|
static |
Definition at line 490 of file global-handles.cc.
References v8::internal::GlobalHandles::Node::FromLocation(), and v8::internal::GlobalHandles::Node::MarkIndependent().
|
static |
Definition at line 495 of file global-handles.cc.
References v8::internal::GlobalHandles::Node::FromLocation(), and v8::internal::GlobalHandles::Node::MarkPartiallyDependent().
int v8::internal::GlobalHandles::NumberOfGlobalObjectWeakHandles | ( | ) |
Definition at line 743 of file global-handles.cc.
References v8::internal::GlobalHandles::NodeIterator::done().
int v8::internal::GlobalHandles::NumberOfWeakHandles | ( | ) |
Definition at line 732 of file global-handles.cc.
References v8::internal::GlobalHandles::NodeIterator::done().
Referenced by v8::internal::StartupSerializer::SerializeStrongReferences().
|
inline |
Definition at line 228 of file global-handles.h.
References ComputeObjectGroupsAndImplicitReferences(), and object_groups_.
Referenced by v8::internal::NativeObjectsExplorer::FillRetainedObjects().
int v8::internal::GlobalHandles::PostGarbageCollectionProcessing | ( | GarbageCollector | collector | ) |
Definition at line 614 of file global-handles.cc.
References v8::internal::GlobalHandles::Node::clear_partially_dependent(), DCHECK, v8::internal::GlobalHandles::NodeIterator::done(), v8::internal::Heap::gc_state(), v8::internal::Isolate::heap(), v8::internal::Heap::IncrementNodesCopiedInNewSpace(), v8::internal::Heap::IncrementNodesDiedInNewSpace(), v8::internal::Heap::IncrementNodesPromoted(), v8::internal::Heap::InNewSpace(), v8::internal::GlobalHandles::Node::is_in_new_space_list(), v8::internal::GlobalHandles::Node::is_independent(), v8::internal::GlobalHandles::Node::is_partially_dependent(), isolate_, v8::internal::GlobalHandles::Node::IsRetainer(), new_space_nodes_, v8::internal::Heap::NOT_IN_GC, v8::internal::GlobalHandles::Node::object(), post_gc_processing_count_, v8::internal::GlobalHandles::Node::PostGarbageCollectionProcessing(), v8::internal::SCAVENGER, and v8::internal::GlobalHandles::Node::set_in_new_space_list().
Referenced by v8::internal::Heap::PerformGarbageCollection().
void v8::internal::GlobalHandles::RecordStats | ( | HeapStats * | stats | ) |
Definition at line 755 of file global-handles.cc.
References v8::internal::GlobalHandles::NodeIterator::done(), v8::internal::GlobalHandles::Node::FREE, v8::internal::HeapStats::free_global_handle_count, v8::internal::HeapStats::global_handle_count, v8::internal::GlobalHandles::Node::NEAR_DEATH, v8::internal::HeapStats::near_death_global_handle_count, v8::internal::GlobalHandles::Node::PENDING, v8::internal::HeapStats::pending_global_handle_count, v8::internal::GlobalHandles::Node::WEAK, and v8::internal::HeapStats::weak_global_handle_count.
Referenced by v8::internal::Heap::RecordStats().
void v8::internal::GlobalHandles::RemoveImplicitRefGroups | ( | ) |
Definition at line 874 of file global-handles.cc.
References implicit_ref_connections_, and implicit_ref_groups_.
Referenced by v8::internal::MarkCompactCollector::AfterMarking(), v8::internal::NativeObjectsExplorer::FillImplicitReferences(), and v8::internal::Heap::Scavenge().
void v8::internal::GlobalHandles::RemoveObjectGroups | ( | ) |
Definition at line 862 of file global-handles.cc.
References kObjectGroupConnectionsCapacity, object_group_connections_, object_groups_, and retainer_infos_.
Referenced by v8::internal::MarkCompactCollector::AfterMarking(), v8::internal::NativeObjectsExplorer::FillRetainedObjects(), and v8::internal::Heap::Scavenge().
Definition at line 836 of file global-handles.cc.
References v8::internal::handle(), and object_group_connections_.
Referenced by v8::Isolate::SetObjectGroupId().
void v8::internal::GlobalHandles::SetReference | ( | HeapObject ** | parent, |
Object ** | child | ||
) |
Definition at line 854 of file global-handles.cc.
References v8::internal::ImplicitRefGroup::children, DCHECK, v8::internal::GlobalHandles::Node::FromLocation(), and implicit_ref_groups_.
Referenced by v8::Isolate::SetReference().
Definition at line 848 of file global-handles.cc.
References DCHECK, v8::internal::GlobalHandles::Node::FromLocation(), and implicit_ref_connections_.
Referenced by v8::Isolate::SetReferenceFromGroup().
void v8::internal::GlobalHandles::SetRetainedObjectInfo | ( | UniqueId | id, |
RetainedObjectInfo * | info | ||
) |
Definition at line 842 of file global-handles.cc.
References retainer_infos_.
Referenced by v8::internal::HeapProfiler::SetRetainedObjectInfo().
void v8::internal::GlobalHandles::TearDown | ( | ) |
Definition at line 883 of file global-handles.cc.
Referenced by v8::internal::Heap::TearDown().
|
friend |
Definition at line 300 of file global-handles.h.
|
private |
Definition at line 275 of file global-handles.h.
Referenced by Create(), and ~GlobalHandles().
|
private |
Definition at line 281 of file global-handles.h.
Referenced by Create(), and v8::internal::GlobalHandles::Node::DecreaseBlockUses().
|
private |
Definition at line 278 of file global-handles.h.
Referenced by v8::internal::GlobalHandles::NodeBlock::DecreaseUses(), and v8::internal::GlobalHandles::NodeBlock::IncreaseUses().
|
private |
Definition at line 298 of file global-handles.h.
Referenced by ComputeObjectGroupsAndImplicitReferences(), RemoveImplicitRefGroups(), and SetReferenceFromGroup().
|
private |
Definition at line 292 of file global-handles.h.
Referenced by ComputeObjectGroupsAndImplicitReferences(), implicit_ref_groups(), RemoveImplicitRefGroups(), and SetReference().
|
private |
Definition at line 269 of file global-handles.h.
Referenced by Create(), IdentifyNewSpaceWeakIndependentHandles(), isolate(), IterateObjectGroups(), and PostGarbageCollectionProcessing().
|
staticprivate |
Definition at line 262 of file global-handles.h.
Referenced by ComputeObjectGroupsAndImplicitReferences(), and RemoveObjectGroups().
Definition at line 285 of file global-handles.h.
Referenced by Create(), IdentifyNewSpaceWeakIndependentHandles(), IterateAllRootsInNewSpaceWithClassIds(), IterateNewSpaceStrongAndDependentRoots(), IterateNewSpaceWeakIndependentRoots(), and PostGarbageCollectionProcessing().
|
private |
Definition at line 272 of file global-handles.h.
Referenced by v8::internal::GlobalHandles::Node::DecreaseBlockUses(), global_handles_count(), and v8::internal::GlobalHandles::Node::IncreaseBlockUses().
|
private |
Definition at line 296 of file global-handles.h.
Referenced by ComputeObjectGroupsAndImplicitReferences(), RemoveObjectGroups(), and SetObjectGroupId().
|
private |
Definition at line 291 of file global-handles.h.
Referenced by AddObjectGroup(), ComputeObjectGroupsAndImplicitReferences(), IterateObjectGroups(), object_groups(), and RemoveObjectGroups().
|
private |
Definition at line 287 of file global-handles.h.
Referenced by PostGarbageCollectionProcessing().
|
private |
Definition at line 297 of file global-handles.h.
Referenced by ComputeObjectGroupsAndImplicitReferences(), RemoveObjectGroups(), and SetRetainedObjectInfo().