28 #ifndef V8_V8_COUNTERS_H_
29 #define V8_V8_COUNTERS_H_
38 #define HISTOGRAM_TIMER_LIST(HT) \
40 HT(gc_compactor, V8.GCCompactor) \
41 HT(gc_scavenger, V8.GCScavenger) \
42 HT(gc_context, V8.GCContext) \
45 HT(parse_lazy, V8.ParseLazy) \
46 HT(pre_parse, V8.PreParse) \
48 HT(compile, V8.Compile) \
49 HT(compile_eval, V8.CompileEval) \
50 HT(compile_lazy, V8.CompileLazy)
58 #define STATS_COUNTER_LIST_1(SC) \
60 SC(global_handles, V8.GlobalHandles) \
62 SC(pcre_mallocs, V8.PcreMallocCount) \
64 SC(memory_allocated, V8.OsMemoryAllocated) \
65 SC(normalized_maps, V8.NormalizedMaps) \
66 SC(props_to_dictionary, V8.ObjectPropertiesToDictionary) \
67 SC(elements_to_dictionary, V8.ObjectElementsToDictionary) \
68 SC(alive_after_last_gc, V8.AliveAfterLastGC) \
69 SC(objs_since_last_young, V8.ObjsSinceLastYoung) \
70 SC(objs_since_last_full, V8.ObjsSinceLastFull) \
71 SC(symbol_table_capacity, V8.SymbolTableCapacity) \
72 SC(number_of_symbols, V8.NumberOfSymbols) \
73 SC(script_wrappers, V8.ScriptWrappers) \
74 SC(call_initialize_stubs, V8.CallInitializeStubs) \
75 SC(call_premonomorphic_stubs, V8.CallPreMonomorphicStubs) \
76 SC(call_normal_stubs, V8.CallNormalStubs) \
77 SC(call_megamorphic_stubs, V8.CallMegamorphicStubs) \
78 SC(arguments_adaptors, V8.ArgumentsAdaptors) \
79 SC(compilation_cache_hits, V8.CompilationCacheHits) \
80 SC(compilation_cache_misses, V8.CompilationCacheMisses) \
81 SC(regexp_cache_hits, V8.RegExpCacheHits) \
82 SC(regexp_cache_misses, V8.RegExpCacheMisses) \
83 SC(string_ctor_calls, V8.StringConstructorCalls) \
84 SC(string_ctor_conversions, V8.StringConstructorConversions) \
85 SC(string_ctor_cached_number, V8.StringConstructorCachedNumber) \
86 SC(string_ctor_string_value, V8.StringConstructorStringValue) \
87 SC(string_ctor_gc_required, V8.StringConstructorGCRequired) \
89 SC(total_eval_size, V8.TotalEvalSize) \
91 SC(total_load_size, V8.TotalLoadSize) \
93 SC(total_parse_size, V8.TotalParseSize) \
95 SC(total_preparse_skipped, V8.TotalPreparseSkipped) \
97 SC(total_preparse_symbols_skipped, V8.TotalPreparseSymbolSkipped) \
99 SC(total_compile_size, V8.TotalCompileSize) \
101 SC(total_old_codegen_source_size, V8.TotalOldCodegenSourceSize) \
103 SC(total_full_codegen_source_size, V8.TotalFullCodegenSourceSize) \
105 SC(contexts_created_from_scratch, V8.ContextsCreatedFromScratch) \
107 SC(contexts_created_by_snapshot, V8.ContextsCreatedBySnapshot) \
109 SC(pc_to_code, V8.PcToCode) \
110 SC(pc_to_code_cached, V8.PcToCodeCached) \
112 SC(store_buffer_compactions, V8.StoreBufferCompactions) \
113 SC(store_buffer_overflows, V8.StoreBufferOverflows)
116 #define STATS_COUNTER_LIST_2(SC) \
118 SC(code_stubs, V8.CodeStubs) \
120 SC(total_stubs_code_size, V8.TotalStubsCodeSize) \
122 SC(total_compiled_code_size, V8.TotalCompiledCodeSize) \
123 SC(gc_compactor_caused_by_request, V8.GCCompactorCausedByRequest) \
124 SC(gc_compactor_caused_by_promoted_data, \
125 V8.GCCompactorCausedByPromotedData) \
126 SC(gc_compactor_caused_by_oldspace_exhaustion, \
127 V8.GCCompactorCausedByOldspaceExhaustion) \
128 SC(gc_compactor_caused_by_weak_handles, \
129 V8.GCCompactorCausedByWeakHandles) \
130 SC(gc_last_resort_from_js, V8.GCLastResortFromJS) \
131 SC(gc_last_resort_from_handles, V8.GCLastResortFromHandles) \
133 SC(keyed_load_generic_smi, V8.KeyedLoadGenericSmi) \
134 SC(keyed_load_generic_symbol, V8.KeyedLoadGenericSymbol) \
135 SC(keyed_load_generic_lookup_cache, V8.KeyedLoadGenericLookupCache) \
136 SC(keyed_load_generic_slow, V8.KeyedLoadGenericSlow) \
137 SC(keyed_load_polymorphic_stubs, V8.KeyedLoadPolymorphicStubs) \
138 SC(keyed_load_external_array_slow, V8.KeyedLoadExternalArraySlow) \
140 SC(keyed_call_generic_smi_fast, V8.KeyedCallGenericSmiFast) \
141 SC(keyed_call_generic_smi_dict, V8.KeyedCallGenericSmiDict) \
142 SC(keyed_call_generic_lookup_cache, V8.KeyedCallGenericLookupCache) \
143 SC(keyed_call_generic_lookup_dict, V8.KeyedCallGenericLookupDict) \
144 SC(keyed_call_generic_value_type, V8.KeyedCallGenericValueType) \
145 SC(keyed_call_generic_slow, V8.KeyedCallGenericSlow) \
146 SC(keyed_call_generic_slow_load, V8.KeyedCallGenericSlowLoad) \
148 SC(keyed_load_function_prototype, V8.KeyedLoadFunctionPrototype) \
149 SC(keyed_load_string_length, V8.KeyedLoadStringLength) \
150 SC(keyed_load_array_length, V8.KeyedLoadArrayLength) \
151 SC(keyed_load_constant_function, V8.KeyedLoadConstantFunction) \
152 SC(keyed_load_field, V8.KeyedLoadField) \
153 SC(keyed_load_callback, V8.KeyedLoadCallback) \
154 SC(keyed_load_interceptor, V8.KeyedLoadInterceptor) \
155 SC(keyed_load_inline, V8.KeyedLoadInline) \
156 SC(keyed_load_inline_miss, V8.KeyedLoadInlineMiss) \
157 SC(named_load_inline, V8.NamedLoadInline) \
158 SC(named_load_inline_miss, V8.NamedLoadInlineMiss) \
159 SC(named_load_global_inline, V8.NamedLoadGlobalInline) \
160 SC(named_load_global_inline_miss, V8.NamedLoadGlobalInlineMiss) \
161 SC(dont_delete_hint_hit, V8.DontDeleteHintHit) \
162 SC(dont_delete_hint_miss, V8.DontDeleteHintMiss) \
163 SC(named_load_global_stub, V8.NamedLoadGlobalStub) \
164 SC(named_load_global_stub_miss, V8.NamedLoadGlobalStubMiss) \
165 SC(keyed_store_field, V8.KeyedStoreField) \
166 SC(named_store_inline_field, V8.NamedStoreInlineField) \
167 SC(keyed_store_inline, V8.KeyedStoreInline) \
168 SC(named_load_inline_generic, V8.NamedLoadInlineGeneric) \
169 SC(named_load_inline_field, V8.NamedLoadInlineFast) \
170 SC(keyed_load_inline_generic, V8.KeyedLoadInlineGeneric) \
171 SC(keyed_load_inline_fast, V8.KeyedLoadInlineFast) \
172 SC(keyed_store_inline_generic, V8.KeyedStoreInlineGeneric) \
173 SC(keyed_store_inline_fast, V8.KeyedStoreInlineFast) \
174 SC(named_store_inline_generic, V8.NamedStoreInlineGeneric) \
175 SC(named_store_inline_fast, V8.NamedStoreInlineFast) \
176 SC(keyed_store_inline_miss, V8.KeyedStoreInlineMiss) \
177 SC(named_store_global_inline, V8.NamedStoreGlobalInline) \
178 SC(named_store_global_inline_miss, V8.NamedStoreGlobalInlineMiss) \
179 SC(keyed_store_polymorphic_stubs, V8.KeyedStorePolymorphicStubs) \
180 SC(keyed_store_external_array_slow, V8.KeyedStoreExternalArraySlow) \
181 SC(store_normal_miss, V8.StoreNormalMiss) \
182 SC(store_normal_hit, V8.StoreNormalHit) \
183 SC(cow_arrays_created_stub, V8.COWArraysCreatedStub) \
184 SC(cow_arrays_created_runtime, V8.COWArraysCreatedRuntime) \
185 SC(cow_arrays_converted, V8.COWArraysConverted) \
186 SC(call_miss, V8.CallMiss) \
187 SC(keyed_call_miss, V8.KeyedCallMiss) \
188 SC(load_miss, V8.LoadMiss) \
189 SC(keyed_load_miss, V8.KeyedLoadMiss) \
190 SC(call_const, V8.CallConst) \
191 SC(call_const_fast_api, V8.CallConstFastApi) \
192 SC(call_const_interceptor, V8.CallConstInterceptor) \
193 SC(call_const_interceptor_fast_api, V8.CallConstInterceptorFastApi) \
194 SC(call_global_inline, V8.CallGlobalInline) \
195 SC(call_global_inline_miss, V8.CallGlobalInlineMiss) \
196 SC(constructed_objects, V8.ConstructedObjects) \
197 SC(constructed_objects_runtime, V8.ConstructedObjectsRuntime) \
198 SC(constructed_objects_stub, V8.ConstructedObjectsStub) \
199 SC(negative_lookups, V8.NegativeLookups) \
200 SC(negative_lookups_miss, V8.NegativeLookupsMiss) \
201 SC(megamorphic_stub_cache_probes, V8.MegamorphicStubCacheProbes) \
202 SC(megamorphic_stub_cache_misses, V8.MegamorphicStubCacheMisses) \
203 SC(megamorphic_stub_cache_updates, V8.MegamorphicStubCacheUpdates) \
204 SC(array_function_runtime, V8.ArrayFunctionRuntime) \
205 SC(array_function_native, V8.ArrayFunctionNative) \
206 SC(for_in, V8.ForIn) \
207 SC(enum_cache_hits, V8.EnumCacheHits) \
208 SC(enum_cache_misses, V8.EnumCacheMisses) \
209 SC(zone_segment_bytes, V8.ZoneSegmentBytes) \
210 SC(compute_entry_frame, V8.ComputeEntryFrame) \
211 SC(generic_binary_stub_calls, V8.GenericBinaryStubCalls) \
212 SC(generic_binary_stub_calls_regs, V8.GenericBinaryStubCallsRegs) \
213 SC(string_add_runtime, V8.StringAddRuntime) \
214 SC(string_add_native, V8.StringAddNative) \
215 SC(string_add_runtime_ext_to_ascii, V8.StringAddRuntimeExtToAscii) \
216 SC(sub_string_runtime, V8.SubStringRuntime) \
217 SC(sub_string_native, V8.SubStringNative) \
218 SC(string_add_make_two_char, V8.StringAddMakeTwoChar) \
219 SC(string_compare_native, V8.StringCompareNative) \
220 SC(string_compare_runtime, V8.StringCompareRuntime) \
221 SC(regexp_entry_runtime, V8.RegExpEntryRuntime) \
222 SC(regexp_entry_native, V8.RegExpEntryNative) \
223 SC(number_to_string_native, V8.NumberToStringNative) \
224 SC(number_to_string_runtime, V8.NumberToStringRuntime) \
225 SC(math_acos, V8.MathAcos) \
226 SC(math_asin, V8.MathAsin) \
227 SC(math_atan, V8.MathAtan) \
228 SC(math_atan2, V8.MathAtan2) \
229 SC(math_ceil, V8.MathCeil) \
230 SC(math_cos, V8.MathCos) \
231 SC(math_exp, V8.MathExp) \
232 SC(math_floor, V8.MathFloor) \
233 SC(math_log, V8.MathLog) \
234 SC(math_pow, V8.MathPow) \
235 SC(math_round, V8.MathRound) \
236 SC(math_sin, V8.MathSin) \
237 SC(math_sqrt, V8.MathSqrt) \
238 SC(math_tan, V8.MathTan) \
239 SC(transcendental_cache_hit, V8.TranscendentalCacheHit) \
240 SC(transcendental_cache_miss, V8.TranscendentalCacheMiss) \
241 SC(stack_interrupts, V8.StackInterrupts) \
242 SC(runtime_profiler_ticks, V8.RuntimeProfilerTicks) \
243 SC(other_ticks, V8.OtherTicks) \
244 SC(js_opt_ticks, V8.JsOptTicks) \
245 SC(js_non_opt_ticks, V8.JsNonoptTicks) \
246 SC(js_other_ticks, V8.JsOtherTicks) \
247 SC(smi_checks_removed, V8.SmiChecksRemoved) \
248 SC(map_checks_removed, V8.MapChecksRemoved) \
249 SC(quote_json_char_count, V8.QuoteJsonCharacterCount) \
250 SC(quote_json_char_recount, V8.QuoteJsonCharacterReCount)
256 #define HT(name, caption) \
257 HistogramTimer* name() { return &name##_; }
261 #define SC(name, caption) \
262 StatsCounter* name() { return &name##_; }
268 #define RATE_ID(name, caption) k_##name,
271 #define COUNTER_ID(name, caption) k_##name,
275 #define COUNTER_ID(name) k_##name,
282 return &state_counters_[state];
286 #define HT(name, caption) \
287 HistogramTimer name##_;
291 #define SC(name, caption) \
292 StatsCounter name##_;
298 #define COUNTER_ID(name) __##name,
301 kSlidingStateWindowCounterCount
305 StatsCounter state_counters_[kSlidingStateWindowCounterCount];
313 #endif // V8_V8_COUNTERS_H_
#define HT(name, caption)
#define SC(name, caption)
#define STATS_COUNTER_LIST_2(SC)
#define DISALLOW_IMPLICIT_CONSTRUCTORS(TypeName)
#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)