OLD | NEW |
1 // Copyright 2007-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2007-2008 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 14 matching lines...) Expand all Loading... |
25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 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. | 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 | 27 |
28 #ifndef V8_V8_COUNTERS_H_ | 28 #ifndef V8_V8_COUNTERS_H_ |
29 #define V8_V8_COUNTERS_H_ | 29 #define V8_V8_COUNTERS_H_ |
30 | 30 |
31 #include "counters.h" | 31 #include "counters.h" |
32 | 32 |
33 namespace v8 { namespace internal { | 33 namespace v8 { namespace internal { |
34 | 34 |
35 #define STATS_RATE_LIST(SR) \ | 35 #define HISTOGRAM_TIMER_LIST(HT) \ |
36 SR(gc_compactor, V8.GCCompactor) /* GC Compactor time */ \ | 36 HT(gc_compactor, V8.GCCompactor) /* GC Compactor time */ \ |
37 SR(gc_scavenger, V8.GCScavenger) /* GC Scavenger time */ \ | 37 HT(gc_scavenger, V8.GCScavenger) /* GC Scavenger time */ \ |
38 SR(gc_context, V8.GCContext) /* GC context cleanup time */ \ | 38 HT(gc_context, V8.GCContext) /* GC context cleanup time */ \ |
39 SR(compile, V8.Compile) /* Compile time*/ \ | 39 HT(compile, V8.Compile) /* Compile time*/ \ |
40 SR(compile_eval, V8.CompileEval) /* Eval compile time */ \ | 40 HT(compile_eval, V8.CompileEval) /* Eval compile time */ \ |
41 SR(compile_lazy, V8.CompileLazy) /* Lazy compile time */ \ | 41 HT(compile_lazy, V8.CompileLazy) /* Lazy compile time */ \ |
42 SR(parse, V8.Parse) /* Parse time */ \ | 42 HT(parse, V8.Parse) /* Parse time */ \ |
43 SR(parse_lazy, V8.ParseLazy) /* Lazy parse time */ \ | 43 HT(parse_lazy, V8.ParseLazy) /* Lazy parse time */ \ |
44 SR(pre_parse, V8.PreParse) /* Pre-parse time */ | 44 HT(pre_parse, V8.PreParse) /* Pre-parse time */ |
45 | 45 |
46 // WARNING: STATS_COUNTER_LIST_* is a very large macro that is causing MSVC | 46 // WARNING: STATS_COUNTER_LIST_* is a very large macro that is causing MSVC |
47 // Intellisense to crash. It was broken into two macros (each of length 40 | 47 // Intellisense to crash. It was broken into two macros (each of length 40 |
48 // lines) rather than one macro (of length about 80 lines) to work around | 48 // lines) rather than one macro (of length about 80 lines) to work around |
49 // this problem. Please avoid using recursive macros of this length when | 49 // this problem. Please avoid using recursive macros of this length when |
50 // possible. | 50 // possible. |
51 #define STATS_COUNTER_LIST_1(SC) \ | 51 #define STATS_COUNTER_LIST_1(SC) \ |
52 /* Global Handle Count*/ \ | 52 /* Global Handle Count*/ \ |
53 SC(global_handles, V8.GlobalHandles) \ | 53 SC(global_handles, V8.GlobalHandles) \ |
54 /* Mallocs from PCRE */ \ | 54 /* Mallocs from PCRE */ \ |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 SC(enum_cache_hits, V8.EnumCacheHits) \ | 121 SC(enum_cache_hits, V8.EnumCacheHits) \ |
122 SC(enum_cache_misses, V8.EnumCacheMisses) \ | 122 SC(enum_cache_misses, V8.EnumCacheMisses) \ |
123 SC(reloc_info_count, V8.RelocInfoCount) \ | 123 SC(reloc_info_count, V8.RelocInfoCount) \ |
124 SC(reloc_info_size, V8.RelocInfoSize) \ | 124 SC(reloc_info_size, V8.RelocInfoSize) \ |
125 SC(zone_segment_bytes, V8.ZoneSegmentBytes) | 125 SC(zone_segment_bytes, V8.ZoneSegmentBytes) |
126 | 126 |
127 | 127 |
128 // This file contains all the v8 counters that are in use. | 128 // This file contains all the v8 counters that are in use. |
129 class Counters : AllStatic { | 129 class Counters : AllStatic { |
130 public: | 130 public: |
131 #define SR(name, caption) \ | 131 #define HT(name, caption) \ |
132 static StatsRate name; | 132 static HistogramTimer name; |
133 STATS_RATE_LIST(SR) | 133 HISTOGRAM_TIMER_LIST(HT) |
134 #undef SR | 134 #undef HT |
135 | 135 |
136 #define SC(name, caption) \ | 136 #define SC(name, caption) \ |
137 static StatsCounter name; | 137 static StatsCounter name; |
138 STATS_COUNTER_LIST_1(SC) | 138 STATS_COUNTER_LIST_1(SC) |
139 STATS_COUNTER_LIST_2(SC) | 139 STATS_COUNTER_LIST_2(SC) |
140 #undef SC | 140 #undef SC |
141 | 141 |
142 enum Id { | 142 enum Id { |
143 #define RATE_ID(name, caption) k_##name, | 143 #define RATE_ID(name, caption) k_##name, |
144 STATS_RATE_LIST(RATE_ID) | 144 HISTOGRAM_TIMER_LIST(RATE_ID) |
145 #undef RATE_ID | 145 #undef RATE_ID |
146 #define COUNTER_ID(name, caption) k_##name, | 146 #define COUNTER_ID(name, caption) k_##name, |
147 STATS_COUNTER_LIST_1(COUNTER_ID) | 147 STATS_COUNTER_LIST_1(COUNTER_ID) |
148 STATS_COUNTER_LIST_2(COUNTER_ID) | 148 STATS_COUNTER_LIST_2(COUNTER_ID) |
149 #undef COUNTER_ID | 149 #undef COUNTER_ID |
150 #define COUNTER_ID(name) k_##name, | 150 #define COUNTER_ID(name) k_##name, |
151 STATE_TAG_LIST(COUNTER_ID) | 151 STATE_TAG_LIST(COUNTER_ID) |
152 #undef COUNTER_ID | 152 #undef COUNTER_ID |
153 stats_counter_count | 153 stats_counter_count |
154 }; | 154 }; |
155 | 155 |
156 // Sliding state window counters. | 156 // Sliding state window counters. |
157 static StatsCounter state_counters[]; | 157 static StatsCounter state_counters[]; |
158 }; | 158 }; |
159 | 159 |
160 } } // namespace v8::internal | 160 } } // namespace v8::internal |
161 | 161 |
162 #endif // V8_COUNTERS_H_ | 162 #endif // V8_COUNTERS_H_ |
OLD | NEW |