Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(301)

Unified Diff: src/profile-generator.h

Issue 10049002: Introduce a way to grab heap stats. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: cosmetic changes Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/profile-generator.h
diff --git a/src/profile-generator.h b/src/profile-generator.h
index ffa3eb59ec2fa104f8771183b73c63e73b53c5cb..46436eae9d8db8d0ee9add2e05cf0478d024fcdb 100644
--- a/src/profile-generator.h
+++ b/src/profile-generator.h
@@ -710,6 +710,10 @@ class HeapObjectsMap {
return next_id_ - kObjectIdStep;
}
+ void StartHeapObjectsTracking();
+ void StopHeapObjectsTracking();
+ void PushHeapObjectsStats(OutputStream* stream);
+
static SnapshotObjectId GenerateId(v8::RetainedObjectInfo* info);
static inline SnapshotObjectId GetNthGcSubrootId(int delta);
@@ -733,6 +737,8 @@ class HeapObjectsMap {
void AddEntry(Address addr, SnapshotObjectId id);
SnapshotObjectId FindEntry(Address addr);
+ SnapshotObjectId FindOrAddEntry(Address addr);
+ void UpdateHeapObjectsMap();
void RemoveDeadEntries();
static bool AddressesMatch(void* key1, void* key2) {
@@ -749,6 +755,12 @@ class HeapObjectsMap {
SnapshotObjectId next_id_;
HashMap entries_map_;
List<EntryInfo>* entries_;
+ struct FragmentInfo {
+ explicit FragmentInfo(SnapshotObjectId id) : id(id), count(0) { }
+ SnapshotObjectId id;
+ uint32_t count;
+ };
+ List<FragmentInfo> fragment_infos_;
DISALLOW_COPY_AND_ASSIGN(HeapObjectsMap);
};
@@ -760,6 +772,14 @@ class HeapSnapshotsCollection {
~HeapSnapshotsCollection();
bool is_tracking_objects() { return is_tracking_objects_; }
+ void PushHeapObjectsStats(OutputStream* stream) {
+ return ids_.PushHeapObjectsStats(stream);
+ }
+ void StartHeapObjectsTracking() {
+ is_tracking_objects_ = true;
+ ids_.StartHeapObjectsTracking();
+ }
+ void StopHeapObjectsTracking() { ids_.StopHeapObjectsTracking(); }
HeapSnapshot* NewSnapshot(
HeapSnapshot::Type type, const char* name, unsigned uid);
« no previous file with comments | « src/heap-profiler.cc ('k') | src/profile-generator.cc » ('j') | src/profile-generator.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698