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