OLD | NEW |
---|---|
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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_COUNTERS_H_ | 5 #ifndef V8_COUNTERS_H_ |
6 #define V8_COUNTERS_H_ | 6 #define V8_COUNTERS_H_ |
7 | 7 |
8 #include "include/v8.h" | 8 #include "include/v8.h" |
9 #include "src/allocation.h" | 9 #include "src/allocation.h" |
10 #include "src/base/atomic-utils.h" | 10 #include "src/base/atomic-utils.h" |
(...skipping 10 matching lines...) Expand all Loading... | |
21 namespace v8 { | 21 namespace v8 { |
22 namespace internal { | 22 namespace internal { |
23 | 23 |
24 // StatsCounters is an interface for plugging into external | 24 // StatsCounters is an interface for plugging into external |
25 // counters for monitoring. Counters can be looked up and | 25 // counters for monitoring. Counters can be looked up and |
26 // manipulated by name. | 26 // manipulated by name. |
27 | 27 |
28 class StatsTable { | 28 class StatsTable { |
29 public: | 29 public: |
30 // Register an application-defined function where | 30 // Register an application-defined function where |
31 // counters can be looked up. | 31 // counters can be looked up. Note: Must be called on main thread, |
32 void SetCounterFunction(CounterLookupCallback f) { | 32 // so that threaded stats counters can be created now. |
33 lookup_function_ = f; | 33 void SetCounterFunction(CounterLookupCallback f, Isolate* isolate); |
34 } | |
35 | 34 |
36 // Register an application-defined function to create | 35 // Register an application-defined function to create |
37 // a histogram for passing to the AddHistogramSample function | 36 // a histogram for passing to the AddHistogramSample function |
38 void SetCreateHistogramFunction(CreateHistogramCallback f) { | 37 void SetCreateHistogramFunction(CreateHistogramCallback f) { |
39 create_histogram_function_ = f; | 38 create_histogram_function_ = f; |
40 } | 39 } |
41 | 40 |
42 // Register an application-defined function to add a sample | 41 // Register an application-defined function to add a sample |
43 // to a histogram created with CreateHistogram function | 42 // to a histogram created with CreateHistogram function |
44 void SetAddHistogramSampleFunction(AddHistogramSampleCallback f) { | 43 void SetAddHistogramSampleFunction(AddHistogramSampleCallback f) { |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
85 | 84 |
86 CounterLookupCallback lookup_function_; | 85 CounterLookupCallback lookup_function_; |
87 CreateHistogramCallback create_histogram_function_; | 86 CreateHistogramCallback create_histogram_function_; |
88 AddHistogramSampleCallback add_histogram_sample_function_; | 87 AddHistogramSampleCallback add_histogram_sample_function_; |
89 | 88 |
90 friend class Isolate; | 89 friend class Isolate; |
91 | 90 |
92 DISALLOW_COPY_AND_ASSIGN(StatsTable); | 91 DISALLOW_COPY_AND_ASSIGN(StatsTable); |
93 }; | 92 }; |
94 | 93 |
94 // Base class for stats counters. | |
95 class StatsCounterBase { | |
96 public: | |
97 StatsCounterBase() {} | |
98 StatsCounterBase(Isolate* isolate, const char* name) | |
99 : isolate_(isolate), name_(name), ptr_(nullptr) {} | |
100 | |
101 protected: | |
102 Isolate* isolate_; | |
103 const char* name_; | |
104 int* ptr_; | |
105 | |
106 void SetLoc(int* loc, int value) { *loc = value; } | |
107 void IncrementLoc(int* loc) { (*loc)++; } | |
Clemens Hammacher
2017/06/02 13:08:49
Is there any implementation where the semantics of
kschimpf
2017/06/02 15:01:02
I did this to follow the same pattern as the code
kschimpf
2017/06/02 17:06:27
There are calls on "size" counters that increment
| |
108 void IncrementLoc(int* loc, int value) { (*loc) += value; } | |
109 void DecrementLoc(int* loc) { (*loc)--; } | |
110 void DecrementLoc(int* loc, int value) { (*loc) -= value; } | |
111 | |
112 int* FindLocationInStatsTable() const; | |
113 }; | |
114 | |
95 // StatsCounters are dynamically created values which can be tracked in | 115 // StatsCounters are dynamically created values which can be tracked in |
96 // the StatsTable. They are designed to be lightweight to create and | 116 // the StatsTable. They are designed to be lightweight to create and |
97 // easy to use. | 117 // easy to use. |
98 // | 118 // |
99 // Internally, a counter represents a value in a row of a StatsTable. | 119 // Internally, a counter represents a value in a row of a StatsTable. |
100 // The row has a 32bit value for each process/thread in the table and also | 120 // The row has a 32bit value for each process/thread in the table and also |
101 // a name (stored in the table metadata). Since the storage location can be | 121 // a name (stored in the table metadata). Since the storage location can be |
102 // thread-specific, this class cannot be shared across threads. | 122 // thread-specific, this class cannot be shared across threads. |
103 class StatsCounter { | 123 class StatsCounter : public StatsCounterBase { |
104 public: | 124 public: |
105 StatsCounter() { } | 125 StatsCounter() { } |
106 explicit StatsCounter(Isolate* isolate, const char* name) | 126 StatsCounter(Isolate* isolate, const char* name) |
107 : isolate_(isolate), name_(name), ptr_(NULL), lookup_done_(false) { } | 127 : StatsCounterBase(isolate, name), lookup_done_(false) {} |
108 | 128 |
109 // Sets the counter to a specific value. | 129 // Sets the counter to a specific value. |
110 void Set(int value) { | 130 void Set(int value) { |
111 int* loc = GetPtr(); | 131 if (int* loc = GetPtr()) SetLoc(loc, value); |
112 if (loc) *loc = value; | |
113 } | 132 } |
114 | 133 |
115 // Increments the counter. | 134 // Increments the counter. |
116 void Increment() { | 135 void Increment() { |
117 int* loc = GetPtr(); | 136 if (int* loc = GetPtr()) IncrementLoc(loc); |
118 if (loc) (*loc)++; | |
119 } | 137 } |
120 | 138 |
121 void Increment(int value) { | 139 void Increment(int value) { |
kschimpf
2017/06/02 15:01:02
Here was the previous definition of increment.
| |
122 int* loc = GetPtr(); | 140 if (int* loc = GetPtr()) IncrementLoc(loc, value); |
123 if (loc) | |
124 (*loc) += value; | |
125 } | 141 } |
126 | 142 |
127 // Decrements the counter. | 143 // Decrements the counter. |
128 void Decrement() { | 144 void Decrement() { |
129 int* loc = GetPtr(); | 145 if (int* loc = GetPtr()) DecrementLoc(loc); |
130 if (loc) (*loc)--; | |
131 } | 146 } |
132 | 147 |
133 void Decrement(int value) { | 148 void Decrement(int value) { |
134 int* loc = GetPtr(); | 149 if (int* loc = GetPtr()) DecrementLoc(loc, value); |
135 if (loc) (*loc) -= value; | |
136 } | 150 } |
137 | 151 |
138 // Is this counter enabled? | 152 // Is this counter enabled? |
139 // Returns false if table is full. | 153 // Returns false if table is full. |
140 bool Enabled() { | 154 bool Enabled() { |
141 return GetPtr() != NULL; | 155 return GetPtr() != NULL; |
142 } | 156 } |
143 | 157 |
144 // Get the internal pointer to the counter. This is used | 158 // Get the internal pointer to the counter. This is used |
145 // by the code generator to emit code that manipulates a | 159 // by the code generator to emit code that manipulates a |
146 // given counter without calling the runtime system. | 160 // given counter without calling the runtime system. |
147 int* GetInternalPointer() { | 161 int* GetInternalPointer() { |
148 int* loc = GetPtr(); | 162 int* loc = GetPtr(); |
149 DCHECK(loc != NULL); | 163 DCHECK(loc != NULL); |
150 return loc; | 164 return loc; |
151 } | 165 } |
152 | 166 |
153 // Reset the cached internal pointer. | 167 // Reset the cached internal pointer. |
154 void Reset() { lookup_done_ = false; } | 168 void Reset() { lookup_done_ = false; } |
155 | 169 |
156 protected: | 170 private: |
157 // Returns the cached address of this counter location. | 171 // Returns the cached address of this counter location. |
158 int* GetPtr() { | 172 int* GetPtr() { |
159 if (lookup_done_) return ptr_; | 173 if (lookup_done_) return ptr_; |
160 lookup_done_ = true; | 174 lookup_done_ = true; |
161 ptr_ = FindLocationInStatsTable(); | 175 ptr_ = FindLocationInStatsTable(); |
162 return ptr_; | 176 return ptr_; |
163 } | 177 } |
164 | 178 |
165 private: | |
166 int* FindLocationInStatsTable() const; | |
167 | |
168 Isolate* isolate_; | |
169 const char* name_; | |
170 int* ptr_; | |
171 bool lookup_done_; | 179 bool lookup_done_; |
172 }; | 180 }; |
173 | 181 |
182 // Thread safe version of StatsCounter. WARNING: Unlike StatsCounter, | |
183 // StatsCounterThreadSafe's constructor and method Reset() actually do | |
184 // the table lookup, and should be called from the main thread | |
185 // (i.e. not workers). | |
186 class StatsCounterThreadSafe : public StatsCounterBase { | |
187 public: | |
188 StatsCounterThreadSafe(Isolate* isolate, const char* name); | |
189 | |
190 void Set(int Value); | |
191 void Increment(); | |
192 void Increment(int value); | |
193 void Decrement(); | |
194 void Decrement(int value); | |
195 bool Enabled() { return ptr_ != NULL; } | |
196 int* GetInternalPointer() { | |
197 DCHECK(ptr_ != NULL); | |
198 return ptr_; | |
199 } | |
200 void Reset() { GetPtr(); } | |
201 | |
202 private: | |
203 int* GetPtr(); | |
204 | |
205 base::Mutex mutex_; | |
206 | |
207 private: | |
208 DISALLOW_IMPLICIT_CONSTRUCTORS(StatsCounterThreadSafe); | |
209 }; | |
210 | |
174 // A Histogram represents a dynamically created histogram in the StatsTable. | 211 // A Histogram represents a dynamically created histogram in the StatsTable. |
175 // It will be registered with the histogram system on first use. | 212 // It will be registered with the histogram system on first use. |
176 class Histogram { | 213 class Histogram { |
177 public: | 214 public: |
178 Histogram() { } | 215 Histogram() { } |
179 Histogram(const char* name, | 216 Histogram(const char* name, |
180 int min, | 217 int min, |
181 int max, | 218 int max, |
182 int num_buckets, | 219 int num_buckets, |
183 Isolate* isolate) | 220 Isolate* isolate) |
(...skipping 976 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1160 SC(code_space_bytes_used, V8.MemoryCodeSpaceBytesUsed) \ | 1197 SC(code_space_bytes_used, V8.MemoryCodeSpaceBytesUsed) \ |
1161 SC(map_space_bytes_available, V8.MemoryMapSpaceBytesAvailable) \ | 1198 SC(map_space_bytes_available, V8.MemoryMapSpaceBytesAvailable) \ |
1162 SC(map_space_bytes_committed, V8.MemoryMapSpaceBytesCommitted) \ | 1199 SC(map_space_bytes_committed, V8.MemoryMapSpaceBytesCommitted) \ |
1163 SC(map_space_bytes_used, V8.MemoryMapSpaceBytesUsed) \ | 1200 SC(map_space_bytes_used, V8.MemoryMapSpaceBytesUsed) \ |
1164 SC(lo_space_bytes_available, V8.MemoryLoSpaceBytesAvailable) \ | 1201 SC(lo_space_bytes_available, V8.MemoryLoSpaceBytesAvailable) \ |
1165 SC(lo_space_bytes_committed, V8.MemoryLoSpaceBytesCommitted) \ | 1202 SC(lo_space_bytes_committed, V8.MemoryLoSpaceBytesCommitted) \ |
1166 SC(lo_space_bytes_used, V8.MemoryLoSpaceBytesUsed) \ | 1203 SC(lo_space_bytes_used, V8.MemoryLoSpaceBytesUsed) \ |
1167 /* Total code size (including metadata) of baseline code or bytecode. */ \ | 1204 /* Total code size (including metadata) of baseline code or bytecode. */ \ |
1168 SC(total_baseline_code_size, V8.TotalBaselineCodeSize) \ | 1205 SC(total_baseline_code_size, V8.TotalBaselineCodeSize) \ |
1169 /* Total count of functions compiled using the baseline compiler. */ \ | 1206 /* Total count of functions compiled using the baseline compiler. */ \ |
1170 SC(total_baseline_compile_count, V8.TotalBaselineCompileCount) \ | 1207 SC(total_baseline_compile_count, V8.TotalBaselineCompileCount) |
1171 SC(wasm_generated_code_size, V8.WasmGeneratedCodeBytes) \ | 1208 |
1172 SC(wasm_reloc_size, V8.WasmRelocBytes) \ | 1209 #define STATS_COUNTER_TS_LIST(SC) \ |
1210 SC(wasm_generated_code_size, V8.WasmGeneratedCodeBytes) \ | |
1211 SC(wasm_reloc_size, V8.WasmRelocBytes) \ | |
1173 SC(wasm_lazily_compiled_functions, V8.WasmLazilyCompiledFunctions) | 1212 SC(wasm_lazily_compiled_functions, V8.WasmLazilyCompiledFunctions) |
1174 | 1213 |
1175 // This file contains all the v8 counters that are in use. | 1214 // This file contains all the v8 counters that are in use. |
1176 class Counters { | 1215 class Counters : public std::enable_shared_from_this<Counters> { |
1177 public: | 1216 public: |
1217 explicit Counters(Isolate* isolate); | |
1218 | |
1178 #define HR(name, caption, min, max, num_buckets) \ | 1219 #define HR(name, caption, min, max, num_buckets) \ |
1179 Histogram* name() { return &name##_; } | 1220 Histogram* name() { return &name##_; } |
1180 HISTOGRAM_RANGE_LIST(HR) | 1221 HISTOGRAM_RANGE_LIST(HR) |
1181 #undef HR | 1222 #undef HR |
1182 | 1223 |
1183 #define HT(name, caption, max, res) \ | 1224 #define HT(name, caption, max, res) \ |
1184 HistogramTimer* name() { return &name##_; } | 1225 HistogramTimer* name() { return &name##_; } |
1185 HISTOGRAM_TIMER_LIST(HT) | 1226 HISTOGRAM_TIMER_LIST(HT) |
1186 #undef HT | 1227 #undef HT |
1187 | 1228 |
(...skipping 19 matching lines...) Expand all Loading... | |
1207 } | 1248 } |
1208 HISTOGRAM_MEMORY_LIST(HM) | 1249 HISTOGRAM_MEMORY_LIST(HM) |
1209 #undef HM | 1250 #undef HM |
1210 | 1251 |
1211 #define SC(name, caption) \ | 1252 #define SC(name, caption) \ |
1212 StatsCounter* name() { return &name##_; } | 1253 StatsCounter* name() { return &name##_; } |
1213 STATS_COUNTER_LIST_1(SC) | 1254 STATS_COUNTER_LIST_1(SC) |
1214 STATS_COUNTER_LIST_2(SC) | 1255 STATS_COUNTER_LIST_2(SC) |
1215 #undef SC | 1256 #undef SC |
1216 | 1257 |
1258 #define SC(name, caption) \ | |
1259 StatsCounterThreadSafe* name() { return &name##_; } | |
1260 STATS_COUNTER_TS_LIST(SC) | |
1261 #undef SC | |
1262 | |
1217 #define SC(name) \ | 1263 #define SC(name) \ |
1218 StatsCounter* count_of_##name() { return &count_of_##name##_; } \ | 1264 StatsCounter* count_of_##name() { return &count_of_##name##_; } \ |
1219 StatsCounter* size_of_##name() { return &size_of_##name##_; } | 1265 StatsCounter* size_of_##name() { return &size_of_##name##_; } |
1220 INSTANCE_TYPE_LIST(SC) | 1266 INSTANCE_TYPE_LIST(SC) |
1221 #undef SC | 1267 #undef SC |
1222 | 1268 |
1223 #define SC(name) \ | 1269 #define SC(name) \ |
1224 StatsCounter* count_of_CODE_TYPE_##name() \ | 1270 StatsCounter* count_of_CODE_TYPE_##name() \ |
1225 { return &count_of_CODE_TYPE_##name##_; } \ | 1271 { return &count_of_CODE_TYPE_##name##_; } \ |
1226 StatsCounter* size_of_CODE_TYPE_##name() \ | 1272 StatsCounter* size_of_CODE_TYPE_##name() \ |
(...skipping 10 matching lines...) Expand all Loading... | |
1237 #undef SC | 1283 #undef SC |
1238 | 1284 |
1239 #define SC(name) \ | 1285 #define SC(name) \ |
1240 StatsCounter* count_of_CODE_AGE_##name() \ | 1286 StatsCounter* count_of_CODE_AGE_##name() \ |
1241 { return &count_of_CODE_AGE_##name##_; } \ | 1287 { return &count_of_CODE_AGE_##name##_; } \ |
1242 StatsCounter* size_of_CODE_AGE_##name() \ | 1288 StatsCounter* size_of_CODE_AGE_##name() \ |
1243 { return &size_of_CODE_AGE_##name##_; } | 1289 { return &size_of_CODE_AGE_##name##_; } |
1244 CODE_AGE_LIST_COMPLETE(SC) | 1290 CODE_AGE_LIST_COMPLETE(SC) |
1245 #undef SC | 1291 #undef SC |
1246 | 1292 |
1293 // clang-format off | |
1247 enum Id { | 1294 enum Id { |
1248 #define RATE_ID(name, caption, max, res) k_##name, | 1295 #define RATE_ID(name, caption, max, res) k_##name, |
1249 HISTOGRAM_TIMER_LIST(RATE_ID) | 1296 HISTOGRAM_TIMER_LIST(RATE_ID) |
1250 #undef RATE_ID | 1297 #undef RATE_ID |
1251 #define AGGREGATABLE_ID(name, caption) k_##name, | 1298 #define AGGREGATABLE_ID(name, caption) k_##name, |
1252 AGGREGATABLE_HISTOGRAM_TIMER_LIST(AGGREGATABLE_ID) | 1299 AGGREGATABLE_HISTOGRAM_TIMER_LIST(AGGREGATABLE_ID) |
1253 #undef AGGREGATABLE_ID | 1300 #undef AGGREGATABLE_ID |
1254 #define PERCENTAGE_ID(name, caption) k_##name, | 1301 #define PERCENTAGE_ID(name, caption) k_##name, |
1255 HISTOGRAM_PERCENTAGE_LIST(PERCENTAGE_ID) | 1302 HISTOGRAM_PERCENTAGE_LIST(PERCENTAGE_ID) |
1256 #undef PERCENTAGE_ID | 1303 #undef PERCENTAGE_ID |
1257 #define MEMORY_ID(name, caption) k_##name, | 1304 #define MEMORY_ID(name, caption) k_##name, |
1258 HISTOGRAM_LEGACY_MEMORY_LIST(MEMORY_ID) | 1305 HISTOGRAM_LEGACY_MEMORY_LIST(MEMORY_ID) |
1259 HISTOGRAM_MEMORY_LIST(MEMORY_ID) | 1306 HISTOGRAM_MEMORY_LIST(MEMORY_ID) |
1260 #undef MEMORY_ID | 1307 #undef MEMORY_ID |
1261 #define COUNTER_ID(name, caption) k_##name, | 1308 #define COUNTER_ID(name, caption) k_##name, |
1262 STATS_COUNTER_LIST_1(COUNTER_ID) | 1309 STATS_COUNTER_LIST_1(COUNTER_ID) |
1263 STATS_COUNTER_LIST_2(COUNTER_ID) | 1310 STATS_COUNTER_LIST_2(COUNTER_ID) |
1311 STATS_COUNTER_TS_LIST(COUNTER_ID) | |
1264 #undef COUNTER_ID | 1312 #undef COUNTER_ID |
1265 #define COUNTER_ID(name) kCountOf##name, kSizeOf##name, | 1313 #define COUNTER_ID(name) kCountOf##name, kSizeOf##name, |
1266 INSTANCE_TYPE_LIST(COUNTER_ID) | 1314 INSTANCE_TYPE_LIST(COUNTER_ID) |
1267 #undef COUNTER_ID | 1315 #undef COUNTER_ID |
1268 #define COUNTER_ID(name) kCountOfCODE_TYPE_##name, \ | 1316 #define COUNTER_ID(name) kCountOfCODE_TYPE_##name, \ |
1269 kSizeOfCODE_TYPE_##name, | 1317 kSizeOfCODE_TYPE_##name, |
1270 CODE_KIND_LIST(COUNTER_ID) | 1318 CODE_KIND_LIST(COUNTER_ID) |
1271 #undef COUNTER_ID | 1319 #undef COUNTER_ID |
1272 #define COUNTER_ID(name) kCountOfFIXED_ARRAY__##name, \ | 1320 #define COUNTER_ID(name) kCountOfFIXED_ARRAY__##name, \ |
1273 kSizeOfFIXED_ARRAY__##name, | 1321 kSizeOfFIXED_ARRAY__##name, |
1274 FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(COUNTER_ID) | 1322 FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(COUNTER_ID) |
1275 #undef COUNTER_ID | 1323 #undef COUNTER_ID |
1276 #define COUNTER_ID(name) kCountOfCODE_AGE__##name, \ | 1324 #define COUNTER_ID(name) kCountOfCODE_AGE__##name, \ |
1277 kSizeOfCODE_AGE__##name, | 1325 kSizeOfCODE_AGE__##name, |
1278 CODE_AGE_LIST_COMPLETE(COUNTER_ID) | 1326 CODE_AGE_LIST_COMPLETE(COUNTER_ID) |
1279 #undef COUNTER_ID | 1327 #undef COUNTER_ID |
1280 stats_counter_count | 1328 stats_counter_count |
1281 }; | 1329 }; |
1330 // clang-format on | |
1282 | 1331 |
1283 void ResetCounters(); | 1332 void ResetCounters(); |
1284 void ResetHistograms(); | 1333 void ResetHistograms(); |
1285 void InitializeHistograms(); | 1334 void InitializeHistograms(); |
1286 | 1335 |
1287 RuntimeCallStats* runtime_call_stats() { return &runtime_call_stats_; } | 1336 RuntimeCallStats* runtime_call_stats() { return &runtime_call_stats_; } |
1288 | 1337 |
1289 private: | 1338 private: |
1290 #define HR(name, caption, min, max, num_buckets) Histogram name##_; | 1339 #define HR(name, caption, min, max, num_buckets) Histogram name##_; |
1291 HISTOGRAM_RANGE_LIST(HR) | 1340 HISTOGRAM_RANGE_LIST(HR) |
(...skipping 23 matching lines...) Expand all Loading... | |
1315 AggregatedMemoryHistogram<Histogram> aggregated_##name##_; | 1364 AggregatedMemoryHistogram<Histogram> aggregated_##name##_; |
1316 HISTOGRAM_MEMORY_LIST(HM) | 1365 HISTOGRAM_MEMORY_LIST(HM) |
1317 #undef HM | 1366 #undef HM |
1318 | 1367 |
1319 #define SC(name, caption) \ | 1368 #define SC(name, caption) \ |
1320 StatsCounter name##_; | 1369 StatsCounter name##_; |
1321 STATS_COUNTER_LIST_1(SC) | 1370 STATS_COUNTER_LIST_1(SC) |
1322 STATS_COUNTER_LIST_2(SC) | 1371 STATS_COUNTER_LIST_2(SC) |
1323 #undef SC | 1372 #undef SC |
1324 | 1373 |
1374 #define SC(name, caption) StatsCounterThreadSafe name##_; | |
1375 STATS_COUNTER_TS_LIST(SC) | |
1376 #undef SC | |
1377 | |
1325 #define SC(name) \ | 1378 #define SC(name) \ |
1326 StatsCounter size_of_##name##_; \ | 1379 StatsCounter size_of_##name##_; \ |
1327 StatsCounter count_of_##name##_; | 1380 StatsCounter count_of_##name##_; |
1328 INSTANCE_TYPE_LIST(SC) | 1381 INSTANCE_TYPE_LIST(SC) |
1329 #undef SC | 1382 #undef SC |
1330 | 1383 |
1331 #define SC(name) \ | 1384 #define SC(name) \ |
1332 StatsCounter size_of_CODE_TYPE_##name##_; \ | 1385 StatsCounter size_of_CODE_TYPE_##name##_; \ |
1333 StatsCounter count_of_CODE_TYPE_##name##_; | 1386 StatsCounter count_of_CODE_TYPE_##name##_; |
1334 CODE_KIND_LIST(SC) | 1387 CODE_KIND_LIST(SC) |
1335 #undef SC | 1388 #undef SC |
1336 | 1389 |
1337 #define SC(name) \ | 1390 #define SC(name) \ |
1338 StatsCounter size_of_FIXED_ARRAY_##name##_; \ | 1391 StatsCounter size_of_FIXED_ARRAY_##name##_; \ |
1339 StatsCounter count_of_FIXED_ARRAY_##name##_; | 1392 StatsCounter count_of_FIXED_ARRAY_##name##_; |
1340 FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(SC) | 1393 FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(SC) |
1341 #undef SC | 1394 #undef SC |
1342 | 1395 |
1343 #define SC(name) \ | 1396 #define SC(name) \ |
1344 StatsCounter size_of_CODE_AGE_##name##_; \ | 1397 StatsCounter size_of_CODE_AGE_##name##_; \ |
1345 StatsCounter count_of_CODE_AGE_##name##_; | 1398 StatsCounter count_of_CODE_AGE_##name##_; |
1346 CODE_AGE_LIST_COMPLETE(SC) | 1399 CODE_AGE_LIST_COMPLETE(SC) |
1347 #undef SC | 1400 #undef SC |
1348 | 1401 |
1349 RuntimeCallStats runtime_call_stats_; | 1402 RuntimeCallStats runtime_call_stats_; |
1350 | 1403 |
1351 friend class Isolate; | 1404 friend class Isolate; |
1352 | 1405 |
1353 explicit Counters(Isolate* isolate); | |
1354 | |
1355 DISALLOW_IMPLICIT_CONSTRUCTORS(Counters); | 1406 DISALLOW_IMPLICIT_CONSTRUCTORS(Counters); |
1356 }; | 1407 }; |
1357 | 1408 |
1358 } // namespace internal | 1409 } // namespace internal |
1359 } // namespace v8 | 1410 } // namespace v8 |
1360 | 1411 |
1361 #endif // V8_COUNTERS_H_ | 1412 #endif // V8_COUNTERS_H_ |
OLD | NEW |