summaryrefslogtreecommitdiff
path: root/deps/v8/src/heap-snapshot-generator.h
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/src/heap-snapshot-generator.h')
-rw-r--r--deps/v8/src/heap-snapshot-generator.h31
1 files changed, 16 insertions, 15 deletions
diff --git a/deps/v8/src/heap-snapshot-generator.h b/deps/v8/src/heap-snapshot-generator.h
index 8aef43739c..5859eb88b5 100644
--- a/deps/v8/src/heap-snapshot-generator.h
+++ b/deps/v8/src/heap-snapshot-generator.h
@@ -5,7 +5,7 @@
#ifndef V8_HEAP_SNAPSHOT_GENERATOR_H_
#define V8_HEAP_SNAPSHOT_GENERATOR_H_
-#include "src/profile-generator-inl.h"
+#include "src/strings-storage.h"
namespace v8 {
namespace internal {
@@ -141,14 +141,10 @@ class HeapEntry BASE_EMBEDDED {
// HeapSnapshotGenerator fills in a HeapSnapshot.
class HeapSnapshot {
public:
- HeapSnapshot(HeapProfiler* profiler,
- const char* title,
- unsigned uid);
+ explicit HeapSnapshot(HeapProfiler* profiler);
void Delete();
HeapProfiler* profiler() { return profiler_; }
- const char* title() { return title_; }
- unsigned uid() { return uid_; }
size_t RawSnapshotSize() const;
HeapEntry* root() { return &entries_[root_index_]; }
HeapEntry* gc_roots() { return &entries_[gc_roots_index_]; }
@@ -181,8 +177,6 @@ class HeapSnapshot {
HeapEntry* AddGcSubrootEntry(int tag, SnapshotObjectId id);
HeapProfiler* profiler_;
- const char* title_;
- unsigned uid_;
int root_index_;
int gc_roots_index_;
int gc_subroot_indexes_[VisitorSynchronization::kNumberOfSyncTags];
@@ -200,6 +194,16 @@ class HeapSnapshot {
class HeapObjectsMap {
public:
+ struct TimeInterval {
+ explicit TimeInterval(SnapshotObjectId id)
+ : id(id), size(0), count(0), timestamp(base::TimeTicks::Now()) {}
+ SnapshotObjectId last_assigned_id() const { return id - kObjectIdStep; }
+ SnapshotObjectId id;
+ uint32_t size;
+ uint32_t count;
+ base::TimeTicks timestamp;
+ };
+
explicit HeapObjectsMap(Heap* heap);
Heap* heap() const { return heap_; }
@@ -215,7 +219,9 @@ class HeapObjectsMap {
}
void StopHeapObjectsTracking();
- SnapshotObjectId PushHeapObjectsStats(OutputStream* stream);
+ SnapshotObjectId PushHeapObjectsStats(OutputStream* stream,
+ int64_t* timestamp_us);
+ const List<TimeInterval>& samples() const { return time_intervals_; }
size_t GetUsedMemorySize() const;
SnapshotObjectId GenerateId(v8::RetainedObjectInfo* info);
@@ -242,12 +248,6 @@ class HeapObjectsMap {
unsigned int size;
bool accessed;
};
- struct TimeInterval {
- explicit TimeInterval(SnapshotObjectId id) : id(id), size(0), count(0) { }
- SnapshotObjectId id;
- uint32_t size;
- uint32_t count;
- };
SnapshotObjectId next_id_;
HashMap entries_map_;
@@ -590,6 +590,7 @@ class HeapSnapshotJSONSerializer {
void SerializeTraceTree();
void SerializeTraceNode(AllocationTraceNode* node);
void SerializeTraceNodeInfos();
+ void SerializeSamples();
void SerializeString(const unsigned char* s);
void SerializeStrings();