28 #ifndef V8_V8_COUNTERS_H_
29 #define V8_V8_COUNTERS_H_
39 #define HISTOGRAM_TIMER_LIST(HT) \
41 HT(gc_compactor, V8.GCCompactor) \
42 HT(gc_scavenger, V8.GCScavenger) \
43 HT(gc_context, V8.GCContext) \
46 HT(parse_lazy, V8.ParseLazy) \
47 HT(pre_parse, V8.PreParse) \
49 HT(compile, V8.Compile) \
50 HT(compile_eval, V8.CompileEval) \
51 HT(compile_lazy, V8.CompileLazy)
53 #define HISTOGRAM_PERCENTAGE_LIST(HP) \
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) \
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) \
89 HP(codegen_fraction_crankshaft, \
90 V8.CodegenFractionCrankshaft) \
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 HM(heap_sample_maximum_committed, \
105 V8.MemoryHeapSampleMaximumCommitted) \
113 #define STATS_COUNTER_LIST_1(SC) \
115 SC(global_handles, V8.GlobalHandles) \
117 SC(memory_allocated, V8.OsMemoryAllocated) \
118 SC(normalized_maps, V8.NormalizedMaps) \
119 SC(props_to_dictionary, V8.ObjectPropertiesToDictionary) \
120 SC(elements_to_dictionary, V8.ObjectElementsToDictionary) \
121 SC(alive_after_last_gc, V8.AliveAfterLastGC) \
122 SC(objs_since_last_young, V8.ObjsSinceLastYoung) \
123 SC(objs_since_last_full, V8.ObjsSinceLastFull) \
124 SC(string_table_capacity, V8.StringTableCapacity) \
125 SC(number_of_symbols, V8.NumberOfSymbols) \
126 SC(script_wrappers, V8.ScriptWrappers) \
127 SC(call_initialize_stubs, V8.CallInitializeStubs) \
128 SC(call_premonomorphic_stubs, V8.CallPreMonomorphicStubs) \
129 SC(call_normal_stubs, V8.CallNormalStubs) \
130 SC(call_megamorphic_stubs, V8.CallMegamorphicStubs) \
131 SC(arguments_adaptors, V8.ArgumentsAdaptors) \
132 SC(compilation_cache_hits, V8.CompilationCacheHits) \
133 SC(compilation_cache_misses, V8.CompilationCacheMisses) \
134 SC(string_ctor_calls, V8.StringConstructorCalls) \
135 SC(string_ctor_conversions, V8.StringConstructorConversions) \
136 SC(string_ctor_cached_number, V8.StringConstructorCachedNumber) \
137 SC(string_ctor_string_value, V8.StringConstructorStringValue) \
138 SC(string_ctor_gc_required, V8.StringConstructorGCRequired) \
140 SC(total_eval_size, V8.TotalEvalSize) \
142 SC(total_load_size, V8.TotalLoadSize) \
144 SC(total_parse_size, V8.TotalParseSize) \
146 SC(total_preparse_skipped, V8.TotalPreparseSkipped) \
148 SC(total_preparse_symbols_skipped, V8.TotalPreparseSymbolSkipped) \
150 SC(total_compile_size, V8.TotalCompileSize) \
152 SC(total_full_codegen_source_size, V8.TotalFullCodegenSourceSize) \
154 SC(contexts_created_from_scratch, V8.ContextsCreatedFromScratch) \
156 SC(contexts_created_by_snapshot, V8.ContextsCreatedBySnapshot) \
158 SC(pc_to_code, V8.PcToCode) \
159 SC(pc_to_code_cached, V8.PcToCodeCached) \
161 SC(store_buffer_compactions, V8.StoreBufferCompactions) \
162 SC(store_buffer_overflows, V8.StoreBufferOverflows)
165 #define STATS_COUNTER_LIST_2(SC) \
167 SC(code_stubs, V8.CodeStubs) \
169 SC(total_stubs_code_size, V8.TotalStubsCodeSize) \
171 SC(total_compiled_code_size, V8.TotalCompiledCodeSize) \
172 SC(gc_compactor_caused_by_request, V8.GCCompactorCausedByRequest) \
173 SC(gc_compactor_caused_by_promoted_data, \
174 V8.GCCompactorCausedByPromotedData) \
175 SC(gc_compactor_caused_by_oldspace_exhaustion, \
176 V8.GCCompactorCausedByOldspaceExhaustion) \
177 SC(gc_last_resort_from_js, V8.GCLastResortFromJS) \
178 SC(gc_last_resort_from_handles, V8.GCLastResortFromHandles) \
180 SC(keyed_load_generic_smi, V8.KeyedLoadGenericSmi) \
181 SC(keyed_load_generic_symbol, V8.KeyedLoadGenericSymbol) \
182 SC(keyed_load_generic_lookup_cache, V8.KeyedLoadGenericLookupCache) \
183 SC(keyed_load_generic_slow, V8.KeyedLoadGenericSlow) \
184 SC(keyed_load_polymorphic_stubs, V8.KeyedLoadPolymorphicStubs) \
185 SC(keyed_load_external_array_slow, V8.KeyedLoadExternalArraySlow) \
187 SC(keyed_call_generic_smi_fast, V8.KeyedCallGenericSmiFast) \
188 SC(keyed_call_generic_smi_dict, V8.KeyedCallGenericSmiDict) \
189 SC(keyed_call_generic_lookup_cache, V8.KeyedCallGenericLookupCache) \
190 SC(keyed_call_generic_lookup_dict, V8.KeyedCallGenericLookupDict) \
191 SC(keyed_call_generic_slow, V8.KeyedCallGenericSlow) \
192 SC(keyed_call_generic_slow_load, V8.KeyedCallGenericSlowLoad) \
193 SC(named_load_global_stub, V8.NamedLoadGlobalStub) \
194 SC(named_store_global_inline, V8.NamedStoreGlobalInline) \
195 SC(named_store_global_inline_miss, V8.NamedStoreGlobalInlineMiss) \
196 SC(keyed_store_polymorphic_stubs, V8.KeyedStorePolymorphicStubs) \
197 SC(keyed_store_external_array_slow, V8.KeyedStoreExternalArraySlow) \
198 SC(store_normal_miss, V8.StoreNormalMiss) \
199 SC(store_normal_hit, V8.StoreNormalHit) \
200 SC(cow_arrays_created_stub, V8.COWArraysCreatedStub) \
201 SC(cow_arrays_created_runtime, V8.COWArraysCreatedRuntime) \
202 SC(cow_arrays_converted, V8.COWArraysConverted) \
203 SC(call_miss, V8.CallMiss) \
204 SC(keyed_call_miss, V8.KeyedCallMiss) \
205 SC(load_miss, V8.LoadMiss) \
206 SC(keyed_load_miss, V8.KeyedLoadMiss) \
207 SC(call_const, V8.CallConst) \
208 SC(call_const_fast_api, V8.CallConstFastApi) \
209 SC(call_const_interceptor, V8.CallConstInterceptor) \
210 SC(call_const_interceptor_fast_api, V8.CallConstInterceptorFastApi) \
211 SC(call_global_inline, V8.CallGlobalInline) \
212 SC(call_global_inline_miss, V8.CallGlobalInlineMiss) \
213 SC(constructed_objects, V8.ConstructedObjects) \
214 SC(constructed_objects_runtime, V8.ConstructedObjectsRuntime) \
215 SC(negative_lookups, V8.NegativeLookups) \
216 SC(negative_lookups_miss, V8.NegativeLookupsMiss) \
217 SC(megamorphic_stub_cache_probes, V8.MegamorphicStubCacheProbes) \
218 SC(megamorphic_stub_cache_misses, V8.MegamorphicStubCacheMisses) \
219 SC(megamorphic_stub_cache_updates, V8.MegamorphicStubCacheUpdates) \
220 SC(array_function_runtime, V8.ArrayFunctionRuntime) \
221 SC(array_function_native, V8.ArrayFunctionNative) \
222 SC(for_in, V8.ForIn) \
223 SC(enum_cache_hits, V8.EnumCacheHits) \
224 SC(enum_cache_misses, V8.EnumCacheMisses) \
225 SC(zone_segment_bytes, V8.ZoneSegmentBytes) \
226 SC(fast_new_closure_total, V8.FastNewClosureTotal) \
227 SC(fast_new_closure_try_optimized, V8.FastNewClosureTryOptimized) \
228 SC(fast_new_closure_install_optimized, V8.FastNewClosureInstallOptimized) \
229 SC(string_add_runtime, V8.StringAddRuntime) \
230 SC(string_add_native, V8.StringAddNative) \
231 SC(string_add_runtime_ext_to_ascii, V8.StringAddRuntimeExtToAscii) \
232 SC(sub_string_runtime, V8.SubStringRuntime) \
233 SC(sub_string_native, V8.SubStringNative) \
234 SC(string_add_make_two_char, V8.StringAddMakeTwoChar) \
235 SC(string_compare_native, V8.StringCompareNative) \
236 SC(string_compare_runtime, V8.StringCompareRuntime) \
237 SC(regexp_entry_runtime, V8.RegExpEntryRuntime) \
238 SC(regexp_entry_native, V8.RegExpEntryNative) \
239 SC(number_to_string_native, V8.NumberToStringNative) \
240 SC(number_to_string_runtime, V8.NumberToStringRuntime) \
241 SC(math_acos, V8.MathAcos) \
242 SC(math_asin, V8.MathAsin) \
243 SC(math_atan, V8.MathAtan) \
244 SC(math_atan2, V8.MathAtan2) \
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_sqrt, V8.MathSqrt) \
251 SC(stack_interrupts, V8.StackInterrupts) \
252 SC(runtime_profiler_ticks, V8.RuntimeProfilerTicks) \
253 SC(bounds_checks_eliminated, V8.BoundsChecksEliminated) \
254 SC(bounds_checks_hoisted, V8.BoundsChecksHoisted) \
255 SC(soft_deopts_requested, V8.SoftDeoptsRequested) \
256 SC(soft_deopts_inserted, V8.SoftDeoptsInserted) \
257 SC(soft_deopts_executed, V8.SoftDeoptsExecuted) \
259 SC(write_barriers_dynamic, V8.WriteBarriersDynamic) \
260 SC(write_barriers_static, V8.WriteBarriersStatic) \
261 SC(new_space_bytes_available, V8.MemoryNewSpaceBytesAvailable) \
262 SC(new_space_bytes_committed, V8.MemoryNewSpaceBytesCommitted) \
263 SC(new_space_bytes_used, V8.MemoryNewSpaceBytesUsed) \
264 SC(old_pointer_space_bytes_available, \
265 V8.MemoryOldPointerSpaceBytesAvailable) \
266 SC(old_pointer_space_bytes_committed, \
267 V8.MemoryOldPointerSpaceBytesCommitted) \
268 SC(old_pointer_space_bytes_used, V8.MemoryOldPointerSpaceBytesUsed) \
269 SC(old_data_space_bytes_available, V8.MemoryOldDataSpaceBytesAvailable) \
270 SC(old_data_space_bytes_committed, V8.MemoryOldDataSpaceBytesCommitted) \
271 SC(old_data_space_bytes_used, V8.MemoryOldDataSpaceBytesUsed) \
272 SC(code_space_bytes_available, V8.MemoryCodeSpaceBytesAvailable) \
273 SC(code_space_bytes_committed, V8.MemoryCodeSpaceBytesCommitted) \
274 SC(code_space_bytes_used, V8.MemoryCodeSpaceBytesUsed) \
275 SC(map_space_bytes_available, V8.MemoryMapSpaceBytesAvailable) \
276 SC(map_space_bytes_committed, V8.MemoryMapSpaceBytesCommitted) \
277 SC(map_space_bytes_used, V8.MemoryMapSpaceBytesUsed) \
278 SC(cell_space_bytes_available, V8.MemoryCellSpaceBytesAvailable) \
279 SC(cell_space_bytes_committed, V8.MemoryCellSpaceBytesCommitted) \
280 SC(cell_space_bytes_used, V8.MemoryCellSpaceBytesUsed) \
281 SC(property_cell_space_bytes_available, \
282 V8.MemoryPropertyCellSpaceBytesAvailable) \
283 SC(property_cell_space_bytes_committed, \
284 V8.MemoryPropertyCellSpaceBytesCommitted) \
285 SC(property_cell_space_bytes_used, \
286 V8.MemoryPropertyCellSpaceBytesUsed) \
287 SC(lo_space_bytes_available, V8.MemoryLoSpaceBytesAvailable) \
288 SC(lo_space_bytes_committed, V8.MemoryLoSpaceBytesCommitted) \
289 SC(lo_space_bytes_used, V8.MemoryLoSpaceBytesUsed)
295 #define HT(name, caption) \
296 HistogramTimer* name() { return &name##_; }
300 #define HP(name, caption) \
301 Histogram* name() { return &name##_; }
305 #define HM(name, caption) \
306 Histogram* name() { return &name##_; }
310 #define SC(name, caption) \
311 StatsCounter* name() { return &name##_; }
317 StatsCounter* count_of_##name() { return &count_of_##name##_; } \
318 StatsCounter* size_of_##name() { return &size_of_##name##_; }
323 StatsCounter* count_of_CODE_TYPE_##name() \
324 { return &count_of_CODE_TYPE_##name##_; } \
325 StatsCounter* size_of_CODE_TYPE_##name() \
326 { return &size_of_CODE_TYPE_##name##_; }
331 StatsCounter* count_of_FIXED_ARRAY_##name() \
332 { return &count_of_FIXED_ARRAY_##name##_; } \
333 StatsCounter* size_of_FIXED_ARRAY_##name() \
334 { return &size_of_FIXED_ARRAY_##name##_; }
339 StatsCounter* count_of_CODE_AGE_##name() \
340 { return &count_of_CODE_AGE_##name##_; } \
341 StatsCounter* size_of_CODE_AGE_##name() \
342 { return &size_of_CODE_AGE_##name##_; }
347 #define RATE_ID(name, caption) k_##name,
350 #define PERCENTAGE_ID(name, caption) k_##name,
353 #define MEMORY_ID(name, caption) k_##name,
356 #define COUNTER_ID(name, caption) k_##name,
360 #define COUNTER_ID(name) kCountOf##name, kSizeOf##name,
363 #define COUNTER_ID(name) kCountOfCODE_TYPE_##name, \
364 kSizeOfCODE_TYPE_##name,
367 #define COUNTER_ID(name) kCountOfFIXED_ARRAY__##name, \
368 kSizeOfFIXED_ARRAY__##name,
371 #define COUNTER_ID(name) kCountOfCODE_AGE__##name, \
372 kSizeOfCODE_AGE__##name,
381 #define HT(name, caption) \
382 HistogramTimer name##_;
386 #define HP(name, caption) \
391 #define HM(name, caption) \
396 #define SC(name, caption) \
397 StatsCounter name##_;
403 StatsCounter size_of_##name##_; \
404 StatsCounter count_of_##name##_;
409 StatsCounter size_of_CODE_TYPE_##name##_; \
410 StatsCounter count_of_CODE_TYPE_##name##_;
415 StatsCounter size_of_FIXED_ARRAY_##name##_; \
416 StatsCounter count_of_FIXED_ARRAY_##name##_;
421 StatsCounter size_of_CODE_AGE_##name##_; \
422 StatsCounter count_of_CODE_AGE_##name##_;
435 #endif // V8_V8_COUNTERS_H_
#define HT(name, caption)
#define SC(name, caption)
#define CODE_AGE_LIST_COMPLETE(V)
#define PERCENTAGE_ID(name, caption)
#define INSTANCE_TYPE_LIST(V)
#define MEMORY_ID(name, caption)
#define STATS_COUNTER_LIST_2(SC)
#define HISTOGRAM_MEMORY_LIST(HM)
#define HISTOGRAM_PERCENTAGE_LIST(HP)
#define DISALLOW_IMPLICIT_CONSTRUCTORS(TypeName)
#define HP(name, caption)
#define FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(V)
#define CODE_KIND_LIST(V)
#define HM(name, caption)
#define HISTOGRAM_TIMER_LIST(HT)
#define RATE_ID(name, caption)
#define STATS_COUNTER_LIST_1(SC)
#define COUNTER_ID(name, caption)