v8
3.25.30(node0.11.13)
V8 is Google's open source JavaScript engine
|
#include <heap-snapshot-generator.h>
Public Member Functions | |
HeapObjectsMap (Heap *heap) | |
Heap * | heap () const |
SnapshotObjectId | FindEntry (Address addr) |
SnapshotObjectId | FindOrAddEntry (Address addr, unsigned int size, bool accessed=true) |
bool | MoveObject (Address from, Address to, int size) |
void | UpdateObjectSize (Address addr, int size) |
SnapshotObjectId | last_assigned_id () const |
void | StopHeapObjectsTracking () |
SnapshotObjectId | PushHeapObjectsStats (OutputStream *stream) |
size_t | GetUsedMemorySize () const |
SnapshotObjectId | GenerateId (v8::RetainedObjectInfo *info) |
int | FindUntrackedObjects () |
void | UpdateHeapObjectsMap () |
void | RemoveDeadEntries () |
Static Public Member Functions | |
static SnapshotObjectId | GetNthGcSubrootId (int delta) |
Static Public Attributes | |
static const int | kObjectIdStep = 2 |
static const SnapshotObjectId | kInternalRootObjectId = 1 |
static const SnapshotObjectId | kGcRootsObjectId |
static const SnapshotObjectId | kNativesRootObjectId |
static const SnapshotObjectId | kGcRootsFirstSubrootId |
static const SnapshotObjectId | kFirstAvailableObjectId |
Definition at line 227 of file heap-snapshot-generator.h.
|
explicit |
Definition at line 384 of file heap-snapshot-generator.cc.
References List< T, P >::Add(), and v8::internal::NULL.
SnapshotObjectId FindEntry | ( | Address | addr | ) |
Definition at line 452 of file heap-snapshot-generator.cc.
References ASSERT, List< T, P >::at(), v8::internal::ComputePointerHash(), TemplateHashMapImpl< AllocationPolicy >::Lookup(), v8::internal::NULL, and TemplateHashMapImpl< AllocationPolicy >::occupancy().
SnapshotObjectId FindOrAddEntry | ( | Address | addr, |
unsigned int | size, | ||
bool | accessed = true |
||
) |
Definition at line 463 of file heap-snapshot-generator.cc.
References List< T, P >::Add(), ASSERT, List< T, P >::at(), v8::internal::ComputePointerHash(), HeapObjectsMap::kObjectIdStep, TemplateHashMapImpl< AllocationPolicy >::Lookup(), v8::internal::NULL, TemplateHashMapImpl< AllocationPolicy >::occupancy(), v8::internal::PrintF(), and v8::internal::size.
Referenced by V8HeapExplorer::AddEntry(), AllocationTracker::AllocationEvent(), HeapObjectsMap::UpdateHeapObjectsMap(), and HeapObjectsMap::UpdateObjectSize().
int FindUntrackedObjects | ( | ) |
Definition at line 570 of file heap-snapshot-generator.cc.
References List< T, P >::Add(), List< T, P >::at(), CHECK_EQ, v8::internal::ComputePointerHash(), TemplateHashMapImpl< AllocationPolicy >::Lookup(), v8::internal::NULL, obj, TemplateHashMapImpl< AllocationPolicy >::occupancy(), v8::internal::PrintF(), and List< T, P >::Sort().
Referenced by HeapObjectsTracker::~HeapObjectsTracker().
SnapshotObjectId GenerateId | ( | v8::RetainedObjectInfo * | info | ) |
Definition at line 711 of file heap-snapshot-generator.cc.
References v8::internal::ComputeIntegerHash(), RetainedObjectInfo::GetElementCount(), RetainedObjectInfo::GetHash(), RetainedObjectInfo::GetLabel(), Heap::HashSeed(), and StringHasher::HashSequentialString().
Referenced by BasicHeapEntriesAllocator::AllocateEntry().
|
inlinestatic |
Definition at line 69 of file heap-snapshot-generator-inl.h.
References HeapObjectsMap::kGcRootsFirstSubrootId, and HeapObjectsMap::kObjectIdStep.
Referenced by HeapSnapshot::AddGcSubrootEntry().
size_t GetUsedMemorySize | ( | ) | const |
Definition at line 725 of file heap-snapshot-generator.cc.
References TemplateHashMapImpl< AllocationPolicy >::capacity(), and v8::internal::GetMemoryUsedByList().
|
inline |
Definition at line 231 of file heap-snapshot-generator.h.
Referenced by AllocationTracker::AllocationEvent().
|
inline |
Definition at line 239 of file heap-snapshot-generator.h.
References HeapObjectsMap::kObjectIdStep.
Referenced by HeapObjectsMap::PushHeapObjectsStats(), and HeapSnapshot::RememberLastJSObjectId().
Definition at line 399 of file heap-snapshot-generator.cc.
References ASSERT, List< T, P >::at(), v8::internal::ComputePointerHash(), TemplateHashMapImpl< AllocationPolicy >::Lookup(), v8::internal::NULL, v8::internal::PrintF(), and TemplateHashMapImpl< AllocationPolicy >::Remove().
SnapshotObjectId PushHeapObjectsStats | ( | OutputStream * | stream | ) |
Definition at line 635 of file heap-snapshot-generator.cc.
References List< T, P >::Add(), ASSERT, OutputStream::EndOfStream(), List< T, P >::first(), OutputStream::GetChunkSize(), OutputStream::kAbort, List< T, P >::last(), HeapObjectsMap::last_assigned_id(), HeapObjectsMap::UpdateHeapObjectsMap(), and OutputStream::WriteHeapStatsChunk().
void RemoveDeadEntries | ( | ) |
Definition at line 681 of file heap-snapshot-generator.cc.
References ASSERT, List< T, P >::at(), v8::internal::ComputePointerHash(), TemplateHashMapImpl< AllocationPolicy >::Lookup(), v8::internal::NULL, TemplateHashMapImpl< AllocationPolicy >::occupancy(), and TemplateHashMapImpl< AllocationPolicy >::Remove().
Referenced by HeapObjectsMap::UpdateHeapObjectsMap().
void StopHeapObjectsTracking | ( | ) |
Definition at line 492 of file heap-snapshot-generator.cc.
void UpdateHeapObjectsMap | ( | ) |
Definition at line 497 of file heap-snapshot-generator.cc.
References Heap::CollectAllGarbage(), HeapObjectsMap::FindOrAddEntry(), Heap::kMakeHeapIterableMask, v8::internal::NULL, obj, TemplateHashMapImpl< AllocationPolicy >::occupancy(), v8::internal::PrintF(), and HeapObjectsMap::RemoveDeadEntries().
Referenced by HeapObjectsMap::PushHeapObjectsStats().
void UpdateObjectSize | ( | Address | addr, |
int | size | ||
) |
Definition at line 447 of file heap-snapshot-generator.cc.
References HeapObjectsMap::FindOrAddEntry().
|
static |
Definition at line 255 of file heap-snapshot-generator.h.
|
static |
Definition at line 254 of file heap-snapshot-generator.h.
Referenced by HeapObjectsMap::GetNthGcSubrootId().
|
static |
Definition at line 252 of file heap-snapshot-generator.h.
Referenced by HeapSnapshot::AddGcRootsEntry().
|
static |
Definition at line 251 of file heap-snapshot-generator.h.
Referenced by HeapSnapshot::AddRootEntry().
|
static |
Definition at line 253 of file heap-snapshot-generator.h.
|
static |
Definition at line 250 of file heap-snapshot-generator.h.
Referenced by HeapObjectsMap::FindOrAddEntry(), HeapObjectsMap::GetNthGcSubrootId(), and HeapObjectsMap::last_assigned_id().