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

Side by Side Diff: src/heap.h

Issue 26179004: Add code age subtype tracking to --track-gc-object-stats (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebased Created 7 years, 2 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/builtins.h ('k') | src/heap.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 1792 matching lines...) Expand 10 before | Expand all | Expand 10 after
1803 return amount_of_external_allocated_memory_; 1803 return amount_of_external_allocated_memory_;
1804 } 1804 }
1805 1805
1806 // ObjectStats are kept in two arrays, counts and sizes. Related stats are 1806 // ObjectStats are kept in two arrays, counts and sizes. Related stats are
1807 // stored in a contiguous linear buffer. Stats groups are stored one after 1807 // stored in a contiguous linear buffer. Stats groups are stored one after
1808 // another. 1808 // another.
1809 enum { 1809 enum {
1810 FIRST_CODE_KIND_SUB_TYPE = LAST_TYPE + 1, 1810 FIRST_CODE_KIND_SUB_TYPE = LAST_TYPE + 1,
1811 FIRST_FIXED_ARRAY_SUB_TYPE = 1811 FIRST_FIXED_ARRAY_SUB_TYPE =
1812 FIRST_CODE_KIND_SUB_TYPE + Code::NUMBER_OF_KINDS, 1812 FIRST_CODE_KIND_SUB_TYPE + Code::NUMBER_OF_KINDS,
1813 OBJECT_STATS_COUNT = 1813 FIRST_CODE_AGE_SUB_TYPE =
1814 FIRST_FIXED_ARRAY_SUB_TYPE + LAST_FIXED_ARRAY_SUB_TYPE + 1 1814 FIRST_FIXED_ARRAY_SUB_TYPE + LAST_FIXED_ARRAY_SUB_TYPE + 1,
1815 OBJECT_STATS_COUNT = FIRST_CODE_AGE_SUB_TYPE + Code::kLastCodeAge + 1
1815 }; 1816 };
1816 1817
1817 void RecordObjectStats(InstanceType type, int sub_type, size_t size) { 1818 void RecordObjectStats(InstanceType type, size_t size) {
1818 ASSERT(type <= LAST_TYPE); 1819 ASSERT(type <= LAST_TYPE);
1819 if (sub_type < 0) { 1820 object_counts_[type]++;
1820 object_counts_[type]++; 1821 object_sizes_[type] += size;
1821 object_sizes_[type] += size; 1822 }
1822 } else { 1823
1823 if (type == CODE_TYPE) { 1824 void RecordCodeSubTypeStats(int code_sub_type, int code_age, size_t size) {
1824 ASSERT(sub_type < Code::NUMBER_OF_KINDS); 1825 ASSERT(code_sub_type < Code::NUMBER_OF_KINDS);
1825 object_counts_[FIRST_CODE_KIND_SUB_TYPE + sub_type]++; 1826 ASSERT(code_age < Code::kLastCodeAge);
1826 object_sizes_[FIRST_CODE_KIND_SUB_TYPE + sub_type] += size; 1827 object_counts_[FIRST_CODE_KIND_SUB_TYPE + code_sub_type]++;
1827 } else if (type == FIXED_ARRAY_TYPE) { 1828 object_sizes_[FIRST_CODE_KIND_SUB_TYPE + code_sub_type] += size;
1828 ASSERT(sub_type <= LAST_FIXED_ARRAY_SUB_TYPE); 1829 object_counts_[FIRST_CODE_AGE_SUB_TYPE + code_age]++;
1829 object_counts_[FIRST_FIXED_ARRAY_SUB_TYPE + sub_type]++; 1830 object_sizes_[FIRST_CODE_AGE_SUB_TYPE + code_age] += size;
1830 object_sizes_[FIRST_FIXED_ARRAY_SUB_TYPE + sub_type] += size; 1831 }
1831 } 1832
1832 } 1833 void RecordFixedArraySubTypeStats(int array_sub_type, size_t size) {
1834 ASSERT(array_sub_type <= LAST_FIXED_ARRAY_SUB_TYPE);
1835 object_counts_[FIRST_FIXED_ARRAY_SUB_TYPE + array_sub_type]++;
1836 object_sizes_[FIRST_FIXED_ARRAY_SUB_TYPE + array_sub_type] += size;
1833 } 1837 }
1834 1838
1835 void CheckpointObjectStats(); 1839 void CheckpointObjectStats();
1836 1840
1837 // We don't use a LockGuard here since we want to lock the heap 1841 // We don't use a LockGuard here since we want to lock the heap
1838 // only when FLAG_concurrent_recompilation is true. 1842 // only when FLAG_concurrent_recompilation is true.
1839 class RelocationLock { 1843 class RelocationLock {
1840 public: 1844 public:
1841 explicit RelocationLock(Heap* heap); 1845 explicit RelocationLock(Heap* heap);
1842 1846
(...skipping 1235 matching lines...) Expand 10 before | Expand all | Expand 10 after
3078 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. 3082 DisallowHeapAllocation no_allocation; // i.e. no gc allowed.
3079 3083
3080 private: 3084 private:
3081 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); 3085 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer);
3082 }; 3086 };
3083 #endif // DEBUG 3087 #endif // DEBUG
3084 3088
3085 } } // namespace v8::internal 3089 } } // namespace v8::internal
3086 3090
3087 #endif // V8_HEAP_H_ 3091 #endif // V8_HEAP_H_
OLDNEW
« 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