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)
54 #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_lo_space, \
68 V8.MemoryExternalFragmentationLoSpace) \
69 HP(heap_fraction_map_space, \
70 V8.MemoryHeapFractionMapSpace) \
71 HP(heap_fraction_cell_space, \
72 V8.MemoryHeapFractionCellSpace) \
75 #define HISTOGRAM_MEMORY_LIST(HM) \
76 HM(heap_sample_total_committed, V8.MemoryHeapSampleTotalCommitted) \
77 HM(heap_sample_total_used, V8.MemoryHeapSampleTotalUsed) \
78 HM(heap_sample_map_space_committed, \
79 V8.MemoryHeapSampleMapSpaceCommitted) \
80 HM(heap_sample_cell_space_committed, \
81 V8.MemoryHeapSampleCellSpaceCommitted)
89 #define STATS_COUNTER_LIST_1(SC) \
91 SC(global_handles, V8.GlobalHandles) \
93 SC(pcre_mallocs, V8.PcreMallocCount) \
95 SC(memory_allocated, V8.OsMemoryAllocated) \
96 SC(normalized_maps, V8.NormalizedMaps) \
97 SC(props_to_dictionary, V8.ObjectPropertiesToDictionary) \
98 SC(elements_to_dictionary, V8.ObjectElementsToDictionary) \
99 SC(alive_after_last_gc, V8.AliveAfterLastGC) \
100 SC(objs_since_last_young, V8.ObjsSinceLastYoung) \
101 SC(objs_since_last_full, V8.ObjsSinceLastFull) \
102 SC(symbol_table_capacity, V8.SymbolTableCapacity) \
103 SC(number_of_symbols, V8.NumberOfSymbols) \
104 SC(script_wrappers, V8.ScriptWrappers) \
105 SC(call_initialize_stubs, V8.CallInitializeStubs) \
106 SC(call_premonomorphic_stubs, V8.CallPreMonomorphicStubs) \
107 SC(call_normal_stubs, V8.CallNormalStubs) \
108 SC(call_megamorphic_stubs, V8.CallMegamorphicStubs) \
109 SC(arguments_adaptors, V8.ArgumentsAdaptors) \
110 SC(compilation_cache_hits, V8.CompilationCacheHits) \
111 SC(compilation_cache_misses, V8.CompilationCacheMisses) \
112 SC(regexp_cache_hits, V8.RegExpCacheHits) \
113 SC(regexp_cache_misses, V8.RegExpCacheMisses) \
114 SC(string_ctor_calls, V8.StringConstructorCalls) \
115 SC(string_ctor_conversions, V8.StringConstructorConversions) \
116 SC(string_ctor_cached_number, V8.StringConstructorCachedNumber) \
117 SC(string_ctor_string_value, V8.StringConstructorStringValue) \
118 SC(string_ctor_gc_required, V8.StringConstructorGCRequired) \
120 SC(total_eval_size, V8.TotalEvalSize) \
122 SC(total_load_size, V8.TotalLoadSize) \
124 SC(total_parse_size, V8.TotalParseSize) \
126 SC(total_preparse_skipped, V8.TotalPreparseSkipped) \
128 SC(total_preparse_symbols_skipped, V8.TotalPreparseSymbolSkipped) \
130 SC(total_compile_size, V8.TotalCompileSize) \
132 SC(total_old_codegen_source_size, V8.TotalOldCodegenSourceSize) \
134 SC(total_full_codegen_source_size, V8.TotalFullCodegenSourceSize) \
136 SC(contexts_created_from_scratch, V8.ContextsCreatedFromScratch) \
138 SC(contexts_created_by_snapshot, V8.ContextsCreatedBySnapshot) \
140 SC(pc_to_code, V8.PcToCode) \
141 SC(pc_to_code_cached, V8.PcToCodeCached) \
143 SC(store_buffer_compactions, V8.StoreBufferCompactions) \
144 SC(store_buffer_overflows, V8.StoreBufferOverflows)
147 #define STATS_COUNTER_LIST_2(SC) \
149 SC(code_stubs, V8.CodeStubs) \
151 SC(total_stubs_code_size, V8.TotalStubsCodeSize) \
153 SC(total_compiled_code_size, V8.TotalCompiledCodeSize) \
154 SC(gc_compactor_caused_by_request, V8.GCCompactorCausedByRequest) \
155 SC(gc_compactor_caused_by_promoted_data, \
156 V8.GCCompactorCausedByPromotedData) \
157 SC(gc_compactor_caused_by_oldspace_exhaustion, \
158 V8.GCCompactorCausedByOldspaceExhaustion) \
159 SC(gc_compactor_caused_by_weak_handles, \
160 V8.GCCompactorCausedByWeakHandles) \
161 SC(gc_last_resort_from_js, V8.GCLastResortFromJS) \
162 SC(gc_last_resort_from_handles, V8.GCLastResortFromHandles) \
164 SC(keyed_load_generic_smi, V8.KeyedLoadGenericSmi) \
165 SC(keyed_load_generic_symbol, V8.KeyedLoadGenericSymbol) \
166 SC(keyed_load_generic_lookup_cache, V8.KeyedLoadGenericLookupCache) \
167 SC(keyed_load_generic_slow, V8.KeyedLoadGenericSlow) \
168 SC(keyed_load_polymorphic_stubs, V8.KeyedLoadPolymorphicStubs) \
169 SC(keyed_load_external_array_slow, V8.KeyedLoadExternalArraySlow) \
171 SC(keyed_call_generic_smi_fast, V8.KeyedCallGenericSmiFast) \
172 SC(keyed_call_generic_smi_dict, V8.KeyedCallGenericSmiDict) \
173 SC(keyed_call_generic_lookup_cache, V8.KeyedCallGenericLookupCache) \
174 SC(keyed_call_generic_lookup_dict, V8.KeyedCallGenericLookupDict) \
175 SC(keyed_call_generic_value_type, V8.KeyedCallGenericValueType) \
176 SC(keyed_call_generic_slow, V8.KeyedCallGenericSlow) \
177 SC(keyed_call_generic_slow_load, V8.KeyedCallGenericSlowLoad) \
179 SC(keyed_load_function_prototype, V8.KeyedLoadFunctionPrototype) \
180 SC(keyed_load_string_length, V8.KeyedLoadStringLength) \
181 SC(keyed_load_array_length, V8.KeyedLoadArrayLength) \
182 SC(keyed_load_constant_function, V8.KeyedLoadConstantFunction) \
183 SC(keyed_load_field, V8.KeyedLoadField) \
184 SC(keyed_load_callback, V8.KeyedLoadCallback) \
185 SC(keyed_load_interceptor, V8.KeyedLoadInterceptor) \
186 SC(keyed_load_inline, V8.KeyedLoadInline) \
187 SC(keyed_load_inline_miss, V8.KeyedLoadInlineMiss) \
188 SC(named_load_inline, V8.NamedLoadInline) \
189 SC(named_load_inline_miss, V8.NamedLoadInlineMiss) \
190 SC(named_load_global_inline, V8.NamedLoadGlobalInline) \
191 SC(named_load_global_inline_miss, V8.NamedLoadGlobalInlineMiss) \
192 SC(dont_delete_hint_hit, V8.DontDeleteHintHit) \
193 SC(dont_delete_hint_miss, V8.DontDeleteHintMiss) \
194 SC(named_load_global_stub, V8.NamedLoadGlobalStub) \
195 SC(named_load_global_stub_miss, V8.NamedLoadGlobalStubMiss) \
196 SC(keyed_store_field, V8.KeyedStoreField) \
197 SC(named_store_inline_field, V8.NamedStoreInlineField) \
198 SC(keyed_store_inline, V8.KeyedStoreInline) \
199 SC(named_load_inline_generic, V8.NamedLoadInlineGeneric) \
200 SC(named_load_inline_field, V8.NamedLoadInlineFast) \
201 SC(keyed_load_inline_generic, V8.KeyedLoadInlineGeneric) \
202 SC(keyed_load_inline_fast, V8.KeyedLoadInlineFast) \
203 SC(keyed_store_inline_generic, V8.KeyedStoreInlineGeneric) \
204 SC(keyed_store_inline_fast, V8.KeyedStoreInlineFast) \
205 SC(named_store_inline_generic, V8.NamedStoreInlineGeneric) \
206 SC(named_store_inline_fast, V8.NamedStoreInlineFast) \
207 SC(keyed_store_inline_miss, V8.KeyedStoreInlineMiss) \
208 SC(named_store_global_inline, V8.NamedStoreGlobalInline) \
209 SC(named_store_global_inline_miss, V8.NamedStoreGlobalInlineMiss) \
210 SC(keyed_store_polymorphic_stubs, V8.KeyedStorePolymorphicStubs) \
211 SC(keyed_store_external_array_slow, V8.KeyedStoreExternalArraySlow) \
212 SC(store_normal_miss, V8.StoreNormalMiss) \
213 SC(store_normal_hit, V8.StoreNormalHit) \
214 SC(cow_arrays_created_stub, V8.COWArraysCreatedStub) \
215 SC(cow_arrays_created_runtime, V8.COWArraysCreatedRuntime) \
216 SC(cow_arrays_converted, V8.COWArraysConverted) \
217 SC(call_miss, V8.CallMiss) \
218 SC(keyed_call_miss, V8.KeyedCallMiss) \
219 SC(load_miss, V8.LoadMiss) \
220 SC(keyed_load_miss, V8.KeyedLoadMiss) \
221 SC(call_const, V8.CallConst) \
222 SC(call_const_fast_api, V8.CallConstFastApi) \
223 SC(call_const_interceptor, V8.CallConstInterceptor) \
224 SC(call_const_interceptor_fast_api, V8.CallConstInterceptorFastApi) \
225 SC(call_global_inline, V8.CallGlobalInline) \
226 SC(call_global_inline_miss, V8.CallGlobalInlineMiss) \
227 SC(constructed_objects, V8.ConstructedObjects) \
228 SC(constructed_objects_runtime, V8.ConstructedObjectsRuntime) \
229 SC(constructed_objects_stub, V8.ConstructedObjectsStub) \
230 SC(negative_lookups, V8.NegativeLookups) \
231 SC(negative_lookups_miss, V8.NegativeLookupsMiss) \
232 SC(megamorphic_stub_cache_probes, V8.MegamorphicStubCacheProbes) \
233 SC(megamorphic_stub_cache_misses, V8.MegamorphicStubCacheMisses) \
234 SC(megamorphic_stub_cache_updates, V8.MegamorphicStubCacheUpdates) \
235 SC(array_function_runtime, V8.ArrayFunctionRuntime) \
236 SC(array_function_native, V8.ArrayFunctionNative) \
237 SC(for_in, V8.ForIn) \
238 SC(enum_cache_hits, V8.EnumCacheHits) \
239 SC(enum_cache_misses, V8.EnumCacheMisses) \
240 SC(zone_segment_bytes, V8.ZoneSegmentBytes) \
241 SC(compute_entry_frame, V8.ComputeEntryFrame) \
242 SC(generic_binary_stub_calls, V8.GenericBinaryStubCalls) \
243 SC(generic_binary_stub_calls_regs, V8.GenericBinaryStubCallsRegs) \
244 SC(fast_new_closure_total, V8.FastNewClosureTotal) \
245 SC(fast_new_closure_try_optimized, V8.FastNewClosureTryOptimized) \
246 SC(fast_new_closure_install_optimized, V8.FastNewClosureInstallOptimized) \
247 SC(string_add_runtime, V8.StringAddRuntime) \
248 SC(string_add_native, V8.StringAddNative) \
249 SC(string_add_runtime_ext_to_ascii, V8.StringAddRuntimeExtToAscii) \
250 SC(sub_string_runtime, V8.SubStringRuntime) \
251 SC(sub_string_native, V8.SubStringNative) \
252 SC(string_add_make_two_char, V8.StringAddMakeTwoChar) \
253 SC(string_compare_native, V8.StringCompareNative) \
254 SC(string_compare_runtime, V8.StringCompareRuntime) \
255 SC(regexp_entry_runtime, V8.RegExpEntryRuntime) \
256 SC(regexp_entry_native, V8.RegExpEntryNative) \
257 SC(number_to_string_native, V8.NumberToStringNative) \
258 SC(number_to_string_runtime, V8.NumberToStringRuntime) \
259 SC(math_acos, V8.MathAcos) \
260 SC(math_asin, V8.MathAsin) \
261 SC(math_atan, V8.MathAtan) \
262 SC(math_atan2, V8.MathAtan2) \
263 SC(math_ceil, V8.MathCeil) \
264 SC(math_cos, V8.MathCos) \
265 SC(math_exp, V8.MathExp) \
266 SC(math_floor, V8.MathFloor) \
267 SC(math_log, V8.MathLog) \
268 SC(math_pow, V8.MathPow) \
269 SC(math_round, V8.MathRound) \
270 SC(math_sin, V8.MathSin) \
271 SC(math_sqrt, V8.MathSqrt) \
272 SC(math_tan, V8.MathTan) \
273 SC(transcendental_cache_hit, V8.TranscendentalCacheHit) \
274 SC(transcendental_cache_miss, V8.TranscendentalCacheMiss) \
275 SC(stack_interrupts, V8.StackInterrupts) \
276 SC(runtime_profiler_ticks, V8.RuntimeProfilerTicks) \
277 SC(smi_checks_removed, V8.SmiChecksRemoved) \
278 SC(map_checks_removed, V8.MapChecksRemoved) \
279 SC(quote_json_char_count, V8.QuoteJsonCharacterCount) \
280 SC(quote_json_char_recount, V8.QuoteJsonCharacterReCount) \
281 SC(new_space_bytes_available, V8.MemoryNewSpaceBytesAvailable) \
282 SC(new_space_bytes_committed, V8.MemoryNewSpaceBytesCommitted) \
283 SC(new_space_bytes_used, V8.MemoryNewSpaceBytesUsed) \
284 SC(old_pointer_space_bytes_available, \
285 V8.MemoryOldPointerSpaceBytesAvailable) \
286 SC(old_pointer_space_bytes_committed, \
287 V8.MemoryOldPointerSpaceBytesCommitted) \
288 SC(old_pointer_space_bytes_used, V8.MemoryOldPointerSpaceBytesUsed) \
289 SC(old_data_space_bytes_available, V8.MemoryOldDataSpaceBytesAvailable) \
290 SC(old_data_space_bytes_committed, V8.MemoryOldDataSpaceBytesCommitted) \
291 SC(old_data_space_bytes_used, V8.MemoryOldDataSpaceBytesUsed) \
292 SC(code_space_bytes_available, V8.MemoryCodeSpaceBytesAvailable) \
293 SC(code_space_bytes_committed, V8.MemoryCodeSpaceBytesCommitted) \
294 SC(code_space_bytes_used, V8.MemoryCodeSpaceBytesUsed) \
295 SC(map_space_bytes_available, V8.MemoryMapSpaceBytesAvailable) \
296 SC(map_space_bytes_committed, V8.MemoryMapSpaceBytesCommitted) \
297 SC(map_space_bytes_used, V8.MemoryMapSpaceBytesUsed) \
298 SC(cell_space_bytes_available, V8.MemoryCellSpaceBytesAvailable) \
299 SC(cell_space_bytes_committed, V8.MemoryCellSpaceBytesCommitted) \
300 SC(cell_space_bytes_used, V8.MemoryCellSpaceBytesUsed) \
301 SC(lo_space_bytes_available, V8.MemoryLoSpaceBytesAvailable) \
302 SC(lo_space_bytes_committed, V8.MemoryLoSpaceBytesCommitted) \
303 SC(lo_space_bytes_used, V8.MemoryLoSpaceBytesUsed)
309 #define HT(name, caption) \
310 HistogramTimer* name() { return &name##_; }
314 #define HP(name, caption) \
315 Histogram* name() { return &name##_; }
319 #define HM(name, caption) \
320 Histogram* name() { return &name##_; }
324 #define SC(name, caption) \
325 StatsCounter* name() { return &name##_; }
331 StatsCounter* count_of_##name() { return &count_of_##name##_; } \
332 StatsCounter* size_of_##name() { return &size_of_##name##_; }
337 StatsCounter* count_of_CODE_TYPE_##name() \
338 { return &count_of_CODE_TYPE_##name##_; } \
339 StatsCounter* size_of_CODE_TYPE_##name() \
340 { return &size_of_CODE_TYPE_##name##_; }
345 StatsCounter* count_of_FIXED_ARRAY_##name() \
346 { return &count_of_FIXED_ARRAY_##name##_; } \
347 StatsCounter* size_of_FIXED_ARRAY_##name() \
348 { return &size_of_FIXED_ARRAY_##name##_; }
353 #define RATE_ID(name, caption) k_##name,
356 #define PERCENTAGE_ID(name, caption) k_##name,
359 #define MEMORY_ID(name, caption) k_##name,
362 #define COUNTER_ID(name, caption) k_##name,
366 #define COUNTER_ID(name) kCountOf##name, kSizeOf##name,
369 #define COUNTER_ID(name) kCountOfCODE_TYPE_##name, \
370 kSizeOfCODE_TYPE_##name,
373 #define COUNTER_ID(name) kCountOfFIXED_ARRAY__##name, \
374 kSizeOfFIXED_ARRAY__##name,
377 #define COUNTER_ID(name) k_##name,
384 return &state_counters_[state];
390 #define HT(name, caption) \
391 HistogramTimer name##_;
395 #define HP(name, caption) \
400 #define HM(name, caption) \
405 #define SC(name, caption) \
406 StatsCounter name##_;
412 StatsCounter size_of_##name##_; \
413 StatsCounter count_of_##name##_;
418 StatsCounter size_of_CODE_TYPE_##name##_; \
419 StatsCounter count_of_CODE_TYPE_##name##_;
424 StatsCounter size_of_FIXED_ARRAY_##name##_; \
425 StatsCounter count_of_FIXED_ARRAY_##name##_;
430 #define COUNTER_ID(name) __##name,
433 kSlidingStateWindowCounterCount
437 StatsCounter state_counters_[kSlidingStateWindowCounterCount];
445 #endif // V8_V8_COUNTERS_H_
#define HT(name, caption)
#define SC(name, caption)
#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)
StatsCounter * state_counters(StateTag state)
#define STATE_TAG_LIST(V)
#define COUNTER_ID(name, caption)