Chromium Code Reviews| Index: Source/platform/heap/ThreadState.h |
| diff --git a/Source/platform/heap/ThreadState.h b/Source/platform/heap/ThreadState.h |
| index 5269820c6417a1cff55af4d7d8237da95eed2fb1..df0f32fecff1a6b7b878546f8f8f38bf0bf3410a 100644 |
| --- a/Source/platform/heap/ThreadState.h |
| +++ b/Source/platform/heap/ThreadState.h |
| @@ -33,6 +33,7 @@ |
| #include "platform/PlatformExport.h" |
| #include "platform/heap/AddressSanitizer.h" |
| +#include "platform/heap/Profiling.h" |
| #include "wtf/HashSet.h" |
| #include "wtf/OwnPtr.h" |
| #include "wtf/PassOwnPtr.h" |
| @@ -41,6 +42,10 @@ |
| #include "wtf/ThreadingPrimitives.h" |
| #include "wtf/Vector.h" |
| +#if GC_PROFILE_HEAP |
| +#include "wtf/HashMap.h" |
| +#endif |
| + |
| namespace WebCore { |
| class BaseHeap; |
| @@ -495,11 +500,40 @@ public: |
| // the object to which it points. |
| bool checkAndMarkPointer(Visitor*, Address); |
| -#if ENABLE(GC_TRACING) |
| +#if GC_PROFILE_MARKING |
| const GCInfo* findGCInfo(Address); |
| static const GCInfo* findGCInfoFromAllThreads(Address); |
| #endif |
| +#if 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; |
| + |
| + SnapshotInfo(ThreadState* state) : state(state), liveSize(0), deadSize(0), freeSize(0), pageCount(0) { } |
|
haraken
2014/07/14 02:26:14
Add explicit.
zerny-chromium
2014/07/28 11:54:41
Done.
|
| + |
| + size_t getClassTag(const GCInfo*); |
| + }; |
| + |
| + void snapshot(); |
| +#endif |
| + |
| void pushWeakObjectPointerCallback(void*, WeakPointerCallback); |
| bool popAndInvokeWeakPointerCallback(Visitor*); |