• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2019 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef V8_LOGGING_COUNTERS_DEFINITIONS_H_
6 #define V8_LOGGING_COUNTERS_DEFINITIONS_H_
7 
8 #include "include/v8-internal.h"
9 
10 namespace v8 {
11 namespace internal {
12 
13 #define HISTOGRAM_RANGE_LIST(HR)                                               \
14   /* Generic range histograms: HR(name, caption, min, max, num_buckets) */     \
15   HR(background_marking, V8.GCBackgroundMarking, 0, 10000, 101)                \
16   HR(background_sweeping, V8.GCBackgroundSweeping, 0, 10000, 101)              \
17   HR(code_cache_reject_reason, V8.CodeCacheRejectReason, 1, 6, 6)              \
18   HR(errors_thrown_per_context, V8.ErrorsThrownPerContext, 0, 200, 20)         \
19   HR(debug_feature_usage, V8.DebugFeatureUsage, 1, 7, 7)                       \
20   HR(incremental_marking_reason, V8.GCIncrementalMarkingReason, 0,             \
21      kGarbageCollectionReasonMaxValue, kGarbageCollectionReasonMaxValue + 1)   \
22   HR(incremental_marking_sum, V8.GCIncrementalMarkingSum, 0, 10000, 101)       \
23   HR(mark_compact_reason, V8.GCMarkCompactReason, 0,                           \
24      kGarbageCollectionReasonMaxValue, kGarbageCollectionReasonMaxValue + 1)   \
25   HR(gc_finalize_clear, V8.GCFinalizeMC.Clear, 0, 10000, 101)                  \
26   HR(gc_finalize_epilogue, V8.GCFinalizeMC.Epilogue, 0, 10000, 101)            \
27   HR(gc_finalize_evacuate, V8.GCFinalizeMC.Evacuate, 0, 10000, 101)            \
28   HR(gc_finalize_finish, V8.GCFinalizeMC.Finish, 0, 10000, 101)                \
29   HR(gc_finalize_mark, V8.GCFinalizeMC.Mark, 0, 10000, 101)                    \
30   HR(gc_finalize_prologue, V8.GCFinalizeMC.Prologue, 0, 10000, 101)            \
31   HR(gc_finalize_sweep, V8.GCFinalizeMC.Sweep, 0, 10000, 101)                  \
32   HR(gc_scavenger_scavenge_main, V8.GCScavenger.ScavengeMain, 0, 10000, 101)   \
33   HR(gc_scavenger_scavenge_roots, V8.GCScavenger.ScavengeRoots, 0, 10000, 101) \
34   HR(gc_marking_sum, V8.GCMarkingSum, 0, 10000, 101)                           \
35   /* Range and bucket matches BlinkGC.MainThreadMarkingThroughput. */          \
36   HR(gc_main_thread_marking_throughput, V8.GCMainThreadMarkingThroughput, 0,   \
37      100000, 50)                                                               \
38   HR(young_generation_handling, V8.GCYoungGenerationHandling, 0, 2, 3)         \
39   /* Asm/Wasm. */                                                              \
40   HR(wasm_functions_per_asm_module, V8.WasmFunctionsPerModule.asm, 1, 1000000, \
41      51)                                                                       \
42   HR(wasm_functions_per_wasm_module, V8.WasmFunctionsPerModule.wasm, 1,        \
43      1000000, 51)                                                              \
44   HR(array_buffer_big_allocations, V8.ArrayBufferLargeAllocations, 0, 4096,    \
45      13)                                                                       \
46   HR(array_buffer_new_size_failures, V8.ArrayBufferNewSizeFailures, 0, 4096,   \
47      13)                                                                       \
48   HR(shared_array_allocations, V8.SharedArrayAllocationSizes, 0, 4096, 13)     \
49   HR(wasm_asm_huge_function_size_bytes, V8.WasmHugeFunctionSizeBytes.asm,      \
50      100 * KB, GB, 51)                                                         \
51   HR(wasm_wasm_huge_function_size_bytes, V8.WasmHugeFunctionSizeBytes.wasm,    \
52      100 * KB, GB, 51)                                                         \
53   HR(wasm_asm_module_size_bytes, V8.WasmModuleSizeBytes.asm, 1, GB, 51)        \
54   HR(wasm_wasm_module_size_bytes, V8.WasmModuleSizeBytes.wasm, 1, GB, 51)      \
55   HR(wasm_asm_min_mem_pages_count, V8.WasmMinMemPagesCount.asm, 1, 2 << 16,    \
56      51)                                                                       \
57   HR(wasm_wasm_min_mem_pages_count, V8.WasmMinMemPagesCount.wasm, 1, 2 << 16,  \
58      51)                                                                       \
59   HR(wasm_wasm_max_mem_pages_count, V8.WasmMaxMemPagesCount.wasm, 1, 2 << 16,  \
60      51)                                                                       \
61   HR(wasm_compile_function_peak_memory_bytes,                                  \
62      V8.WasmCompileFunctionPeakMemoryBytes, 1, GB, 51)                         \
63   HR(wasm_compile_huge_function_peak_memory_bytes,                             \
64      V8.WasmCompileHugeFunctionPeakMemoryBytes, 1, GB, 51)                     \
65   HR(asm_module_size_bytes, V8.AsmModuleSizeBytes, 1, GB, 51)                  \
66   HR(compile_script_cache_behaviour, V8.CompileScript.CacheBehaviour, 0, 20,   \
67      21)                                                                       \
68   HR(wasm_memory_allocation_result, V8.WasmMemoryAllocationResult, 0, 3, 4)    \
69   /* committed code size per module, collected on GC */                        \
70   HR(wasm_module_code_size_mb, V8.WasmModuleCodeSizeMiB, 0, 1024, 64)          \
71   /* code size per module after baseline compilation */                        \
72   HR(wasm_module_code_size_mb_after_baseline,                                  \
73      V8.WasmModuleCodeSizeBaselineMiB, 0, 1024, 64)                            \
74   /* code size per module after top-tier compilation */                        \
75   HR(wasm_module_code_size_mb_after_top_tier, V8.WasmModuleCodeSizeTopTierMiB, \
76      0, 1024, 64)                                                              \
77   /* percent of freed code size per module, collected on GC */                 \
78   HR(wasm_module_freed_code_size_percent, V8.WasmModuleCodeSizePercentFreed,   \
79      0, 100, 32)                                                               \
80   /* number of code GCs triggered per native module, collected on code GC */   \
81   HR(wasm_module_num_triggered_code_gcs,                                       \
82      V8.WasmModuleNumberOfCodeGCsTriggered, 1, 128, 20)                        \
83   /* number of code spaces reserved per wasm module */                         \
84   HR(wasm_module_num_code_spaces, V8.WasmModuleNumberOfCodeSpaces, 1, 128, 20) \
85   /* number of live modules per isolate */                                     \
86   HR(wasm_modules_per_isolate, V8.WasmModulesPerIsolate, 1, 1024, 30)          \
87   /* number of live modules per engine (i.e. whole process) */                 \
88   HR(wasm_modules_per_engine, V8.WasmModulesPerEngine, 1, 1024, 30)            \
89   /* bailout reason if Liftoff failed, or {kSuccess} (per function) */         \
90   HR(liftoff_bailout_reasons, V8.LiftoffBailoutReasons, 0, 20, 21)             \
91   /* support for PKEYs/PKU by testing result of pkey_alloc() */                \
92   HR(wasm_memory_protection_keys_support, V8.WasmMemoryProtectionKeysSupport,  \
93      0, 1, 2)                                                                  \
94   /* number of thrown exceptions per isolate */                                \
95   HR(wasm_throw_count, V8.WasmThrowCount, 0, 100000, 30)                       \
96   /* number of rethrown exceptions per isolate */                              \
97   HR(wasm_rethrow_count, V8.WasmReThrowCount, 0, 100000, 30)                   \
98   /* number of caught exceptions per isolate */                                \
99   HR(wasm_catch_count, V8.WasmCatchCount, 0, 100000, 30)                       \
100   /* Ticks observed in a single Turbofan compilation, in 1K */                 \
101   HR(turbofan_ticks, V8.TurboFan1KTicks, 0, 100000, 200)                       \
102   /* Backtracks observed in a single regexp interpreter execution */           \
103   /* The maximum of 100M backtracks takes roughly 2 seconds on my machine. */  \
104   HR(regexp_backtracks, V8.RegExpBacktracks, 1, 100000000, 50)                 \
105   /* See the CagedMemoryAllocationOutcome enum in backing-store.cc */          \
106   HR(caged_memory_allocation_outcome, V8.CagedMemoryAllocationOutcome, 0, 2,   \
107      3)                                                                        \
108   /* number of times a cache event is triggered for a wasm module */           \
109   HR(wasm_cache_count, V8.WasmCacheCount, 0, 100, 101)                         \
110   SANDBOXED_HISTOGRAM_LIST(HR)
111 
112 #ifdef V8_SANDBOX_IS_AVAILABLE
113 #define SANDBOXED_HISTOGRAM_LIST(HR)                                          \
114   /* Number of in-use external pointers in the external pointer table */      \
115   /* Counted after sweeping the table at the end of mark-compact GC */        \
116   HR(sandboxed_external_pointers_count, V8.SandboxedExternalPointersCount, 0, \
117      kMaxSandboxedExternalPointers, 101)
118 #else
119 #define SANDBOXED_HISTOGRAM_LIST(HR)
120 #endif  // V8_SANDBOX_IS_AVAILABLE
121 
122 #define NESTED_TIMED_HISTOGRAM_LIST(HT)                                       \
123   /* Timer histograms, not thread safe: HT(name, caption, max, unit) */       \
124   /* Garbage collection timers. */                                            \
125   HT(gc_idle_notification, V8.GCIdleNotification, 10000, MILLISECOND)         \
126   HT(gc_incremental_marking, V8.GCIncrementalMarking, 10000, MILLISECOND)     \
127   HT(gc_incremental_marking_start, V8.GCIncrementalMarkingStart, 10000,       \
128      MILLISECOND)                                                             \
129   HT(gc_incremental_marking_finalize, V8.GCIncrementalMarkingFinalize, 10000, \
130      MILLISECOND)                                                             \
131   HT(gc_low_memory_notification, V8.GCLowMemoryNotification, 10000,           \
132      MILLISECOND)                                                             \
133   /* Compilation times. */                                                    \
134   HT(collect_source_positions, V8.CollectSourcePositions, 1000000,            \
135      MICROSECOND)                                                             \
136   HT(compile, V8.CompileMicroSeconds, 1000000, MICROSECOND)                   \
137   HT(compile_eval, V8.CompileEvalMicroSeconds, 1000000, MICROSECOND)          \
138   /* Serialization as part of compilation (code caching) */                   \
139   HT(compile_serialize, V8.CompileSerializeMicroSeconds, 100000, MICROSECOND) \
140   HT(compile_deserialize, V8.CompileDeserializeMicroSeconds, 1000000,         \
141      MICROSECOND)                                                             \
142   /* Total compilation time incl. caching/parsing */                          \
143   HT(compile_script, V8.CompileScriptMicroSeconds, 1000000, MICROSECOND)      \
144   /* Time for lazily compiling Wasm functions. */                             \
145   HT(wasm_lazy_compile_time, V8.WasmLazyCompileTimeMicroSeconds, 100000000,   \
146      MICROSECOND)                                                             \
147   HT(wasm_compile_after_deserialize,                                          \
148      V8.WasmCompileAfterDeserializeMilliSeconds, 1000000, MILLISECOND)
149 
150 #define NESTED_TIMED_HISTOGRAM_LIST_SLOW(HT)                               \
151   /* Total V8 time (including JS and runtime calls, exluding callbacks) */ \
152   HT(execute, V8.ExecuteMicroSeconds, 1000000, MICROSECOND)
153 
154 #define TIMED_HISTOGRAM_LIST(HT)                                               \
155   /* Timer histograms, thread safe: HT(name, caption, max, unit) */            \
156   /* Garbage collection timers. */                                             \
157   HT(gc_compactor, V8.GCCompactor, 10000, MILLISECOND)                         \
158   HT(gc_compactor_background, V8.GCCompactorBackground, 10000, MILLISECOND)    \
159   HT(gc_compactor_foreground, V8.GCCompactorForeground, 10000, MILLISECOND)    \
160   HT(gc_finalize, V8.GCFinalizeMC, 10000, MILLISECOND)                         \
161   HT(gc_finalize_background, V8.GCFinalizeMCBackground, 10000, MILLISECOND)    \
162   HT(gc_finalize_foreground, V8.GCFinalizeMCForeground, 10000, MILLISECOND)    \
163   HT(gc_finalize_measure_memory, V8.GCFinalizeMCMeasureMemory, 10000,          \
164      MILLISECOND)                                                              \
165   HT(gc_finalize_reduce_memory, V8.GCFinalizeMCReduceMemory, 10000,            \
166      MILLISECOND)                                                              \
167   HT(gc_finalize_reduce_memory_background,                                     \
168      V8.GCFinalizeMCReduceMemoryBackground, 10000, MILLISECOND)                \
169   HT(gc_finalize_reduce_memory_foreground,                                     \
170      V8.GCFinalizeMCReduceMemoryForeground, 10000, MILLISECOND)                \
171   HT(measure_memory_delay_ms, V8.MeasureMemoryDelayMilliseconds, 100000,       \
172      MILLISECOND)                                                              \
173   HT(gc_time_to_global_safepoint, V8.GC.TimeToGlobalSafepoint, 10000000,       \
174      MICROSECOND)                                                              \
175   HT(gc_time_to_safepoint, V8.GC.TimeToSafepoint, 10000000, MICROSECOND)       \
176   HT(gc_time_to_collection_on_background, V8.GC.TimeToCollectionOnBackground,  \
177      10000000, MICROSECOND)                                                    \
178   /* TurboFan timers. */                                                       \
179   HT(turbofan_optimize_prepare, V8.TurboFanOptimizePrepare, 1000000,           \
180      MICROSECOND)                                                              \
181   HT(turbofan_optimize_execute, V8.TurboFanOptimizeExecute, 1000000,           \
182      MICROSECOND)                                                              \
183   HT(turbofan_optimize_finalize, V8.TurboFanOptimizeFinalize, 1000000,         \
184      MICROSECOND)                                                              \
185   HT(turbofan_optimize_total_foreground, V8.TurboFanOptimizeTotalForeground,   \
186      10000000, MICROSECOND)                                                    \
187   HT(turbofan_optimize_total_background, V8.TurboFanOptimizeTotalBackground,   \
188      10000000, MICROSECOND)                                                    \
189   HT(turbofan_optimize_total_time, V8.TurboFanOptimizeTotalTime, 10000000,     \
190      MICROSECOND)                                                              \
191   HT(turbofan_optimize_non_concurrent_total_time,                              \
192      V8.TurboFanOptimizeNonConcurrentTotalTime, 10000000, MICROSECOND)         \
193   HT(turbofan_optimize_concurrent_total_time,                                  \
194      V8.TurboFanOptimizeConcurrentTotalTime, 10000000, MICROSECOND)            \
195   HT(turbofan_osr_prepare, V8.TurboFanOptimizeForOnStackReplacementPrepare,    \
196      1000000, MICROSECOND)                                                     \
197   HT(turbofan_osr_execute, V8.TurboFanOptimizeForOnStackReplacementExecute,    \
198      1000000, MICROSECOND)                                                     \
199   HT(turbofan_osr_finalize, V8.TurboFanOptimizeForOnStackReplacementFinalize,  \
200      1000000, MICROSECOND)                                                     \
201   HT(turbofan_osr_total_time,                                                  \
202      V8.TurboFanOptimizeForOnStackReplacementTotalTime, 10000000, MICROSECOND) \
203   /* Wasm timers. */                                                           \
204   HT(wasm_compile_asm_module_time, V8.WasmCompileModuleMicroSeconds.asm,       \
205      10000000, MICROSECOND)                                                    \
206   HT(wasm_compile_wasm_module_time, V8.WasmCompileModuleMicroSeconds.wasm,     \
207      10000000, MICROSECOND)                                                    \
208   HT(wasm_async_compile_wasm_module_time,                                      \
209      V8.WasmCompileModuleAsyncMicroSeconds, 100000000, MICROSECOND)            \
210   HT(wasm_streaming_compile_wasm_module_time,                                  \
211      V8.WasmCompileModuleStreamingMicroSeconds, 100000000, MICROSECOND)        \
212   HT(wasm_streaming_finish_wasm_module_time,                                   \
213      V8.WasmFinishModuleStreamingMicroSeconds, 100000000, MICROSECOND)         \
214   HT(wasm_deserialization_time, V8.WasmDeserializationTimeMilliSeconds, 10000, \
215      MILLISECOND)                                                              \
216   HT(wasm_tier_up_module_time, V8.WasmTierUpModuleMicroSeconds, 100000000,     \
217      MICROSECOND)                                                              \
218   HT(wasm_compile_asm_function_time, V8.WasmCompileFunctionMicroSeconds.asm,   \
219      1000000, MICROSECOND)                                                     \
220   HT(wasm_compile_wasm_function_time, V8.WasmCompileFunctionMicroSeconds.wasm, \
221      1000000, MICROSECOND)                                                     \
222   HT(wasm_compile_huge_function_time, V8.WasmCompileHugeFunctionMilliSeconds,  \
223      100000, MILLISECOND)                                                      \
224   HT(wasm_instantiate_wasm_module_time,                                        \
225      V8.WasmInstantiateModuleMicroSeconds.wasm, 10000000, MICROSECOND)         \
226   HT(wasm_instantiate_asm_module_time,                                         \
227      V8.WasmInstantiateModuleMicroSeconds.asm, 10000000, MICROSECOND)          \
228   HT(wasm_time_between_throws, V8.WasmTimeBetweenThrowsMilliseconds, 1000,     \
229      MILLISECOND)                                                              \
230   HT(wasm_time_between_rethrows, V8.WasmTimeBetweenRethrowsMilliseconds, 1000, \
231      MILLISECOND)                                                              \
232   HT(wasm_time_between_catch, V8.WasmTimeBetweenCatchMilliseconds, 1000,       \
233      MILLISECOND)                                                              \
234   /* Total compilation time incl. caching/parsing for various cache states. */ \
235   HT(compile_script_with_produce_cache,                                        \
236      V8.CompileScriptMicroSeconds.ProduceCache, 1000000, MICROSECOND)          \
237   HT(compile_script_with_isolate_cache_hit,                                    \
238      V8.CompileScriptMicroSeconds.IsolateCacheHit, 1000000, MICROSECOND)       \
239   HT(compile_script_with_consume_cache,                                        \
240      V8.CompileScriptMicroSeconds.ConsumeCache, 1000000, MICROSECOND)          \
241   HT(compile_script_consume_failed,                                            \
242      V8.CompileScriptMicroSeconds.ConsumeCache.Failed, 1000000, MICROSECOND)   \
243   HT(compile_script_no_cache_other,                                            \
244      V8.CompileScriptMicroSeconds.NoCache.Other, 1000000, MICROSECOND)         \
245   HT(compile_script_no_cache_because_inline_script,                            \
246      V8.CompileScriptMicroSeconds.NoCache.InlineScript, 1000000, MICROSECOND)  \
247   HT(compile_script_no_cache_because_script_too_small,                         \
248      V8.CompileScriptMicroSeconds.NoCache.ScriptTooSmall, 1000000,             \
249      MICROSECOND)                                                              \
250   HT(compile_script_no_cache_because_cache_too_cold,                           \
251      V8.CompileScriptMicroSeconds.NoCache.CacheTooCold, 1000000, MICROSECOND)  \
252   HT(compile_script_streaming_finalization,                                    \
253      V8.CompileScriptMicroSeconds.StreamingFinalization, 1000000, MICROSECOND) \
254   HT(compile_script_on_background,                                             \
255      V8.CompileScriptMicroSeconds.BackgroundThread, 1000000, MICROSECOND)      \
256   HT(compile_function_on_background,                                           \
257      V8.CompileFunctionMicroSeconds.BackgroundThread, 1000000, MICROSECOND)
258 
259 #define AGGREGATABLE_HISTOGRAM_TIMER_LIST(AHT) \
260   AHT(compile_lazy, V8.CompileLazyMicroSeconds)
261 
262 #define HISTOGRAM_PERCENTAGE_LIST(HP)                                          \
263   /* Heap fragmentation. */                                                    \
264   HP(external_fragmentation_total, V8.MemoryExternalFragmentationTotal)        \
265   HP(external_fragmentation_old_space, V8.MemoryExternalFragmentationOldSpace) \
266   HP(external_fragmentation_code_space,                                        \
267      V8.MemoryExternalFragmentationCodeSpace)                                  \
268   HP(external_fragmentation_map_space, V8.MemoryExternalFragmentationMapSpace) \
269   HP(external_fragmentation_lo_space, V8.MemoryExternalFragmentationLoSpace)
270 
271 // Note: These use Histogram with options (min=1000, max=500000, buckets=50).
272 #define HISTOGRAM_LEGACY_MEMORY_LIST(HM)                                      \
273   HM(heap_sample_total_committed, V8.MemoryHeapSampleTotalCommitted)          \
274   HM(heap_sample_total_used, V8.MemoryHeapSampleTotalUsed)                    \
275   HM(heap_sample_map_space_committed, V8.MemoryHeapSampleMapSpaceCommitted)   \
276   HM(heap_sample_code_space_committed, V8.MemoryHeapSampleCodeSpaceCommitted) \
277   HM(heap_sample_maximum_committed, V8.MemoryHeapSampleMaximumCommitted)
278 
279 // WARNING: STATS_COUNTER_LIST_* is a very large macro that is causing MSVC
280 // Intellisense to crash.  It was broken into two macros (each of length 40
281 // lines) rather than one macro (of length about 80 lines) to work around
282 // this problem.  Please avoid using recursive macros of this length when
283 // possible.
284 #define STATS_COUNTER_LIST_1(SC)                                   \
285   /* Global Handle Count*/                                         \
286   SC(global_handles, V8.GlobalHandles)                             \
287   SC(maps_normalized, V8.MapsNormalized)                           \
288   SC(maps_created, V8.MapsCreated)                                 \
289   SC(elements_transitions, V8.ObjectElementsTransitions)           \
290   SC(props_to_dictionary, V8.ObjectPropertiesToDictionary)         \
291   SC(elements_to_dictionary, V8.ObjectElementsToDictionary)        \
292   SC(alive_after_last_gc, V8.AliveAfterLastGC)                     \
293   SC(objs_since_last_young, V8.ObjsSinceLastYoung)                 \
294   SC(objs_since_last_full, V8.ObjsSinceLastFull)                   \
295   SC(string_table_capacity, V8.StringTableCapacity)                \
296   SC(number_of_symbols, V8.NumberOfSymbols)                        \
297   SC(inlined_copied_elements, V8.InlinedCopiedElements)            \
298   SC(compilation_cache_hits, V8.CompilationCacheHits)              \
299   SC(compilation_cache_misses, V8.CompilationCacheMisses)          \
300   /* Amount of evaled source code. */                              \
301   SC(total_eval_size, V8.TotalEvalSize)                            \
302   /* Amount of loaded source code. */                              \
303   SC(total_load_size, V8.TotalLoadSize)                            \
304   /* Amount of parsed source code. */                              \
305   SC(total_parse_size, V8.TotalParseSize)                          \
306   /* Amount of source code skipped over using preparsing. */       \
307   SC(total_preparse_skipped, V8.TotalPreparseSkipped)              \
308   /* Amount of compiled source code. */                            \
309   SC(total_compile_size, V8.TotalCompileSize)                      \
310   /* Number of contexts created from scratch. */                   \
311   SC(contexts_created_from_scratch, V8.ContextsCreatedFromScratch) \
312   /* Number of contexts created by context snapshot. */            \
313   SC(contexts_created_by_snapshot, V8.ContextsCreatedBySnapshot)   \
314   /* Number of code objects found from pc. */                      \
315   SC(pc_to_code, V8.PcToCode)                                      \
316   SC(pc_to_code_cached, V8.PcToCodeCached)
317 
318 #define STATS_COUNTER_LIST_2(SC)                                               \
319   /* Amount of (JS) compiled code. */                                          \
320   SC(total_compiled_code_size, V8.TotalCompiledCodeSize)                       \
321   SC(gc_compactor_caused_by_request, V8.GCCompactorCausedByRequest)            \
322   SC(gc_compactor_caused_by_promoted_data, V8.GCCompactorCausedByPromotedData) \
323   SC(gc_compactor_caused_by_oldspace_exhaustion,                               \
324      V8.GCCompactorCausedByOldspaceExhaustion)                                 \
325   SC(gc_last_resort_from_js, V8.GCLastResortFromJS)                            \
326   SC(gc_last_resort_from_handles, V8.GCLastResortFromHandles)                  \
327   SC(cow_arrays_converted, V8.COWArraysConverted)                              \
328   SC(constructed_objects_runtime, V8.ConstructedObjectsRuntime)                \
329   SC(megamorphic_stub_cache_updates, V8.MegamorphicStubCacheUpdates)           \
330   SC(enum_cache_hits, V8.EnumCacheHits)                                        \
331   SC(enum_cache_misses, V8.EnumCacheMisses)                                    \
332   SC(string_add_runtime, V8.StringAddRuntime)                                  \
333   SC(sub_string_runtime, V8.SubStringRuntime)                                  \
334   SC(regexp_entry_runtime, V8.RegExpEntryRuntime)                              \
335   SC(stack_interrupts, V8.StackInterrupts)                                     \
336   SC(new_space_bytes_available, V8.MemoryNewSpaceBytesAvailable)               \
337   SC(new_space_bytes_committed, V8.MemoryNewSpaceBytesCommitted)               \
338   SC(new_space_bytes_used, V8.MemoryNewSpaceBytesUsed)                         \
339   SC(old_space_bytes_available, V8.MemoryOldSpaceBytesAvailable)               \
340   SC(old_space_bytes_committed, V8.MemoryOldSpaceBytesCommitted)               \
341   SC(old_space_bytes_used, V8.MemoryOldSpaceBytesUsed)                         \
342   SC(code_space_bytes_available, V8.MemoryCodeSpaceBytesAvailable)             \
343   SC(code_space_bytes_committed, V8.MemoryCodeSpaceBytesCommitted)             \
344   SC(code_space_bytes_used, V8.MemoryCodeSpaceBytesUsed)                       \
345   SC(map_space_bytes_available, V8.MemoryMapSpaceBytesAvailable)               \
346   SC(map_space_bytes_committed, V8.MemoryMapSpaceBytesCommitted)               \
347   SC(map_space_bytes_used, V8.MemoryMapSpaceBytesUsed)                         \
348   SC(lo_space_bytes_available, V8.MemoryLoSpaceBytesAvailable)                 \
349   SC(lo_space_bytes_committed, V8.MemoryLoSpaceBytesCommitted)                 \
350   SC(lo_space_bytes_used, V8.MemoryLoSpaceBytesUsed)                           \
351   /* Total code size (including metadata) of baseline code or bytecode. */     \
352   SC(total_baseline_code_size, V8.TotalBaselineCodeSize)                       \
353   /* Total count of functions compiled using the baseline compiler. */         \
354   SC(total_baseline_compile_count, V8.TotalBaselineCompileCount)               \
355   SC(wasm_generated_code_size, V8.WasmGeneratedCodeBytes)                      \
356   SC(wasm_reloc_size, V8.WasmRelocBytes)                                       \
357   SC(wasm_lazily_compiled_functions, V8.WasmLazilyCompiledFunctions)
358 
359 // List of counters that can be incremented from generated code. We need them in
360 // a separate list to be able to relocate them.
361 #define STATS_COUNTER_NATIVE_CODE_LIST(SC)                         \
362   /* Number of write barriers executed at runtime. */              \
363   SC(write_barriers, V8.WriteBarriers)                             \
364   SC(constructed_objects, V8.ConstructedObjects)                   \
365   SC(fast_new_closure_total, V8.FastNewClosureTotal)               \
366   SC(regexp_entry_native, V8.RegExpEntryNative)                    \
367   SC(string_add_native, V8.StringAddNative)                        \
368   SC(sub_string_native, V8.SubStringNative)                        \
369   SC(ic_keyed_load_generic_smi, V8.ICKeyedLoadGenericSmi)          \
370   SC(ic_keyed_load_generic_symbol, V8.ICKeyedLoadGenericSymbol)    \
371   SC(ic_keyed_load_generic_slow, V8.ICKeyedLoadGenericSlow)        \
372   SC(megamorphic_stub_cache_probes, V8.MegamorphicStubCacheProbes) \
373   SC(megamorphic_stub_cache_misses, V8.MegamorphicStubCacheMisses)
374 
375 }  // namespace internal
376 }  // namespace v8
377 
378 #endif  // V8_LOGGING_COUNTERS_DEFINITIONS_H_
379