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

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

Issue 903033003: Oilpan: Implement mark/sweep stats collection for free list profiler. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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
Index: Source/platform/heap/ThreadState.h
diff --git a/Source/platform/heap/ThreadState.h b/Source/platform/heap/ThreadState.h
index 85d4acab08d92585f1fb7e9ff936405f63805a1e..9bdb5a769386902407963e368c1702fb8e835b0e 100644
--- a/Source/platform/heap/ThreadState.h
+++ b/Source/platform/heap/ThreadState.h
@@ -42,6 +42,8 @@
#include "wtf/Threading.h"
#include "wtf/ThreadingPrimitives.h"
#include "wtf/Vector.h"
+#include "wtf/text/StringHash.h"
+#include "wtf/text/WTFString.h"
namespace v8 {
class Isolate;
@@ -191,6 +193,12 @@ enum TypedHeaps {
#if ENABLE(GC_PROFILING)
const size_t numberOfGenerationsToTrack = 8;
const size_t maxHeapObjectAge = numberOfGenerationsToTrack - 1;
+
+struct AgeCounts {
+ int ages[numberOfGenerationsToTrack];
+ AgeCounts() { std::fill(ages, ages + numberOfGenerationsToTrack, 0); }
+};
+typedef HashMap<String, AgeCounts> ClassAgeCountsMap;
#endif
class PLATFORM_EXPORT ThreadState {
@@ -533,8 +541,12 @@ public:
};
void snapshot();
+ void incrementMarkedObjectsAge();
void snapshotFreeListIfNecessary();
+
+ void collectAndReportMarkSweepStats() const;
+ void reportMarkSweepStats(const char* statsName, const ClassAgeCountsMap&) const;
#endif
void pushWeakPointerCallback(void*, WeakPointerCallback);

Powered by Google App Engine
This is Rietveld 408576698