V8 Project
|
#include <heap-snapshot-generator.h>
Classes | |
struct | EntryInfo |
struct | TimeInterval |
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 Attributes | |
static const int | kObjectIdStep = 2 |
static const SnapshotObjectId | kInternalRootObjectId = 1 |
static const SnapshotObjectId | kGcRootsObjectId |
static const SnapshotObjectId | kGcRootsFirstSubrootId |
static const SnapshotObjectId | kFirstAvailableObjectId |
Private Member Functions | |
DISALLOW_COPY_AND_ASSIGN (HeapObjectsMap) | |
Private Attributes | |
SnapshotObjectId | next_id_ |
HashMap | entries_map_ |
List< EntryInfo > | entries_ |
List< TimeInterval > | time_intervals_ |
Heap * | heap_ |
Definition at line 204 of file heap-snapshot-generator.h.
|
explicit |
Definition at line 369 of file heap-snapshot-generator.cc.
|
private |
SnapshotObjectId v8::internal::HeapObjectsMap::FindEntry | ( | Address | addr | ) |
Definition at line 437 of file heap-snapshot-generator.cc.
References v8::internal::ComputePointerHash(), DCHECK, entries_, entries_map_, v8::internal::HeapObjectsMap::EntryInfo::id, v8::internal::TemplateHashMapImpl< AllocationPolicy >::Lookup(), NULL, and v8::internal::TemplateHashMapImpl< AllocationPolicy >::occupancy().
SnapshotObjectId v8::internal::HeapObjectsMap::FindOrAddEntry | ( | Address | addr, |
unsigned int | size, | ||
bool | accessed = true |
||
) |
Definition at line 448 of file heap-snapshot-generator.cc.
References v8::internal::HeapObjectsMap::EntryInfo::accessed, v8::internal::ComputePointerHash(), DCHECK, entries_, entries_map_, v8::internal::HeapObjectsMap::EntryInfo::id, kObjectIdStep, v8::internal::TemplateHashMapImpl< AllocationPolicy >::Lookup(), next_id_, NULL, v8::internal::TemplateHashMapImpl< AllocationPolicy >::occupancy(), v8::internal::PrintF(), size, and v8::internal::HeapObjectsMap::EntryInfo::size.
Referenced by v8::internal::V8HeapExplorer::AddEntry(), v8::internal::AllocationTracker::AllocationEvent(), UpdateHeapObjectsMap(), and UpdateObjectSize().
int v8::internal::HeapObjectsMap::FindUntrackedObjects | ( | ) |
Definition at line 555 of file heap-snapshot-generator.cc.
References v8::internal::List< T, AllocationPolicy >::Add(), CHECK_EQ, v8::internal::anonymous_namespace{heap-snapshot-generator.cc}::comparator(), v8::internal::ComputePointerHash(), entries_, entries_map_, heap_, v8::internal::TemplateHashMapImpl< AllocationPolicy >::Lookup(), NULL, v8::internal::TemplateHashMapImpl< AllocationPolicy >::occupancy(), v8::internal::PrintF(), v8::internal::HeapObjectsMap::EntryInfo::size, and v8::internal::List< T, AllocationPolicy >::Sort().
SnapshotObjectId v8::internal::HeapObjectsMap::GenerateId | ( | v8::RetainedObjectInfo * | info | ) |
Definition at line 696 of file heap-snapshot-generator.cc.
References v8::internal::ComputeIntegerHash(), v8::RetainedObjectInfo::GetElementCount(), v8::RetainedObjectInfo::GetHash(), v8::RetainedObjectInfo::GetLabel(), v8::internal::Heap::HashSeed(), v8::internal::StringHasher::HashSequentialString(), heap_, and v8::internal::kZeroHashSeed.
Referenced by v8::internal::BasicHeapEntriesAllocator::AllocateEntry().
size_t v8::internal::HeapObjectsMap::GetUsedMemorySize | ( | ) | const |
Definition at line 710 of file heap-snapshot-generator.cc.
References v8::internal::TemplateHashMapImpl< AllocationPolicy >::capacity(), entries_, entries_map_, v8::internal::GetMemoryUsedByList(), and time_intervals_.
|
inline |
Definition at line 208 of file heap-snapshot-generator.h.
References heap_.
Referenced by v8::internal::AllocationTracker::AllocationEvent().
|
inline |
Definition at line 216 of file heap-snapshot-generator.h.
References kObjectIdStep, and next_id_.
Referenced by PushHeapObjectsStats(), and v8::internal::HeapSnapshot::RememberLastJSObjectId().
Definition at line 384 of file heap-snapshot-generator.cc.
References v8::internal::ComputePointerHash(), DCHECK, entries_, entries_map_, v8::internal::TemplateHashMapImpl< AllocationPolicy >::Lookup(), NULL, v8::internal::PrintF(), v8::internal::TemplateHashMapImpl< AllocationPolicy >::Remove(), and to().
SnapshotObjectId v8::internal::HeapObjectsMap::PushHeapObjectsStats | ( | OutputStream * | stream | ) |
Definition at line 620 of file heap-snapshot-generator.cc.
References v8::internal::List< T, AllocationPolicy >::Add(), v8::internal::HeapObjectsMap::TimeInterval::count, DCHECK, v8::OutputStream::EndOfStream(), entries_, v8::internal::List< T, AllocationPolicy >::first(), v8::OutputStream::GetChunkSize(), v8::internal::HeapObjectsMap::TimeInterval::id, v8::OutputStream::kAbort, last_assigned_id(), next_id_, v8::internal::HeapObjectsMap::EntryInfo::size, v8::internal::HeapObjectsMap::TimeInterval::size, time_intervals_, UpdateHeapObjectsMap(), and v8::OutputStream::WriteHeapStatsChunk().
void v8::internal::HeapObjectsMap::RemoveDeadEntries | ( | ) |
Definition at line 666 of file heap-snapshot-generator.cc.
References v8::internal::HeapObjectsMap::EntryInfo::accessed, v8::internal::HeapObjectsMap::EntryInfo::addr, v8::internal::ComputePointerHash(), DCHECK, entries_, entries_map_, v8::internal::TemplateHashMapImpl< AllocationPolicy >::Lookup(), NULL, v8::internal::TemplateHashMapImpl< AllocationPolicy >::occupancy(), and v8::internal::TemplateHashMapImpl< AllocationPolicy >::Remove().
Referenced by UpdateHeapObjectsMap().
void v8::internal::HeapObjectsMap::StopHeapObjectsTracking | ( | ) |
Definition at line 477 of file heap-snapshot-generator.cc.
References time_intervals_.
void v8::internal::HeapObjectsMap::UpdateHeapObjectsMap | ( | ) |
Definition at line 482 of file heap-snapshot-generator.cc.
References v8::internal::Heap::CollectAllGarbage(), entries_map_, FindOrAddEntry(), heap_, v8::internal::Heap::kMakeHeapIterableMask, NULL, v8::internal::TemplateHashMapImpl< AllocationPolicy >::occupancy(), v8::internal::PrintF(), and RemoveDeadEntries().
Referenced by PushHeapObjectsStats().
Definition at line 432 of file heap-snapshot-generator.cc.
References FindOrAddEntry(), and size.
Definition at line 257 of file heap-snapshot-generator.h.
Referenced by FindEntry(), FindOrAddEntry(), FindUntrackedObjects(), GetUsedMemorySize(), HeapObjectsMap(), MoveObject(), PushHeapObjectsStats(), and RemoveDeadEntries().
|
private |
Definition at line 256 of file heap-snapshot-generator.h.
Referenced by FindEntry(), FindOrAddEntry(), FindUntrackedObjects(), GetUsedMemorySize(), MoveObject(), RemoveDeadEntries(), and UpdateHeapObjectsMap().
|
private |
Definition at line 259 of file heap-snapshot-generator.h.
Referenced by FindUntrackedObjects(), GenerateId(), heap(), and UpdateHeapObjectsMap().
|
static |
Definition at line 230 of file heap-snapshot-generator.h.
Referenced by v8::internal::HeapSnapshot::AddSyntheticRootEntries().
|
static |
Definition at line 229 of file heap-snapshot-generator.h.
Referenced by v8::internal::HeapSnapshot::AddSyntheticRootEntries().
|
static |
Definition at line 228 of file heap-snapshot-generator.h.
Referenced by v8::internal::HeapSnapshot::AddGcRootsEntry().
|
static |
Definition at line 227 of file heap-snapshot-generator.h.
Referenced by v8::internal::HeapSnapshot::AddRootEntry().
|
static |
Definition at line 226 of file heap-snapshot-generator.h.
Referenced by v8::internal::HeapSnapshot::AddSyntheticRootEntries(), FindOrAddEntry(), and last_assigned_id().
|
private |
Definition at line 255 of file heap-snapshot-generator.h.
Referenced by FindOrAddEntry(), last_assigned_id(), and PushHeapObjectsStats().
|
private |
Definition at line 258 of file heap-snapshot-generator.h.
Referenced by GetUsedMemorySize(), PushHeapObjectsStats(), and StopHeapObjectsTracking().