OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_HEAP_OBJECT_STATS_H_ | 5 #ifndef V8_HEAP_OBJECT_STATS_H_ |
6 #define V8_HEAP_OBJECT_STATS_H_ | 6 #define V8_HEAP_OBJECT_STATS_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "src/base/ieee754.h" | 10 #include "src/base/ieee754.h" |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 | 120 |
121 class ObjectStatsCollector { | 121 class ObjectStatsCollector { |
122 public: | 122 public: |
123 ObjectStatsCollector(Heap* heap, ObjectStats* stats) | 123 ObjectStatsCollector(Heap* heap, ObjectStats* stats) |
124 : heap_(heap), stats_(stats) {} | 124 : heap_(heap), stats_(stats) {} |
125 | 125 |
126 void CollectGlobalStatistics(); | 126 void CollectGlobalStatistics(); |
127 void CollectStatistics(HeapObject* obj); | 127 void CollectStatistics(HeapObject* obj); |
128 | 128 |
129 private: | 129 private: |
| 130 class CompilationCacheTableVisitor; |
| 131 |
130 void RecordBytecodeArrayDetails(BytecodeArray* obj); | 132 void RecordBytecodeArrayDetails(BytecodeArray* obj); |
131 void RecordCodeDetails(Code* code); | 133 void RecordCodeDetails(Code* code); |
132 void RecordFixedArrayDetails(FixedArray* array); | 134 void RecordFixedArrayDetails(FixedArray* array); |
133 void RecordJSCollectionDetails(JSObject* obj); | 135 void RecordJSCollectionDetails(JSObject* obj); |
134 void RecordJSFunctionDetails(JSFunction* function); | 136 void RecordJSFunctionDetails(JSFunction* function); |
135 void RecordJSObjectDetails(JSObject* object); | 137 void RecordJSObjectDetails(JSObject* object); |
136 void RecordJSWeakCollectionDetails(JSWeakCollection* obj); | 138 void RecordJSWeakCollectionDetails(JSWeakCollection* obj); |
137 void RecordMapDetails(Map* map); | 139 void RecordMapDetails(Map* map); |
138 void RecordScriptDetails(Script* obj); | 140 void RecordScriptDetails(Script* obj); |
| 141 void RecordTemplateInfoDetails(TemplateInfo* obj); |
139 void RecordSharedFunctionInfoDetails(SharedFunctionInfo* sfi); | 142 void RecordSharedFunctionInfoDetails(SharedFunctionInfo* sfi); |
140 | 143 |
141 bool RecordFixedArrayHelper(HeapObject* parent, FixedArray* array, | 144 bool RecordFixedArrayHelper(HeapObject* parent, FixedArray* array, |
142 int subtype, size_t overhead); | 145 int subtype, size_t overhead); |
143 void RecursivelyRecordFixedArrayHelper(HeapObject* parent, FixedArray* array, | 146 void RecursivelyRecordFixedArrayHelper(HeapObject* parent, FixedArray* array, |
144 int subtype); | 147 int subtype); |
145 template <class HashTable> | 148 template <class HashTable> |
146 void RecordHashTableHelper(HeapObject* parent, HashTable* array, int subtype); | 149 void RecordHashTableHelper(HeapObject* parent, HashTable* array, int subtype); |
147 Heap* heap_; | 150 Heap* heap_; |
148 ObjectStats* stats_; | 151 ObjectStats* stats_; |
| 152 |
| 153 friend class ObjectStatsCollector::CompilationCacheTableVisitor; |
149 }; | 154 }; |
150 | 155 |
151 } // namespace internal | 156 } // namespace internal |
152 } // namespace v8 | 157 } // namespace v8 |
153 | 158 |
154 #endif // V8_HEAP_OBJECT_STATS_H_ | 159 #endif // V8_HEAP_OBJECT_STATS_H_ |
OLD | NEW |