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

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

Issue 1211573006: Oilpan: Count # of collected Persistent handles and use it to estimate the live object size (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 5 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/Heap.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 a5e834dd14f3c3e4c3282eae56cfdac53eefac0f..57cd0461b91eb51deaf415cfe897993089c77560 100644
--- a/Source/platform/heap/ThreadState.h
+++ b/Source/platform/heap/ThreadState.h
@@ -479,10 +479,22 @@ public:
// A region of PersistentNodes allocated on the given thread.
PersistentRegion* persistentRegion() const { return m_persistentRegion.get(); }
-
// A region of PersistentNodes not owned by any particular thread.
static CrossThreadPersistentRegion& crossThreadPersistentRegion();
+ // TODO(haraken): Currently CrossThreadPersistent handles are not counted.
+ // This wouldn't be a big deal because # of CrossThreadPersistents is small,
+ // but should be fixed.
+ void persistentAllocated()
+ {
+ ++m_persistentAllocated;
+ }
+ void persistentFreed()
+ {
+ ++m_persistentFreed;
+ }
+ void updatePersistentCounters();
+
// Visit local thread stack and trace all pointers conservatively.
void visitStack(Visitor*);
@@ -679,6 +691,8 @@ private:
// Internal helper for GC policy handling code. Returns true if
// an urgent conservative GC is now needed due to memory pressure.
bool shouldForceMemoryPressureGC();
+ size_t estimatedLiveObjectSize();
+ size_t currentObjectSize();
void runScheduledGC(StackState);
@@ -738,6 +752,8 @@ private:
bool m_sweepForbidden;
size_t m_noAllocationCount;
size_t m_gcForbiddenCount;
+ int m_persistentAllocated;
+ int m_persistentFreed;
BaseHeap* m_heaps[NumberOfHeaps];
int m_vectorBackingHeapIndex;
« no previous file with comments | « Source/platform/heap/Heap.cpp ('k') | Source/platform/heap/ThreadState.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698