Chromium Code Reviews| Index: Source/platform/heap/Heap.h |
| diff --git a/Source/platform/heap/Heap.h b/Source/platform/heap/Heap.h |
| index ca2f6c48674398d5efb4b2ac8ddead590f5b7be1..3dabedc2d637f3f84c0f18d431ac9fd492388071 100644 |
| --- a/Source/platform/heap/Heap.h |
| +++ b/Source/platform/heap/Heap.h |
| @@ -705,6 +705,15 @@ public: |
| // All FreeListEntries in the given bucket, n, have size >= 2^n. |
| static int bucketIndexForSize(size_t); |
| +#if ENABLE(GC_PROFILING) |
| + struct PerBucketFreeListStats { |
| + size_t entryCount; |
| + size_t freeSize; |
| + }; |
| + |
| + void getFreeSizeStats(PerBucketFreeListStats bucketStats[], size_t& totalSize) const; |
| +#endif |
| + |
| private: |
| int m_biggestFreeListIndex; |
| @@ -772,6 +781,10 @@ public: |
| void shrinkObject(HeapObjectHeader*, size_t); |
| void decreasePromptlyFreedSize(size_t size) { m_promptlyFreedSize -= size; } |
| +#if ENABLE(GC_PROFILING) |
| + void snapshotFreeList(TracedValue&); |
| +#endif |
| + |
| private: |
| Address outOfLineAllocate(size_t allocationSize, size_t gcInfoIndex); |
| Address currentAllocationPoint() const { return m_currentAllocationPoint; } |
| @@ -814,6 +827,12 @@ private: |
| // The size of promptly freed objects in the heap. |
| size_t m_promptlyFreedSize; |
| + |
| +#if ENABLE(GC_PROFILING) |
| + double m_cumulativeAllocationSize; |
|
haraken
2015/02/04 14:14:57
double => size_t ?
Yuta Kitamura
2015/02/05 04:13:40
Done.
|
| + size_t m_allocationCount; |
| + size_t m_inlineAllocationCount; |
| +#endif |
| }; |
| // Mask an address down to the enclosing oilpan heap base page. All oilpan heap |
| @@ -1332,7 +1351,15 @@ size_t ThreadHeap::allocationSizeFromSize(size_t size) |
| Address ThreadHeap::allocateObject(size_t allocationSize, size_t gcInfoIndex) |
| { |
| +#if ENABLE(GC_PROFILING) |
| + m_cumulativeAllocationSize += allocationSize; |
| + ++m_allocationCount; |
| +#endif |
| + |
| if (LIKELY(allocationSize <= m_remainingAllocationSize)) { |
| +#if ENABLE(GC_PROFILING) |
| + ++m_inlineAllocationCount; |
| +#endif |
| Address headerAddress = m_currentAllocationPoint; |
| m_currentAllocationPoint += allocationSize; |
| m_remainingAllocationSize -= allocationSize; |