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

Unified Diff: src/heap.h

Issue 40003002: Add support for tracking NotExectuted/ExecutedOnceCodeAge's when --track_gc_object_stats flag is se… (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix nit Created 7 years, 1 month 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 | « src/builtins.h ('k') | 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 96cda586b7c9ea464bc7b1fd39d38c160b34e207..643ea42772838d61b64dd0120340429a8ae5fc98 100644
--- a/src/heap.h
+++ b/src/heap.h
@@ -1812,7 +1812,7 @@ class Heap {
FIRST_CODE_KIND_SUB_TYPE + Code::NUMBER_OF_KINDS,
FIRST_CODE_AGE_SUB_TYPE =
FIRST_FIXED_ARRAY_SUB_TYPE + LAST_FIXED_ARRAY_SUB_TYPE + 1,
- OBJECT_STATS_COUNT = FIRST_CODE_AGE_SUB_TYPE + Code::kLastCodeAge + 1
+ OBJECT_STATS_COUNT = FIRST_CODE_AGE_SUB_TYPE + Code::kCodeAgeCount + 1
};
void RecordObjectStats(InstanceType type, size_t size) {
@@ -1822,12 +1822,17 @@ class Heap {
}
void RecordCodeSubTypeStats(int code_sub_type, int code_age, size_t size) {
- ASSERT(code_sub_type < Code::NUMBER_OF_KINDS);
- ASSERT(code_age < Code::kLastCodeAge);
- object_counts_[FIRST_CODE_KIND_SUB_TYPE + code_sub_type]++;
- object_sizes_[FIRST_CODE_KIND_SUB_TYPE + code_sub_type] += size;
- object_counts_[FIRST_CODE_AGE_SUB_TYPE + code_age]++;
- object_sizes_[FIRST_CODE_AGE_SUB_TYPE + code_age] += size;
+ int code_sub_type_index = FIRST_CODE_KIND_SUB_TYPE + code_sub_type;
+ int code_age_index =
+ FIRST_CODE_AGE_SUB_TYPE + code_age - Code::kFirstCodeAge;
+ ASSERT(code_sub_type_index >= FIRST_CODE_KIND_SUB_TYPE &&
+ code_sub_type_index < FIRST_CODE_AGE_SUB_TYPE);
+ ASSERT(code_age_index >= FIRST_CODE_AGE_SUB_TYPE &&
+ code_age_index < OBJECT_STATS_COUNT);
+ object_counts_[code_sub_type_index]++;
+ object_sizes_[code_sub_type_index] += size;
+ object_counts_[code_age_index]++;
+ object_sizes_[code_age_index] += size;
}
void RecordFixedArraySubTypeStats(int array_sub_type, size_t size) {
« no previous file with comments | « src/builtins.h ('k') | src/heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698