Index: src/heap.h |
diff --git a/src/heap.h b/src/heap.h |
index 8d9adb02dbe9b3d8cbcc106d2bfdb9a1e59bae40..08c91a41d2a755e41f4ad33c8025ec34c0235380 100644 |
--- a/src/heap.h |
+++ b/src/heap.h |
@@ -1600,6 +1600,14 @@ class Heap { |
global_ic_age_ = (global_ic_age_ + 1) & SharedFunctionInfo::ICAgeBits::kMax; |
} |
+ void RecordObjectStats(InstanceType type, size_t size) { |
+ ASSERT(type <= LAST_TYPE); |
+ object_counts_[type]++; |
+ object_sizes_[type] += size; |
+ } |
+ |
+ void CheckpointObjectStats(); |
+ |
private: |
Heap(); |
@@ -1993,11 +2001,18 @@ class Heap { |
void AdvanceIdleIncrementalMarking(intptr_t step_size); |
+ void ClearObjectStats(bool clear_last_time_stats = false); |
static const int kInitialSymbolTableSize = 2048; |
static const int kInitialEvalCacheSize = 64; |
static const int kInitialNumberStringCacheSize = 256; |
+ // Object counts and used memory by InstanceType |
+ size_t object_counts_[LAST_TYPE + 1]; |
+ size_t object_counts_last_time_[LAST_TYPE + 1]; |
+ size_t object_sizes_[LAST_TYPE + 1]; |
+ size_t object_sizes_last_time_[LAST_TYPE + 1]; |
+ |
// Maximum GC pause. |
int max_gc_pause_; |