The data contained in this repository can be downloaded to your computer using one of several clients.
Please see the documentation of your version control software client for more information.

Please select the desired protocol below to get the URL.

This URL has Read-Only access.

Statistics
| Branch: | Revision:

main_repo / deps / v8 / src / v8-counters.h @ f230a1cf

History | View | Annotate | Download (22.5 KB)

1
// Copyright 2012 the V8 project authors. All rights reserved.
2
// Redistribution and use in source and binary forms, with or without
3
// modification, are permitted provided that the following conditions are
4
// met:
5
//
6
//     * Redistributions of source code must retain the above copyright
7
//       notice, this list of conditions and the following disclaimer.
8
//     * Redistributions in binary form must reproduce the above
9
//       copyright notice, this list of conditions and the following
10
//       disclaimer in the documentation and/or other materials provided
11
//       with the distribution.
12
//     * Neither the name of Google Inc. nor the names of its
13
//       contributors may be used to endorse or promote products derived
14
//       from this software without specific prior written permission.
15
//
16
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27

    
28
#ifndef V8_V8_COUNTERS_H_
29
#define V8_V8_COUNTERS_H_
30

    
31
#include "allocation.h"
32
#include "counters.h"
33
#include "objects.h"
34
#include "v8globals.h"
35

    
36
namespace v8 {
37
namespace internal {
38

    
39
#define HISTOGRAM_TIMER_LIST(HT)                                      \
40
  /* Garbage collection timers. */                                    \
41
  HT(gc_compactor, V8.GCCompactor)                                    \
42
  HT(gc_scavenger, V8.GCScavenger)                                    \
43
  HT(gc_context, V8.GCContext) /* GC context cleanup time */          \
44
  /* Parsing timers. */                                               \
45
  HT(parse, V8.Parse)                                                 \
46
  HT(parse_lazy, V8.ParseLazy)                                        \
47
  HT(pre_parse, V8.PreParse)                                          \
48
  /* Total compilation times. */                                      \
49
  HT(compile, V8.Compile)                                             \
50
  HT(compile_eval, V8.CompileEval)                                    \
51
  HT(compile_lazy, V8.CompileLazy)
52

    
53
#define HISTOGRAM_PERCENTAGE_LIST(HP)                                 \
54
  /* Heap fragmentation. */                                           \
55
  HP(external_fragmentation_total,                                    \
56
     V8.MemoryExternalFragmentationTotal)                             \
57
  HP(external_fragmentation_old_pointer_space,                        \
58
     V8.MemoryExternalFragmentationOldPointerSpace)                   \
59
  HP(external_fragmentation_old_data_space,                           \
60
     V8.MemoryExternalFragmentationOldDataSpace)                      \
61
  HP(external_fragmentation_code_space,                               \
62
     V8.MemoryExternalFragmentationCodeSpace)                         \
63
  HP(external_fragmentation_map_space,                                \
64
     V8.MemoryExternalFragmentationMapSpace)                          \
65
  HP(external_fragmentation_cell_space,                               \
66
     V8.MemoryExternalFragmentationCellSpace)                         \
67
  HP(external_fragmentation_property_cell_space,                      \
68
     V8.MemoryExternalFragmentationPropertyCellSpace)                 \
69
  HP(external_fragmentation_lo_space,                                 \
70
     V8.MemoryExternalFragmentationLoSpace)                           \
71
  /* Percentages of heap committed to each space. */                  \
72
  HP(heap_fraction_new_space,                                         \
73
     V8.MemoryHeapFractionNewSpace)                                   \
74
  HP(heap_fraction_old_pointer_space,                                 \
75
     V8.MemoryHeapFractionOldPointerSpace)                            \
76
  HP(heap_fraction_old_data_space,                                    \
77
     V8.MemoryHeapFractionOldDataSpace)                               \
78
  HP(heap_fraction_code_space,                                        \
79
     V8.MemoryHeapFractionCodeSpace)                                  \
80
  HP(heap_fraction_map_space,                                         \
81
     V8.MemoryHeapFractionMapSpace)                                   \
82
  HP(heap_fraction_cell_space,                                        \
83
     V8.MemoryHeapFractionCellSpace)                                  \
84
  HP(heap_fraction_property_cell_space,                               \
85
     V8.MemoryHeapFractionPropertyCellSpace)                          \
86
  HP(heap_fraction_lo_space,                                          \
87
     V8.MemoryHeapFractionLoSpace)                                    \
88
  /* Percentage of crankshafted codegen. */                           \
89
  HP(codegen_fraction_crankshaft,                                     \
90
     V8.CodegenFractionCrankshaft)                                    \
91

    
92

    
93
#define HISTOGRAM_MEMORY_LIST(HM)                                     \
94
  HM(heap_sample_total_committed, V8.MemoryHeapSampleTotalCommitted)  \
95
  HM(heap_sample_total_used, V8.MemoryHeapSampleTotalUsed)            \
96
  HM(heap_sample_map_space_committed,                                 \
97
     V8.MemoryHeapSampleMapSpaceCommitted)                            \
98
  HM(heap_sample_cell_space_committed,                                \
99
     V8.MemoryHeapSampleCellSpaceCommitted)                           \
100
  HM(heap_sample_property_cell_space_committed,                       \
101
     V8.MemoryHeapSamplePropertyCellSpaceCommitted)                   \
102
  HM(heap_sample_code_space_committed,                                \
103
     V8.MemoryHeapSampleCodeSpaceCommitted)                           \
104

    
105

    
106
// WARNING: STATS_COUNTER_LIST_* is a very large macro that is causing MSVC
107
// Intellisense to crash.  It was broken into two macros (each of length 40
108
// lines) rather than one macro (of length about 80 lines) to work around
109
// this problem.  Please avoid using recursive macros of this length when
110
// possible.
111
#define STATS_COUNTER_LIST_1(SC)                                      \
112
  /* Global Handle Count*/                                            \
113
  SC(global_handles, V8.GlobalHandles)                                \
114
  /* OS Memory allocated */                                           \
115
  SC(memory_allocated, V8.OsMemoryAllocated)                          \
116
  SC(normalized_maps, V8.NormalizedMaps)                              \
117
  SC(props_to_dictionary, V8.ObjectPropertiesToDictionary)            \
118
  SC(elements_to_dictionary, V8.ObjectElementsToDictionary)           \
119
  SC(alive_after_last_gc, V8.AliveAfterLastGC)                        \
120
  SC(objs_since_last_young, V8.ObjsSinceLastYoung)                    \
121
  SC(objs_since_last_full, V8.ObjsSinceLastFull)                      \
122
  SC(string_table_capacity, V8.StringTableCapacity)                   \
123
  SC(number_of_symbols, V8.NumberOfSymbols)                           \
124
  SC(script_wrappers, V8.ScriptWrappers)                              \
125
  SC(call_initialize_stubs, V8.CallInitializeStubs)                   \
126
  SC(call_premonomorphic_stubs, V8.CallPreMonomorphicStubs)           \
127
  SC(call_normal_stubs, V8.CallNormalStubs)                           \
128
  SC(call_megamorphic_stubs, V8.CallMegamorphicStubs)                 \
129
  SC(arguments_adaptors, V8.ArgumentsAdaptors)                        \
130
  SC(compilation_cache_hits, V8.CompilationCacheHits)                 \
131
  SC(compilation_cache_misses, V8.CompilationCacheMisses)             \
132
  SC(string_ctor_calls, V8.StringConstructorCalls)                    \
133
  SC(string_ctor_conversions, V8.StringConstructorConversions)        \
134
  SC(string_ctor_cached_number, V8.StringConstructorCachedNumber)     \
135
  SC(string_ctor_string_value, V8.StringConstructorStringValue)       \
136
  SC(string_ctor_gc_required, V8.StringConstructorGCRequired)         \
137
  /* Amount of evaled source code. */                                 \
138
  SC(total_eval_size, V8.TotalEvalSize)                               \
139
  /* Amount of loaded source code. */                                 \
140
  SC(total_load_size, V8.TotalLoadSize)                               \
141
  /* Amount of parsed source code. */                                 \
142
  SC(total_parse_size, V8.TotalParseSize)                             \
143
  /* Amount of source code skipped over using preparsing. */          \
144
  SC(total_preparse_skipped, V8.TotalPreparseSkipped)                 \
145
  /* Number of symbol lookups skipped using preparsing */             \
146
  SC(total_preparse_symbols_skipped, V8.TotalPreparseSymbolSkipped)   \
147
  /* Amount of compiled source code. */                               \
148
  SC(total_compile_size, V8.TotalCompileSize)                         \
149
  /* Amount of source code compiled with the full codegen. */         \
150
  SC(total_full_codegen_source_size, V8.TotalFullCodegenSourceSize)   \
151
  /* Number of contexts created from scratch. */                      \
152
  SC(contexts_created_from_scratch, V8.ContextsCreatedFromScratch)    \
153
  /* Number of contexts created by partial snapshot. */               \
154
  SC(contexts_created_by_snapshot, V8.ContextsCreatedBySnapshot)      \
155
  /* Number of code objects found from pc. */                         \
156
  SC(pc_to_code, V8.PcToCode)                                         \
157
  SC(pc_to_code_cached, V8.PcToCodeCached)                            \
158
  /* The store-buffer implementation of the write barrier. */         \
159
  SC(store_buffer_compactions, V8.StoreBufferCompactions)             \
160
  SC(store_buffer_overflows, V8.StoreBufferOverflows)
161

    
162

    
163
#define STATS_COUNTER_LIST_2(SC)                                      \
164
  /* Number of code stubs. */                                         \
165
  SC(code_stubs, V8.CodeStubs)                                        \
166
  /* Amount of stub code. */                                          \
167
  SC(total_stubs_code_size, V8.TotalStubsCodeSize)                    \
168
  /* Amount of (JS) compiled code. */                                 \
169
  SC(total_compiled_code_size, V8.TotalCompiledCodeSize)              \
170
  SC(gc_compactor_caused_by_request, V8.GCCompactorCausedByRequest)   \
171
  SC(gc_compactor_caused_by_promoted_data,                            \
172
     V8.GCCompactorCausedByPromotedData)                              \
173
  SC(gc_compactor_caused_by_oldspace_exhaustion,                      \
174
     V8.GCCompactorCausedByOldspaceExhaustion)                        \
175
  SC(gc_last_resort_from_js, V8.GCLastResortFromJS)                   \
176
  SC(gc_last_resort_from_handles, V8.GCLastResortFromHandles)         \
177
  /* How is the generic keyed-load stub used? */                      \
178
  SC(keyed_load_generic_smi, V8.KeyedLoadGenericSmi)                  \
179
  SC(keyed_load_generic_symbol, V8.KeyedLoadGenericSymbol)            \
180
  SC(keyed_load_generic_lookup_cache, V8.KeyedLoadGenericLookupCache) \
181
  SC(keyed_load_generic_slow, V8.KeyedLoadGenericSlow)                \
182
  SC(keyed_load_polymorphic_stubs, V8.KeyedLoadPolymorphicStubs)      \
183
  SC(keyed_load_external_array_slow, V8.KeyedLoadExternalArraySlow)   \
184
  /* How is the generic keyed-call stub used? */                      \
185
  SC(keyed_call_generic_smi_fast, V8.KeyedCallGenericSmiFast)         \
186
  SC(keyed_call_generic_smi_dict, V8.KeyedCallGenericSmiDict)         \
187
  SC(keyed_call_generic_lookup_cache, V8.KeyedCallGenericLookupCache) \
188
  SC(keyed_call_generic_lookup_dict, V8.KeyedCallGenericLookupDict)   \
189
  SC(keyed_call_generic_slow, V8.KeyedCallGenericSlow)                \
190
  SC(keyed_call_generic_slow_load, V8.KeyedCallGenericSlowLoad)       \
191
  SC(named_load_global_stub, V8.NamedLoadGlobalStub)                  \
192
  SC(named_store_global_inline, V8.NamedStoreGlobalInline)            \
193
  SC(named_store_global_inline_miss, V8.NamedStoreGlobalInlineMiss)   \
194
  SC(keyed_store_polymorphic_stubs, V8.KeyedStorePolymorphicStubs)    \
195
  SC(keyed_store_external_array_slow, V8.KeyedStoreExternalArraySlow) \
196
  SC(store_normal_miss, V8.StoreNormalMiss)                           \
197
  SC(store_normal_hit, V8.StoreNormalHit)                             \
198
  SC(cow_arrays_created_stub, V8.COWArraysCreatedStub)                \
199
  SC(cow_arrays_created_runtime, V8.COWArraysCreatedRuntime)          \
200
  SC(cow_arrays_converted, V8.COWArraysConverted)                     \
201
  SC(call_miss, V8.CallMiss)                                          \
202
  SC(keyed_call_miss, V8.KeyedCallMiss)                               \
203
  SC(load_miss, V8.LoadMiss)                                          \
204
  SC(keyed_load_miss, V8.KeyedLoadMiss)                               \
205
  SC(call_const, V8.CallConst)                                        \
206
  SC(call_const_fast_api, V8.CallConstFastApi)                        \
207
  SC(call_const_interceptor, V8.CallConstInterceptor)                 \
208
  SC(call_const_interceptor_fast_api, V8.CallConstInterceptorFastApi) \
209
  SC(call_global_inline, V8.CallGlobalInline)                         \
210
  SC(call_global_inline_miss, V8.CallGlobalInlineMiss)                \
211
  SC(constructed_objects, V8.ConstructedObjects)                      \
212
  SC(constructed_objects_runtime, V8.ConstructedObjectsRuntime)       \
213
  SC(negative_lookups, V8.NegativeLookups)                            \
214
  SC(negative_lookups_miss, V8.NegativeLookupsMiss)                   \
215
  SC(megamorphic_stub_cache_probes, V8.MegamorphicStubCacheProbes)    \
216
  SC(megamorphic_stub_cache_misses, V8.MegamorphicStubCacheMisses)    \
217
  SC(megamorphic_stub_cache_updates, V8.MegamorphicStubCacheUpdates)  \
218
  SC(array_function_runtime, V8.ArrayFunctionRuntime)                 \
219
  SC(array_function_native, V8.ArrayFunctionNative)                   \
220
  SC(for_in, V8.ForIn)                                                \
221
  SC(enum_cache_hits, V8.EnumCacheHits)                               \
222
  SC(enum_cache_misses, V8.EnumCacheMisses)                           \
223
  SC(zone_segment_bytes, V8.ZoneSegmentBytes)                         \
224
  SC(fast_new_closure_total, V8.FastNewClosureTotal)                  \
225
  SC(fast_new_closure_try_optimized, V8.FastNewClosureTryOptimized)   \
226
  SC(fast_new_closure_install_optimized, V8.FastNewClosureInstallOptimized) \
227
  SC(string_add_runtime, V8.StringAddRuntime)                         \
228
  SC(string_add_native, V8.StringAddNative)                           \
229
  SC(string_add_runtime_ext_to_ascii, V8.StringAddRuntimeExtToAscii)  \
230
  SC(sub_string_runtime, V8.SubStringRuntime)                         \
231
  SC(sub_string_native, V8.SubStringNative)                           \
232
  SC(string_add_make_two_char, V8.StringAddMakeTwoChar)               \
233
  SC(string_compare_native, V8.StringCompareNative)                   \
234
  SC(string_compare_runtime, V8.StringCompareRuntime)                 \
235
  SC(regexp_entry_runtime, V8.RegExpEntryRuntime)                     \
236
  SC(regexp_entry_native, V8.RegExpEntryNative)                       \
237
  SC(number_to_string_native, V8.NumberToStringNative)                \
238
  SC(number_to_string_runtime, V8.NumberToStringRuntime)              \
239
  SC(math_acos, V8.MathAcos)                                          \
240
  SC(math_asin, V8.MathAsin)                                          \
241
  SC(math_atan, V8.MathAtan)                                          \
242
  SC(math_atan2, V8.MathAtan2)                                        \
243
  SC(math_ceil, V8.MathCeil)                                          \
244
  SC(math_cos, V8.MathCos)                                            \
245
  SC(math_exp, V8.MathExp)                                            \
246
  SC(math_floor, V8.MathFloor)                                        \
247
  SC(math_log, V8.MathLog)                                            \
248
  SC(math_pow, V8.MathPow)                                            \
249
  SC(math_round, V8.MathRound)                                        \
250
  SC(math_sin, V8.MathSin)                                            \
251
  SC(math_sqrt, V8.MathSqrt)                                          \
252
  SC(math_tan, V8.MathTan)                                            \
253
  SC(transcendental_cache_hit, V8.TranscendentalCacheHit)             \
254
  SC(transcendental_cache_miss, V8.TranscendentalCacheMiss)           \
255
  SC(stack_interrupts, V8.StackInterrupts)                            \
256
  SC(runtime_profiler_ticks, V8.RuntimeProfilerTicks)                 \
257
  SC(bounds_checks_eliminated, V8.BoundsChecksEliminated)             \
258
  SC(bounds_checks_hoisted, V8.BoundsChecksHoisted)                   \
259
  SC(soft_deopts_requested, V8.SoftDeoptsRequested)                   \
260
  SC(soft_deopts_inserted, V8.SoftDeoptsInserted)                     \
261
  SC(soft_deopts_executed, V8.SoftDeoptsExecuted)                     \
262
  SC(new_space_bytes_available, V8.MemoryNewSpaceBytesAvailable)      \
263
  SC(new_space_bytes_committed, V8.MemoryNewSpaceBytesCommitted)      \
264
  SC(new_space_bytes_used, V8.MemoryNewSpaceBytesUsed)                \
265
  SC(old_pointer_space_bytes_available,                               \
266
     V8.MemoryOldPointerSpaceBytesAvailable)                          \
267
  SC(old_pointer_space_bytes_committed,                               \
268
     V8.MemoryOldPointerSpaceBytesCommitted)                          \
269
  SC(old_pointer_space_bytes_used, V8.MemoryOldPointerSpaceBytesUsed) \
270
  SC(old_data_space_bytes_available, V8.MemoryOldDataSpaceBytesAvailable) \
271
  SC(old_data_space_bytes_committed, V8.MemoryOldDataSpaceBytesCommitted) \
272
  SC(old_data_space_bytes_used, V8.MemoryOldDataSpaceBytesUsed)       \
273
  SC(code_space_bytes_available, V8.MemoryCodeSpaceBytesAvailable)    \
274
  SC(code_space_bytes_committed, V8.MemoryCodeSpaceBytesCommitted)    \
275
  SC(code_space_bytes_used, V8.MemoryCodeSpaceBytesUsed)              \
276
  SC(map_space_bytes_available, V8.MemoryMapSpaceBytesAvailable)      \
277
  SC(map_space_bytes_committed, V8.MemoryMapSpaceBytesCommitted)      \
278
  SC(map_space_bytes_used, V8.MemoryMapSpaceBytesUsed)                \
279
  SC(cell_space_bytes_available, V8.MemoryCellSpaceBytesAvailable)    \
280
  SC(cell_space_bytes_committed, V8.MemoryCellSpaceBytesCommitted)    \
281
  SC(cell_space_bytes_used, V8.MemoryCellSpaceBytesUsed)              \
282
  SC(property_cell_space_bytes_available,                             \
283
     V8.MemoryPropertyCellSpaceBytesAvailable)                        \
284
  SC(property_cell_space_bytes_committed,                             \
285
     V8.MemoryPropertyCellSpaceBytesCommitted)                        \
286
  SC(property_cell_space_bytes_used,                                  \
287
     V8.MemoryPropertyCellSpaceBytesUsed)                             \
288
  SC(lo_space_bytes_available, V8.MemoryLoSpaceBytesAvailable)        \
289
  SC(lo_space_bytes_committed, V8.MemoryLoSpaceBytesCommitted)        \
290
  SC(lo_space_bytes_used, V8.MemoryLoSpaceBytesUsed)
291

    
292

    
293
// This file contains all the v8 counters that are in use.
294
class Counters {
295
 public:
296
#define HT(name, caption) \
297
  HistogramTimer* name() { return &name##_; }
298
  HISTOGRAM_TIMER_LIST(HT)
299
#undef HT
300

    
301
#define HP(name, caption) \
302
  Histogram* name() { return &name##_; }
303
  HISTOGRAM_PERCENTAGE_LIST(HP)
304
#undef HP
305

    
306
#define HM(name, caption) \
307
  Histogram* name() { return &name##_; }
308
  HISTOGRAM_MEMORY_LIST(HM)
309
#undef HM
310

    
311
#define SC(name, caption) \
312
  StatsCounter* name() { return &name##_; }
313
  STATS_COUNTER_LIST_1(SC)
314
  STATS_COUNTER_LIST_2(SC)
315
#undef SC
316

    
317
#define SC(name) \
318
  StatsCounter* count_of_##name() { return &count_of_##name##_; } \
319
  StatsCounter* size_of_##name() { return &size_of_##name##_; }
320
  INSTANCE_TYPE_LIST(SC)
321
#undef SC
322

    
323
#define SC(name) \
324
  StatsCounter* count_of_CODE_TYPE_##name() \
325
    { return &count_of_CODE_TYPE_##name##_; } \
326
  StatsCounter* size_of_CODE_TYPE_##name() \
327
    { return &size_of_CODE_TYPE_##name##_; }
328
  CODE_KIND_LIST(SC)
329
#undef SC
330

    
331
#define SC(name) \
332
  StatsCounter* count_of_FIXED_ARRAY_##name() \
333
    { return &count_of_FIXED_ARRAY_##name##_; } \
334
  StatsCounter* size_of_FIXED_ARRAY_##name() \
335
    { return &size_of_FIXED_ARRAY_##name##_; }
336
  FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(SC)
337
#undef SC
338

    
339
#define SC(name) \
340
  StatsCounter* count_of_CODE_AGE_##name() \
341
    { return &count_of_CODE_AGE_##name##_; } \
342
  StatsCounter* size_of_CODE_AGE_##name() \
343
    { return &size_of_CODE_AGE_##name##_; }
344
  CODE_AGE_LIST_WITH_NO_AGE(SC)
345
#undef SC
346

    
347
  enum Id {
348
#define RATE_ID(name, caption) k_##name,
349
    HISTOGRAM_TIMER_LIST(RATE_ID)
350
#undef RATE_ID
351
#define PERCENTAGE_ID(name, caption) k_##name,
352
    HISTOGRAM_PERCENTAGE_LIST(PERCENTAGE_ID)
353
#undef PERCENTAGE_ID
354
#define MEMORY_ID(name, caption) k_##name,
355
    HISTOGRAM_MEMORY_LIST(MEMORY_ID)
356
#undef MEMORY_ID
357
#define COUNTER_ID(name, caption) k_##name,
358
    STATS_COUNTER_LIST_1(COUNTER_ID)
359
    STATS_COUNTER_LIST_2(COUNTER_ID)
360
#undef COUNTER_ID
361
#define COUNTER_ID(name) kCountOf##name, kSizeOf##name,
362
    INSTANCE_TYPE_LIST(COUNTER_ID)
363
#undef COUNTER_ID
364
#define COUNTER_ID(name) kCountOfCODE_TYPE_##name, \
365
    kSizeOfCODE_TYPE_##name,
366
    CODE_KIND_LIST(COUNTER_ID)
367
#undef COUNTER_ID
368
#define COUNTER_ID(name) kCountOfFIXED_ARRAY__##name, \
369
    kSizeOfFIXED_ARRAY__##name,
370
    FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(COUNTER_ID)
371
#undef COUNTER_ID
372
#define COUNTER_ID(name) kCountOfCODE_AGE__##name, \
373
    kSizeOfCODE_AGE__##name,
374
    CODE_AGE_LIST_WITH_NO_AGE(COUNTER_ID)
375
#undef COUNTER_ID
376
    stats_counter_count
377
  };
378

    
379
  void ResetHistograms();
380

    
381
 private:
382
#define HT(name, caption) \
383
  HistogramTimer name##_;
384
  HISTOGRAM_TIMER_LIST(HT)
385
#undef HT
386

    
387
#define HP(name, caption) \
388
  Histogram name##_;
389
  HISTOGRAM_PERCENTAGE_LIST(HP)
390
#undef HP
391

    
392
#define HM(name, caption) \
393
  Histogram name##_;
394
  HISTOGRAM_MEMORY_LIST(HM)
395
#undef HM
396

    
397
#define SC(name, caption) \
398
  StatsCounter name##_;
399
  STATS_COUNTER_LIST_1(SC)
400
  STATS_COUNTER_LIST_2(SC)
401
#undef SC
402

    
403
#define SC(name) \
404
  StatsCounter size_of_##name##_; \
405
  StatsCounter count_of_##name##_;
406
  INSTANCE_TYPE_LIST(SC)
407
#undef SC
408

    
409
#define SC(name) \
410
  StatsCounter size_of_CODE_TYPE_##name##_; \
411
  StatsCounter count_of_CODE_TYPE_##name##_;
412
  CODE_KIND_LIST(SC)
413
#undef SC
414

    
415
#define SC(name) \
416
  StatsCounter size_of_FIXED_ARRAY_##name##_; \
417
  StatsCounter count_of_FIXED_ARRAY_##name##_;
418
  FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(SC)
419
#undef SC
420

    
421
#define SC(name) \
422
  StatsCounter size_of_CODE_AGE_##name##_; \
423
  StatsCounter count_of_CODE_AGE_##name##_;
424
  CODE_AGE_LIST_WITH_NO_AGE(SC)
425
#undef SC
426

    
427
  friend class Isolate;
428

    
429
  explicit Counters(Isolate* isolate);
430

    
431
  DISALLOW_IMPLICIT_CONSTRUCTORS(Counters);
432
};
433

    
434
} }  // namespace v8::internal
435

    
436
#endif  // V8_V8_COUNTERS_H_