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

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: Turn flag off by default 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') | src/mark-compact.cc » ('J')
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 08c91a41d2a755e41f4ad33c8025ec34c0235380..f12610f0eb4cf4a5474724783d04556ab4261554 100644
--- a/src/heap.h
+++ b/src/heap.h
@@ -1600,10 +1600,23 @@ class Heap {
global_ic_age_ = (global_ic_age_ + 1) & SharedFunctionInfo::ICAgeBits::kMax;
}
- void RecordObjectStats(InstanceType type, size_t size) {
+ enum {
Michael Starzinger 2012/07/17 10:48:16 Can we have a short comment above this enum descri
danno 2012/07/17 11:57:10 Done.
+ 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();
@@ -2008,10 +2021,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') | src/mark-compact.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698