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

Unified Diff: Source/platform/heap/ThreadState.h

Issue 383743002: Oilpan: GC profiling. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: TracedValue update Created 6 years, 4 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
« no previous file with comments | « Source/platform/heap/HeapTest.cpp ('k') | Source/platform/heap/ThreadState.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/heap/ThreadState.h
diff --git a/Source/platform/heap/ThreadState.h b/Source/platform/heap/ThreadState.h
index 39df3f485979993816852eca748a5531967f905e..d01986d0178db573d38814e40aedf7e701c7adef 100644
--- a/Source/platform/heap/ThreadState.h
+++ b/Source/platform/heap/ThreadState.h
@@ -41,6 +41,10 @@
#include "wtf/ThreadingPrimitives.h"
#include "wtf/Vector.h"
+#if ENABLE(GC_PROFILE_HEAP)
+#include "wtf/HashMap.h"
+#endif
+
namespace blink {
class BaseHeap;
@@ -499,11 +503,40 @@ public:
// the object to which it points.
bool checkAndMarkPointer(Visitor*, Address);
-#if ENABLE(GC_TRACING)
+#if ENABLE(GC_PROFILE_MARKING)
const GCInfo* findGCInfo(Address);
static const GCInfo* findGCInfoFromAllThreads(Address);
#endif
+#if ENABLE(GC_PROFILE_HEAP)
+ struct SnapshotInfo {
+ ThreadState* state;
+
+ size_t liveSize;
+ size_t deadSize;
+ size_t freeSize;
+ size_t pageCount;
+
+ // Map from base-classes to a snapshot class-ids (used as index below).
+ HashMap<const GCInfo*, size_t> classTags;
+
+ // Map from class-id (index) to count.
+ Vector<int> liveCount;
+ Vector<int> deadCount;
+
+ // Map from class-id (index) to a vector of generation counts.
+ // For i < 7, the count is the number of objects that died after surviving |i| GCs.
+ // For i == 7, the count is the number of objects that survived at least 7 GCs.
+ Vector<Vector<int, 8> > generations;
+
+ explicit SnapshotInfo(ThreadState* state) : state(state), liveSize(0), deadSize(0), freeSize(0), pageCount(0) { }
+
+ size_t getClassTag(const GCInfo*);
+ };
+
+ void snapshot();
+#endif
+
void pushWeakObjectPointerCallback(void*, WeakPointerCallback);
bool popAndInvokeWeakPointerCallback(Visitor*);
« no previous file with comments | « Source/platform/heap/HeapTest.cpp ('k') | Source/platform/heap/ThreadState.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698