ager@chromium.org | ea91cc5 | 2011-05-23 06:06:11 +0000 | [diff] [blame] | 1 | // Copyright 2011 the V8 project authors. All rights reserved. |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 2 | // Redistribution and use in source and binary forms, with or without |
| 3 | // modification, are permitted provided that the following conditions are |
| 4 | // met: |
| 5 | // |
| 6 | // * Redistributions of source code must retain the above copyright |
| 7 | // notice, this list of conditions and the following disclaimer. |
| 8 | // * Redistributions in binary form must reproduce the above |
| 9 | // copyright notice, this list of conditions and the following |
| 10 | // disclaimer in the documentation and/or other materials provided |
| 11 | // with the distribution. |
| 12 | // * Neither the name of Google Inc. nor the names of its |
| 13 | // contributors may be used to endorse or promote products derived |
| 14 | // from this software without specific prior written permission. |
| 15 | // |
| 16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 17 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 18 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
| 19 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
| 20 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| 21 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 22 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 23 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 24 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 25 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 26 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 27 | |
| 28 | #ifndef V8_V8_COUNTERS_H_ |
| 29 | #define V8_V8_COUNTERS_H_ |
| 30 | |
whesse@chromium.org | 023421e | 2010-12-21 12:19:12 +0000 | [diff] [blame] | 31 | #include "allocation.h" |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 32 | #include "counters.h" |
whesse@chromium.org | 023421e | 2010-12-21 12:19:12 +0000 | [diff] [blame] | 33 | #include "v8globals.h" |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 34 | |
kasperl@chromium.org | 71affb5 | 2009-05-26 05:44:31 +0000 | [diff] [blame] | 35 | namespace v8 { |
| 36 | namespace internal { |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 37 | |
kasperl@chromium.org | b3284ad | 2009-05-18 06:12:45 +0000 | [diff] [blame] | 38 | #define HISTOGRAM_TIMER_LIST(HT) \ |
| 39 | /* Garbage collection timers. */ \ |
| 40 | HT(gc_compactor, V8.GCCompactor) \ |
| 41 | HT(gc_scavenger, V8.GCScavenger) \ |
| 42 | HT(gc_context, V8.GCContext) /* GC context cleanup time */ \ |
| 43 | /* Parsing timers. */ \ |
| 44 | HT(parse, V8.Parse) \ |
| 45 | HT(parse_lazy, V8.ParseLazy) \ |
| 46 | HT(pre_parse, V8.PreParse) \ |
| 47 | /* Total compilation times. */ \ |
| 48 | HT(compile, V8.Compile) \ |
| 49 | HT(compile_eval, V8.CompileEval) \ |
ager@chromium.org | b61a0d1 | 2010-10-13 08:35:23 +0000 | [diff] [blame] | 50 | HT(compile_lazy, V8.CompileLazy) |
christian.plesner.hansen@gmail.com | 9d58c2b | 2009-10-16 11:48:38 +0000 | [diff] [blame] | 51 | |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 52 | |
| 53 | // WARNING: STATS_COUNTER_LIST_* is a very large macro that is causing MSVC |
| 54 | // Intellisense to crash. It was broken into two macros (each of length 40 |
| 55 | // lines) rather than one macro (of length about 80 lines) to work around |
| 56 | // this problem. Please avoid using recursive macros of this length when |
| 57 | // possible. |
sgjesse@chromium.org | b302e56 | 2010-02-03 11:26:59 +0000 | [diff] [blame] | 58 | #define STATS_COUNTER_LIST_1(SC) \ |
| 59 | /* Global Handle Count*/ \ |
| 60 | SC(global_handles, V8.GlobalHandles) \ |
| 61 | /* Mallocs from PCRE */ \ |
| 62 | SC(pcre_mallocs, V8.PcreMallocCount) \ |
| 63 | /* OS Memory allocated */ \ |
| 64 | SC(memory_allocated, V8.OsMemoryAllocated) \ |
ricow@chromium.org | 65fae84 | 2010-08-25 15:26:24 +0000 | [diff] [blame] | 65 | SC(normalized_maps, V8.NormalizedMaps) \ |
sgjesse@chromium.org | b302e56 | 2010-02-03 11:26:59 +0000 | [diff] [blame] | 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) \ |
ricow@chromium.org | d236f4d | 2010-09-01 06:52:08 +0000 | [diff] [blame] | 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) \ |
sgjesse@chromium.org | b302e56 | 2010-02-03 11:26:59 +0000 | [diff] [blame] | 88 | /* Amount of evaled source code. */ \ |
| 89 | SC(total_eval_size, V8.TotalEvalSize) \ |
| 90 | /* Amount of loaded source code. */ \ |
| 91 | SC(total_load_size, V8.TotalLoadSize) \ |
| 92 | /* Amount of parsed source code. */ \ |
| 93 | SC(total_parse_size, V8.TotalParseSize) \ |
| 94 | /* Amount of source code skipped over using preparsing. */ \ |
| 95 | SC(total_preparse_skipped, V8.TotalPreparseSkipped) \ |
ager@chromium.org | 5b2fbee | 2010-09-08 06:38:15 +0000 | [diff] [blame] | 96 | /* Number of symbol lookups skipped using preparsing */ \ |
| 97 | SC(total_preparse_symbols_skipped, V8.TotalPreparseSymbolSkipped) \ |
sgjesse@chromium.org | b302e56 | 2010-02-03 11:26:59 +0000 | [diff] [blame] | 98 | /* Amount of compiled source code. */ \ |
| 99 | SC(total_compile_size, V8.TotalCompileSize) \ |
| 100 | /* Amount of source code compiled with the old codegen. */ \ |
| 101 | SC(total_old_codegen_source_size, V8.TotalOldCodegenSourceSize) \ |
| 102 | /* Amount of source code compiled with the full codegen. */ \ |
kmillikin@chromium.org | 5d8f0e6 | 2010-03-24 08:21:20 +0000 | [diff] [blame] | 103 | SC(total_full_codegen_source_size, V8.TotalFullCodegenSourceSize) \ |
| 104 | /* Number of contexts created from scratch. */ \ |
| 105 | SC(contexts_created_from_scratch, V8.ContextsCreatedFromScratch) \ |
| 106 | /* Number of contexts created by partial snapshot. */ \ |
ricow@chromium.org | d236f4d | 2010-09-01 06:52:08 +0000 | [diff] [blame] | 107 | SC(contexts_created_by_snapshot, V8.ContextsCreatedBySnapshot) \ |
| 108 | /* Number of code objects found from pc. */ \ |
| 109 | SC(pc_to_code, V8.PcToCode) \ |
| 110 | SC(pc_to_code_cached, V8.PcToCodeCached) |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 111 | |
| 112 | |
ager@chromium.org | 5c83825 | 2010-02-19 08:53:10 +0000 | [diff] [blame] | 113 | #define STATS_COUNTER_LIST_2(SC) \ |
| 114 | /* Number of code stubs. */ \ |
| 115 | SC(code_stubs, V8.CodeStubs) \ |
| 116 | /* Amount of stub code. */ \ |
| 117 | SC(total_stubs_code_size, V8.TotalStubsCodeSize) \ |
| 118 | /* Amount of (JS) compiled code. */ \ |
| 119 | SC(total_compiled_code_size, V8.TotalCompiledCodeSize) \ |
| 120 | SC(gc_compactor_caused_by_request, V8.GCCompactorCausedByRequest) \ |
| 121 | SC(gc_compactor_caused_by_promoted_data, \ |
| 122 | V8.GCCompactorCausedByPromotedData) \ |
| 123 | SC(gc_compactor_caused_by_oldspace_exhaustion, \ |
| 124 | V8.GCCompactorCausedByOldspaceExhaustion) \ |
| 125 | SC(gc_compactor_caused_by_weak_handles, \ |
| 126 | V8.GCCompactorCausedByWeakHandles) \ |
| 127 | SC(gc_last_resort_from_js, V8.GCLastResortFromJS) \ |
| 128 | SC(gc_last_resort_from_handles, V8.GCLastResortFromHandles) \ |
svenpanne@chromium.org | 6d786c9 | 2011-06-15 10:58:27 +0000 | [diff] [blame] | 129 | SC(map_to_fast_elements, V8.MapToFastElements) \ |
| 130 | SC(map_to_fast_double_elements, V8.MapToFastDoubleElements) \ |
| 131 | SC(map_to_slow_elements, V8.MapToSlowElements) \ |
danno@chromium.org | 4d3fe4e | 2011-03-10 10:14:28 +0000 | [diff] [blame] | 132 | SC(map_to_external_array_elements, V8.MapToExternalArrayElements) \ |
ager@chromium.org | 5c83825 | 2010-02-19 08:53:10 +0000 | [diff] [blame] | 133 | /* How is the generic keyed-load stub used? */ \ |
| 134 | SC(keyed_load_generic_smi, V8.KeyedLoadGenericSmi) \ |
| 135 | SC(keyed_load_generic_symbol, V8.KeyedLoadGenericSymbol) \ |
sgjesse@chromium.org | 82dbbab | 2010-06-02 08:57:44 +0000 | [diff] [blame] | 136 | SC(keyed_load_generic_lookup_cache, V8.KeyedLoadGenericLookupCache) \ |
ager@chromium.org | 5c83825 | 2010-02-19 08:53:10 +0000 | [diff] [blame] | 137 | SC(keyed_load_generic_slow, V8.KeyedLoadGenericSlow) \ |
ager@chromium.org | ea91cc5 | 2011-05-23 06:06:11 +0000 | [diff] [blame] | 138 | SC(keyed_load_polymorphic_stubs, V8.KeyedLoadPolymorphicStubs) \ |
ager@chromium.org | 5c83825 | 2010-02-19 08:53:10 +0000 | [diff] [blame] | 139 | SC(keyed_load_external_array_slow, V8.KeyedLoadExternalArraySlow) \ |
ager@chromium.org | 2cc82ae | 2010-06-14 07:35:38 +0000 | [diff] [blame] | 140 | /* How is the generic keyed-call stub used? */ \ |
| 141 | SC(keyed_call_generic_smi_fast, V8.KeyedCallGenericSmiFast) \ |
| 142 | SC(keyed_call_generic_smi_dict, V8.KeyedCallGenericSmiDict) \ |
| 143 | SC(keyed_call_generic_lookup_cache, V8.KeyedCallGenericLookupCache) \ |
| 144 | SC(keyed_call_generic_lookup_dict, V8.KeyedCallGenericLookupDict) \ |
| 145 | SC(keyed_call_generic_value_type, V8.KeyedCallGenericValueType) \ |
| 146 | SC(keyed_call_generic_slow, V8.KeyedCallGenericSlow) \ |
| 147 | SC(keyed_call_generic_slow_load, V8.KeyedCallGenericSlowLoad) \ |
ager@chromium.org | 5c83825 | 2010-02-19 08:53:10 +0000 | [diff] [blame] | 148 | /* Count how much the monomorphic keyed-load stubs are hit. */ \ |
| 149 | SC(keyed_load_function_prototype, V8.KeyedLoadFunctionPrototype) \ |
| 150 | SC(keyed_load_string_length, V8.KeyedLoadStringLength) \ |
| 151 | SC(keyed_load_array_length, V8.KeyedLoadArrayLength) \ |
| 152 | SC(keyed_load_constant_function, V8.KeyedLoadConstantFunction) \ |
| 153 | SC(keyed_load_field, V8.KeyedLoadField) \ |
| 154 | SC(keyed_load_callback, V8.KeyedLoadCallback) \ |
| 155 | SC(keyed_load_interceptor, V8.KeyedLoadInterceptor) \ |
| 156 | SC(keyed_load_inline, V8.KeyedLoadInline) \ |
| 157 | SC(keyed_load_inline_miss, V8.KeyedLoadInlineMiss) \ |
| 158 | SC(named_load_inline, V8.NamedLoadInline) \ |
| 159 | SC(named_load_inline_miss, V8.NamedLoadInlineMiss) \ |
| 160 | SC(named_load_global_inline, V8.NamedLoadGlobalInline) \ |
| 161 | SC(named_load_global_inline_miss, V8.NamedLoadGlobalInlineMiss) \ |
ricow@chromium.org | eb7c144 | 2010-10-04 08:54:21 +0000 | [diff] [blame] | 162 | SC(dont_delete_hint_hit, V8.DontDeleteHintHit) \ |
| 163 | SC(dont_delete_hint_miss, V8.DontDeleteHintMiss) \ |
fschneider@chromium.org | c20610a | 2010-09-22 09:44:58 +0000 | [diff] [blame] | 164 | SC(named_load_global_stub, V8.NamedLoadGlobalStub) \ |
| 165 | SC(named_load_global_stub_miss, V8.NamedLoadGlobalStubMiss) \ |
ager@chromium.org | 5c83825 | 2010-02-19 08:53:10 +0000 | [diff] [blame] | 166 | SC(keyed_store_field, V8.KeyedStoreField) \ |
kasperl@chromium.org | a555126 | 2010-12-07 12:49:48 +0000 | [diff] [blame] | 167 | SC(named_store_inline_field, V8.NamedStoreInlineField) \ |
ager@chromium.org | 5c83825 | 2010-02-19 08:53:10 +0000 | [diff] [blame] | 168 | SC(keyed_store_inline, V8.KeyedStoreInline) \ |
kasperl@chromium.org | a555126 | 2010-12-07 12:49:48 +0000 | [diff] [blame] | 169 | SC(named_load_inline_generic, V8.NamedLoadInlineGeneric) \ |
| 170 | SC(named_load_inline_field, V8.NamedLoadInlineFast) \ |
| 171 | SC(keyed_load_inline_generic, V8.KeyedLoadInlineGeneric) \ |
| 172 | SC(keyed_load_inline_fast, V8.KeyedLoadInlineFast) \ |
kasperl@chromium.org | a555126 | 2010-12-07 12:49:48 +0000 | [diff] [blame] | 173 | SC(keyed_store_inline_generic, V8.KeyedStoreInlineGeneric) \ |
| 174 | SC(keyed_store_inline_fast, V8.KeyedStoreInlineFast) \ |
| 175 | SC(named_store_inline_generic, V8.NamedStoreInlineGeneric) \ |
| 176 | SC(named_store_inline_fast, V8.NamedStoreInlineFast) \ |
ager@chromium.org | 5c83825 | 2010-02-19 08:53:10 +0000 | [diff] [blame] | 177 | SC(keyed_store_inline_miss, V8.KeyedStoreInlineMiss) \ |
| 178 | SC(named_store_global_inline, V8.NamedStoreGlobalInline) \ |
| 179 | SC(named_store_global_inline_miss, V8.NamedStoreGlobalInlineMiss) \ |
ager@chromium.org | ea91cc5 | 2011-05-23 06:06:11 +0000 | [diff] [blame] | 180 | SC(keyed_store_polymorphic_stubs, V8.KeyedStorePolymorphicStubs) \ |
| 181 | SC(keyed_store_external_array_slow, V8.KeyedStoreExternalArraySlow) \ |
kmillikin@chromium.org | 69ea396 | 2010-07-05 11:01:40 +0000 | [diff] [blame] | 182 | SC(store_normal_miss, V8.StoreNormalMiss) \ |
| 183 | SC(store_normal_hit, V8.StoreNormalHit) \ |
ricow@chromium.org | 0b9f850 | 2010-08-18 07:45:01 +0000 | [diff] [blame] | 184 | SC(cow_arrays_created_stub, V8.COWArraysCreatedStub) \ |
| 185 | SC(cow_arrays_created_runtime, V8.COWArraysCreatedRuntime) \ |
| 186 | SC(cow_arrays_converted, V8.COWArraysConverted) \ |
fschneider@chromium.org | 40b9da3 | 2010-06-28 11:29:21 +0000 | [diff] [blame] | 187 | SC(call_miss, V8.CallMiss) \ |
| 188 | SC(keyed_call_miss, V8.KeyedCallMiss) \ |
| 189 | SC(load_miss, V8.LoadMiss) \ |
| 190 | SC(keyed_load_miss, V8.KeyedLoadMiss) \ |
ager@chromium.org | 5c83825 | 2010-02-19 08:53:10 +0000 | [diff] [blame] | 191 | SC(call_const, V8.CallConst) \ |
| 192 | SC(call_const_fast_api, V8.CallConstFastApi) \ |
| 193 | SC(call_const_interceptor, V8.CallConstInterceptor) \ |
| 194 | SC(call_const_interceptor_fast_api, V8.CallConstInterceptorFastApi) \ |
| 195 | SC(call_global_inline, V8.CallGlobalInline) \ |
| 196 | SC(call_global_inline_miss, V8.CallGlobalInlineMiss) \ |
| 197 | SC(constructed_objects, V8.ConstructedObjects) \ |
| 198 | SC(constructed_objects_runtime, V8.ConstructedObjectsRuntime) \ |
| 199 | SC(constructed_objects_stub, V8.ConstructedObjectsStub) \ |
kmillikin@chromium.org | 69ea396 | 2010-07-05 11:01:40 +0000 | [diff] [blame] | 200 | SC(negative_lookups, V8.NegativeLookups) \ |
whesse@chromium.org | ba5a61b | 2010-07-26 11:44:40 +0000 | [diff] [blame] | 201 | SC(negative_lookups_miss, V8.NegativeLookupsMiss) \ |
ager@chromium.org | 5c83825 | 2010-02-19 08:53:10 +0000 | [diff] [blame] | 202 | SC(array_function_runtime, V8.ArrayFunctionRuntime) \ |
| 203 | SC(array_function_native, V8.ArrayFunctionNative) \ |
| 204 | SC(for_in, V8.ForIn) \ |
| 205 | SC(enum_cache_hits, V8.EnumCacheHits) \ |
| 206 | SC(enum_cache_misses, V8.EnumCacheMisses) \ |
ager@chromium.org | 5c83825 | 2010-02-19 08:53:10 +0000 | [diff] [blame] | 207 | SC(zone_segment_bytes, V8.ZoneSegmentBytes) \ |
| 208 | SC(compute_entry_frame, V8.ComputeEntryFrame) \ |
| 209 | SC(generic_binary_stub_calls, V8.GenericBinaryStubCalls) \ |
| 210 | SC(generic_binary_stub_calls_regs, V8.GenericBinaryStubCallsRegs) \ |
| 211 | SC(string_add_runtime, V8.StringAddRuntime) \ |
| 212 | SC(string_add_native, V8.StringAddNative) \ |
ricow@chromium.org | aa1b616 | 2010-03-29 07:44:58 +0000 | [diff] [blame] | 213 | SC(string_add_runtime_ext_to_ascii, V8.StringAddRuntimeExtToAscii) \ |
ager@chromium.org | 5c83825 | 2010-02-19 08:53:10 +0000 | [diff] [blame] | 214 | SC(sub_string_runtime, V8.SubStringRuntime) \ |
| 215 | SC(sub_string_native, V8.SubStringNative) \ |
kmillikin@chromium.org | 3cdd9e1 | 2010-09-06 11:39:48 +0000 | [diff] [blame] | 216 | SC(string_add_make_two_char, V8.StringAddMakeTwoChar) \ |
ager@chromium.org | 5c83825 | 2010-02-19 08:53:10 +0000 | [diff] [blame] | 217 | SC(string_compare_native, V8.StringCompareNative) \ |
| 218 | SC(string_compare_runtime, V8.StringCompareRuntime) \ |
| 219 | SC(regexp_entry_runtime, V8.RegExpEntryRuntime) \ |
| 220 | SC(regexp_entry_native, V8.RegExpEntryNative) \ |
| 221 | SC(number_to_string_native, V8.NumberToStringNative) \ |
ager@chromium.org | ce5e87b | 2010-03-10 10:24:18 +0000 | [diff] [blame] | 222 | SC(number_to_string_runtime, V8.NumberToStringRuntime) \ |
ager@chromium.org | ce5e87b | 2010-03-10 10:24:18 +0000 | [diff] [blame] | 223 | SC(math_acos, V8.MathAcos) \ |
| 224 | SC(math_asin, V8.MathAsin) \ |
| 225 | SC(math_atan, V8.MathAtan) \ |
| 226 | SC(math_atan2, V8.MathAtan2) \ |
| 227 | SC(math_ceil, V8.MathCeil) \ |
| 228 | SC(math_cos, V8.MathCos) \ |
| 229 | SC(math_exp, V8.MathExp) \ |
| 230 | SC(math_floor, V8.MathFloor) \ |
| 231 | SC(math_log, V8.MathLog) \ |
| 232 | SC(math_pow, V8.MathPow) \ |
| 233 | SC(math_round, V8.MathRound) \ |
| 234 | SC(math_sin, V8.MathSin) \ |
| 235 | SC(math_sqrt, V8.MathSqrt) \ |
| 236 | SC(math_tan, V8.MathTan) \ |
| 237 | SC(transcendental_cache_hit, V8.TranscendentalCacheHit) \ |
kasperl@chromium.org | a555126 | 2010-12-07 12:49:48 +0000 | [diff] [blame] | 238 | SC(transcendental_cache_miss, V8.TranscendentalCacheMiss) \ |
| 239 | SC(stack_interrupts, V8.StackInterrupts) \ |
| 240 | SC(runtime_profiler_ticks, V8.RuntimeProfilerTicks) \ |
| 241 | SC(other_ticks, V8.OtherTicks) \ |
| 242 | SC(js_opt_ticks, V8.JsOptTicks) \ |
| 243 | SC(js_non_opt_ticks, V8.JsNonoptTicks) \ |
| 244 | SC(js_other_ticks, V8.JsOtherTicks) \ |
| 245 | SC(smi_checks_removed, V8.SmiChecksRemoved) \ |
| 246 | SC(map_checks_removed, V8.MapChecksRemoved) \ |
| 247 | SC(quote_json_char_count, V8.QuoteJsonCharacterCount) \ |
kmillikin@chromium.org | d2c22f0 | 2011-01-10 08:15:37 +0000 | [diff] [blame] | 248 | SC(quote_json_char_recount, V8.QuoteJsonCharacterReCount) |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 249 | |
kmillikin@chromium.org | 5d8f0e6 | 2010-03-24 08:21:20 +0000 | [diff] [blame] | 250 | |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 251 | // This file contains all the v8 counters that are in use. |
sgjesse@chromium.org | ea88ce9 | 2011-03-23 11:19:56 +0000 | [diff] [blame] | 252 | class Counters { |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 253 | public: |
ager@chromium.org | bb29dc9 | 2009-03-24 13:25:23 +0000 | [diff] [blame] | 254 | #define HT(name, caption) \ |
sgjesse@chromium.org | ea88ce9 | 2011-03-23 11:19:56 +0000 | [diff] [blame] | 255 | HistogramTimer* name() { return &name##_; } |
ager@chromium.org | bb29dc9 | 2009-03-24 13:25:23 +0000 | [diff] [blame] | 256 | HISTOGRAM_TIMER_LIST(HT) |
| 257 | #undef HT |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 258 | |
kasperl@chromium.org | b912362 | 2008-09-17 14:05:56 +0000 | [diff] [blame] | 259 | #define SC(name, caption) \ |
sgjesse@chromium.org | ea88ce9 | 2011-03-23 11:19:56 +0000 | [diff] [blame] | 260 | StatsCounter* name() { return &name##_; } |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 261 | STATS_COUNTER_LIST_1(SC) |
| 262 | STATS_COUNTER_LIST_2(SC) |
| 263 | #undef SC |
| 264 | |
| 265 | enum Id { |
| 266 | #define RATE_ID(name, caption) k_##name, |
ager@chromium.org | bb29dc9 | 2009-03-24 13:25:23 +0000 | [diff] [blame] | 267 | HISTOGRAM_TIMER_LIST(RATE_ID) |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 268 | #undef RATE_ID |
| 269 | #define COUNTER_ID(name, caption) k_##name, |
sgjesse@chromium.org | ea88ce9 | 2011-03-23 11:19:56 +0000 | [diff] [blame] | 270 | STATS_COUNTER_LIST_1(COUNTER_ID) |
| 271 | STATS_COUNTER_LIST_2(COUNTER_ID) |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 272 | #undef COUNTER_ID |
| 273 | #define COUNTER_ID(name) k_##name, |
sgjesse@chromium.org | ea88ce9 | 2011-03-23 11:19:56 +0000 | [diff] [blame] | 274 | STATE_TAG_LIST(COUNTER_ID) |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 275 | #undef COUNTER_ID |
| 276 | stats_counter_count |
| 277 | }; |
| 278 | |
sgjesse@chromium.org | ea88ce9 | 2011-03-23 11:19:56 +0000 | [diff] [blame] | 279 | StatsCounter* state_counters(StateTag state) { |
| 280 | return &state_counters_[state]; |
| 281 | } |
| 282 | |
| 283 | private: |
| 284 | #define HT(name, caption) \ |
| 285 | HistogramTimer name##_; |
| 286 | HISTOGRAM_TIMER_LIST(HT) |
| 287 | #undef HT |
| 288 | |
| 289 | #define SC(name, caption) \ |
| 290 | StatsCounter name##_; |
| 291 | STATS_COUNTER_LIST_1(SC) |
| 292 | STATS_COUNTER_LIST_2(SC) |
| 293 | #undef SC |
| 294 | |
| 295 | enum { |
| 296 | #define COUNTER_ID(name) __##name, |
| 297 | STATE_TAG_LIST(COUNTER_ID) |
| 298 | #undef COUNTER_ID |
| 299 | kSlidingStateWindowCounterCount |
| 300 | }; |
| 301 | |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 302 | // Sliding state window counters. |
sgjesse@chromium.org | ea88ce9 | 2011-03-23 11:19:56 +0000 | [diff] [blame] | 303 | StatsCounter state_counters_[kSlidingStateWindowCounterCount]; |
| 304 | friend class Isolate; |
| 305 | |
| 306 | DISALLOW_IMPLICIT_CONSTRUCTORS(Counters); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 307 | }; |
| 308 | |
| 309 | } } // namespace v8::internal |
| 310 | |
ager@chromium.org | 5ec4892 | 2009-05-05 07:25:34 +0000 | [diff] [blame] | 311 | #endif // V8_V8_COUNTERS_H_ |