00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef V8_V8_COUNTERS_H_
00029 #define V8_V8_COUNTERS_H_
00030
00031 #include "counters.h"
00032
00033 namespace v8 { namespace internal {
00034
00035 #define STATS_RATE_LIST(SR) \
00036 SR(gc_compactor, V8.GCCompactor) \
00037 SR(gc_scavenger, V8.GCScavenger) \
00038 SR(compile, V8.Compile) \
00039 SR(compile_eval, V8.CompileEval) \
00040 SR(compile_lazy, V8.CompileLazy) \
00041 SR(parse, V8.Parse) \
00042 SR(parse_lazy, V8.ParseLazy) \
00043 SR(pre_parse, V8.PreParse)
00044
00045
00046
00047
00048
00049
00050 #define STATS_COUNTER_LIST_1(SC) \
00051 \
00052 SC(global_handles, V8.GlobalHandles) \
00053 \
00054 SC(global_objects, V8.GlobalObjects) \
00055 \
00056 SC(pcre_mallocs, V8.PcreMallocCount) \
00057 \
00058 SC(memory_allocated, V8.OsMemoryAllocated) \
00059 SC(props_to_dictionary, V8.ObjectPropertiesToDictionary) \
00060 SC(elements_to_dictionary, V8.ObjectElementsToDictionary) \
00061 SC(alive_after_last_gc, V8.AliveAfterLastGC) \
00062 SC(objs_since_last_young, V8.ObjsSinceLastYoung) \
00063 SC(objs_since_last_full, V8.ObjsSinceLastFull) \
00064 SC(symbol_table_capacity, V8.SymbolTableCapacity) \
00065 SC(number_of_symbols, V8.NumberOfSymbols) \
00066 \
00067 SC(total_external_string_memory, V8.TotalExternalStringMemory) \
00068 SC(script_wrappers, V8.ScriptWrappers) \
00069 SC(call_initialize_stubs, V8.CallInitializeStubs) \
00070 SC(call_premonomorphic_stubs, V8.CallPreMonomorphicStubs) \
00071 SC(call_normal_stubs, V8.CallNormalStubs) \
00072 SC(call_megamorphic_stubs, V8.CallMegamorphicStubs) \
00073 SC(arguments_adaptors, V8.ArgumentsAdaptors) \
00074 SC(compilation_cache_hits, V8.CompilationCacheHits) \
00075 SC(compilation_cache_misses, V8.CompilationCacheMisses) \
00076 SC(regexp_cache_hits, V8.RegExpCacheHits) \
00077 SC(regexp_cache_misses, V8.RegExpCacheMisses) \
00078 \
00079 SC(total_eval_size, V8.TotalEvalSize) \
00080 \
00081 SC(total_load_size, V8.TotalLoadSize) \
00082 \
00083 SC(total_parse_size, V8.TotalParseSize) \
00084 \
00085 SC(total_preparse_skipped, V8.TotalPreparseSkipped) \
00086 \
00087 SC(total_compile_size, V8.TotalCompileSize)
00088
00089
00090 #define STATS_COUNTER_LIST_2(SC) \
00091 \
00092 SC(code_stubs, V8.CodeStubs) \
00093 \
00094 SC(total_stubs_code_size, V8.TotalStubsCodeSize) \
00095 \
00096 SC(total_compiled_code_size, V8.TotalCompiledCodeSize) \
00097 SC(gc_compactor_caused_by_request, V8.GCCompactorCausedByRequest) \
00098 SC(gc_compactor_caused_by_promoted_data, \
00099 V8.GCCompactorCausedByPromotedData) \
00100 SC(gc_compactor_caused_by_oldspace_exhaustion, \
00101 V8.GCCompactorCausedByOldspaceExhaustion) \
00102 SC(gc_compactor_caused_by_weak_handles, \
00103 V8.GCCompactorCausedByWeakHandles) \
00104 SC(gc_last_resort_from_js, V8.GCLastResortFromJS) \
00105 SC(gc_last_resort_from_handles, V8.GCLastResortFromHandles) \
00106 \
00107 SC(keyed_load_generic_smi, V8.KeyedLoadGenericSmi) \
00108 SC(keyed_load_generic_symbol, V8.KeyedLoadGenericSymbol) \
00109 SC(keyed_load_generic_slow, V8.KeyedLoadGenericSlow) \
00110 \
00111 SC(keyed_load_function_prototype, V8.KeyedLoadFunctionPrototype) \
00112 SC(keyed_load_string_length, V8.KeyedLoadStringLength) \
00113 SC(keyed_load_array_length, V8.KeyedLoadArrayLength) \
00114 SC(keyed_load_constant_function, V8.KeyedLoadConstantFunction) \
00115 SC(keyed_load_field, V8.KeyedLoadField) \
00116 SC(keyed_load_callback, V8.KeyedLoadCallback) \
00117 SC(keyed_load_interceptor, V8.KeyedLoadInterceptor) \
00118 SC(keyed_store_field, V8.KeyedStoreField) \
00119 SC(for_in, V8.ForIn) \
00120 SC(enum_cache_hits, V8.EnumCacheHits) \
00121 SC(enum_cache_misses, V8.EnumCacheMisses) \
00122 SC(reloc_info_count, V8.RelocInfoCount) \
00123 SC(reloc_info_size, V8.RelocInfoSize)
00124
00125
00126
00127 class Counters : AllStatic {
00128 public:
00129 #define SR(name, caption) \
00130 static StatsRate name;
00131 STATS_RATE_LIST(SR)
00132 #undef SR
00133
00134 #define SC(name, caption) \
00135 static StatsCounter name;
00136 STATS_COUNTER_LIST_1(SC)
00137 STATS_COUNTER_LIST_2(SC)
00138 #undef SC
00139
00140 enum Id {
00141 #define RATE_ID(name, caption) k_##name,
00142 STATS_RATE_LIST(RATE_ID)
00143 #undef RATE_ID
00144 #define COUNTER_ID(name, caption) k_##name,
00145 STATS_COUNTER_LIST_1(COUNTER_ID)
00146 STATS_COUNTER_LIST_2(COUNTER_ID)
00147 #undef COUNTER_ID
00148 #define COUNTER_ID(name) k_##name,
00149 STATE_TAG_LIST(COUNTER_ID)
00150 #undef COUNTER_ID
00151 stats_counter_count
00152 };
00153
00154
00155 static StatsCounter state_counters[];
00156 };
00157
00158 } }
00159
00160 #endif // V8_COUNTERS_H_