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

Unified Diff: src/heap.h

Issue 10792014: Track counts/sizes of CODE sub types with --track-gc-object-stats (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Review feedback Created 8 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 | « no previous file | src/heap.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap.h
diff --git a/src/heap.h b/src/heap.h
index bae01d6e3267017e90da14dfaf0a222d881567d6..64fd17d61bf81332ee41a6e47dadbf3cb47db1f4 100644
--- a/src/heap.h
+++ b/src/heap.h
@@ -1596,10 +1596,26 @@ class Heap {
global_ic_age_ = (global_ic_age_ + 1) & SharedFunctionInfo::ICAgeBits::kMax;
}
- void RecordObjectStats(InstanceType type, size_t size) {
+ // ObjectStats are kept in two arrays, counts and sizes. Related stats are
+ // stored in a contiguous linear buffer. Stats groups are stored one after
+ // another.
+ enum {
+ FIRST_CODE_KIND_SUB_TYPE = LAST_TYPE + 1,
+ OBJECT_STATS_COUNT = FIRST_CODE_KIND_SUB_TYPE + Code::LAST_CODE_KIND + 1
+ };
+
+ void RecordObjectStats(InstanceType type, int sub_type, size_t size) {
ASSERT(type <= LAST_TYPE);
- object_counts_[type]++;
- object_sizes_[type] += size;
+ if (sub_type < 0) {
+ object_counts_[type]++;
+ object_sizes_[type] += size;
+ } else {
+ if (type == CODE_TYPE) {
+ ASSERT(sub_type <= Code::LAST_CODE_KIND);
+ object_counts_[FIRST_CODE_KIND_SUB_TYPE + sub_type]++;
+ object_sizes_[FIRST_CODE_KIND_SUB_TYPE + sub_type] += size;
+ }
+ }
}
void CheckpointObjectStats();
@@ -2004,10 +2020,10 @@ class Heap {
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];
+ size_t object_counts_[OBJECT_STATS_COUNT];
+ size_t object_counts_last_time_[OBJECT_STATS_COUNT];
+ size_t object_sizes_[OBJECT_STATS_COUNT];
+ size_t object_sizes_last_time_[OBJECT_STATS_COUNT];
// Maximum GC pause.
int max_gc_pause_;
« no previous file with comments | « no previous file | src/heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698