V8 Project
|
#include <heap-snapshot-generator.h>
Public Member Functions | |
HeapSnapshotJSONSerializer (HeapSnapshot *snapshot) | |
void | Serialize (v8::OutputStream *stream) |
Private Member Functions | |
INLINE (static bool StringsMatch(void *key1, void *key2)) | |
INLINE (static uint32_t StringHash(const void *string)) | |
int | GetStringId (const char *s) |
int | entry_index (HeapEntry *e) |
void | SerializeEdge (HeapGraphEdge *edge, bool first_edge) |
void | SerializeEdges () |
void | SerializeImpl () |
void | SerializeNode (HeapEntry *entry) |
void | SerializeNodes () |
void | SerializeSnapshot () |
void | SerializeTraceTree () |
void | SerializeTraceNode (AllocationTraceNode *node) |
void | SerializeTraceNodeInfos () |
void | SerializeString (const unsigned char *s) |
void | SerializeStrings () |
DISALLOW_COPY_AND_ASSIGN (HeapSnapshotJSONSerializer) | |
Private Attributes | |
HeapSnapshot * | snapshot_ |
HashMap | strings_ |
int | next_node_id_ |
int | next_string_id_ |
OutputStreamWriter * | writer_ |
Static Private Attributes | |
static const int | kEdgeFieldsCount = 3 |
static const int | kNodeFieldsCount = 6 |
Friends | |
class | HeapSnapshotJSONSerializerEnumerator |
class | HeapSnapshotJSONSerializerIterator |
Definition at line 558 of file heap-snapshot-generator.h.
|
inlineexplicit |
Definition at line 560 of file heap-snapshot-generator.h.
|
private |
|
inlineprivate |
Definition at line 583 of file heap-snapshot-generator.h.
References kNodeFieldsCount.
Referenced by SerializeEdge(), and SerializeNode().
|
private |
Definition at line 2768 of file heap-snapshot-generator.cc.
References v8::internal::TemplateHashMapImpl< AllocationPolicy >::Lookup(), next_string_id_, NULL, and strings_.
Referenced by SerializeEdge(), SerializeNode(), and SerializeTraceNodeInfos().
|
inlineprivate |
Definition at line 570 of file heap-snapshot-generator.h.
|
inlineprivate |
Definition at line 575 of file heap-snapshot-generator.h.
References v8::internal::StringHasher::HashSequentialString(), and v8::internal::kZeroHashSeed.
void v8::internal::HeapSnapshotJSONSerializer::Serialize | ( | v8::OutputStream * | stream | ) |
Definition at line 2721 of file heap-snapshot-generator.cc.
References v8::internal::HeapProfiler::allocation_tracker(), DCHECK, NULL, v8::internal::HeapSnapshot::profiler(), SerializeImpl(), snapshot_, and writer_.
Referenced by v8::HeapSnapshot::Serialize().
|
private |
Definition at line 2821 of file heap-snapshot-generator.cc.
References v8::internal::OutputStreamWriter::AddString(), entry_index(), GetStringId(), v8::base::anonymous_namespace{semaphore-unittest.cc}::kBufferSize, v8::HeapGraphEdge::kElement, v8::HeapGraphEdge::kHidden, v8::internal::kUnsigned, v8::internal::utoa(), and writer_.
Referenced by SerializeEdges().
|
private |
Definition at line 2845 of file heap-snapshot-generator.cc.
References v8::internal::OutputStreamWriter::aborted(), v8::internal::HeapSnapshot::children(), DCHECK, SerializeEdge(), snapshot_, and writer_.
Referenced by SerializeImpl().
|
private |
Definition at line 2734 of file heap-snapshot-generator.cc.
References v8::internal::OutputStreamWriter::aborted(), v8::internal::OutputStreamWriter::AddCharacter(), v8::internal::OutputStreamWriter::AddString(), DCHECK, v8::internal::OutputStreamWriter::Finalize(), v8::internal::HeapSnapshot::root(), SerializeEdges(), SerializeNodes(), SerializeSnapshot(), SerializeStrings(), SerializeTraceNodeInfos(), SerializeTraceTree(), snapshot_, and writer_.
Referenced by Serialize().
|
private |
Definition at line 2856 of file heap-snapshot-generator.cc.
References v8::internal::OutputStreamWriter::AddString(), entry_index(), GetStringId(), v8::base::anonymous_namespace{semaphore-unittest.cc}::kBufferSize, v8::internal::kUnsigned, v8::internal::Vector< T >::start(), v8::internal::utoa(), and writer_.
Referenced by SerializeNodes().
|
private |
Definition at line 2884 of file heap-snapshot-generator.cc.
References v8::internal::OutputStreamWriter::aborted(), v8::internal::HeapSnapshot::entries(), SerializeNode(), snapshot_, and writer_.
Referenced by SerializeImpl().
|
private |
Definition at line 2893 of file heap-snapshot-generator.cc.
References v8::internal::OutputStreamWriter::AddNumber(), v8::internal::OutputStreamWriter::AddString(), v8::internal::HeapProfiler::allocation_tracker(), v8::internal::HeapSnapshot::edges(), v8::internal::HeapSnapshot::entries(), v8::internal::AllocationTracker::function_info_list(), JSON_A, JSON_O, JSON_S, v8::internal::HeapSnapshot::profiler(), snapshot_, v8::internal::HeapSnapshot::title(), v8::internal::HeapSnapshot::uid(), and writer_.
Referenced by SerializeImpl().
|
private |
Definition at line 3078 of file heap-snapshot-generator.cc.
References v8::internal::OutputStreamWriter::AddCharacter(), v8::internal::OutputStreamWriter::AddString(), unibrow::Utf8::CalculateValue(), DCHECK, unibrow::Utf8::kBadChar, writer_, and v8::internal::WriteUChar().
Referenced by SerializeStrings().
|
private |
Definition at line 3128 of file heap-snapshot-generator.cc.
References v8::internal::OutputStreamWriter::aborted(), v8::internal::OutputStreamWriter::AddCharacter(), v8::internal::OutputStreamWriter::AddString(), v8::internal::Vector< T >::length(), v8::internal::TemplateHashMapImpl< AllocationPolicy >::Next(), NULL, v8::internal::TemplateHashMapImpl< AllocationPolicy >::occupancy(), SerializeString(), v8::internal::TemplateHashMapImpl< AllocationPolicy >::Start(), strings_, and writer_.
Referenced by SerializeImpl().
|
private |
Definition at line 2996 of file heap-snapshot-generator.cc.
References v8::internal::OutputStreamWriter::AddCharacter(), v8::internal::OutputStreamWriter::AddString(), v8::internal::AllocationTraceNode::allocation_count(), v8::internal::AllocationTraceNode::allocation_size(), v8::internal::AllocationTraceNode::children(), v8::internal::AllocationTraceNode::function_info_index(), v8::internal::AllocationTraceNode::id(), v8::base::anonymous_namespace{semaphore-unittest.cc}::kBufferSize, v8::internal::kUnsigned, v8::internal::Vector< T >::length(), v8::internal::utoa(), and writer_.
Referenced by SerializeTraceTree().
|
private |
Definition at line 3039 of file heap-snapshot-generator.cc.
References v8::internal::OutputStreamWriter::AddString(), v8::internal::HeapProfiler::allocation_tracker(), v8::internal::AllocationTracker::FunctionInfo::column, v8::internal::AllocationTracker::FunctionInfo::function_id, v8::internal::AllocationTracker::function_info_list(), GetStringId(), v8::base::anonymous_namespace{semaphore-unittest.cc}::kBufferSize, v8::internal::kUnsigned, v8::internal::AllocationTracker::FunctionInfo::line, v8::internal::AllocationTracker::FunctionInfo::name, v8::internal::HeapSnapshot::profiler(), v8::internal::AllocationTracker::FunctionInfo::script_id, v8::internal::AllocationTracker::FunctionInfo::script_name, v8::internal::SerializePosition(), snapshot_, v8::internal::utoa(), and writer_.
Referenced by SerializeImpl().
|
private |
Definition at line 2988 of file heap-snapshot-generator.cc.
References v8::internal::HeapProfiler::allocation_tracker(), v8::internal::HeapSnapshot::profiler(), v8::internal::AllocationTraceTree::root(), SerializeTraceNode(), snapshot_, and v8::internal::AllocationTracker::trace_tree().
Referenced by SerializeImpl().
|
friend |
Definition at line 605 of file heap-snapshot-generator.h.
|
friend |
Definition at line 606 of file heap-snapshot-generator.h.
|
staticprivate |
Definition at line 596 of file heap-snapshot-generator.h.
|
staticprivate |
Definition at line 597 of file heap-snapshot-generator.h.
Referenced by entry_index().
|
private |
Definition at line 601 of file heap-snapshot-generator.h.
|
private |
Definition at line 602 of file heap-snapshot-generator.h.
Referenced by GetStringId().
|
private |
Definition at line 599 of file heap-snapshot-generator.h.
Referenced by Serialize(), SerializeEdges(), SerializeImpl(), SerializeNodes(), SerializeSnapshot(), SerializeTraceNodeInfos(), and SerializeTraceTree().
|
private |
Definition at line 600 of file heap-snapshot-generator.h.
Referenced by GetStringId(), and SerializeStrings().
|
private |
Definition at line 603 of file heap-snapshot-generator.h.
Referenced by Serialize(), SerializeEdge(), SerializeEdges(), SerializeImpl(), SerializeNode(), SerializeNodes(), SerializeSnapshot(), SerializeString(), SerializeStrings(), SerializeTraceNode(), and SerializeTraceNodeInfos().