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

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

Issue 883233003: Oilpan: Add free list profiler. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Change type of m_cumulativeAllocationSize to size_t. Created 5 years, 10 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 | « no previous file | Source/platform/heap/Heap.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/heap/Heap.h
diff --git a/Source/platform/heap/Heap.h b/Source/platform/heap/Heap.h
index ca2f6c48674398d5efb4b2ac8ddead590f5b7be1..d40eb0827e48f881a4ca75b6c871215804b99026 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)
+ size_t m_cumulativeAllocationSize;
+ 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;
« no previous file with comments | « no previous file | Source/platform/heap/Heap.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698