OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_COUNTERS_H_ | 5 #ifndef V8_COUNTERS_H_ |
6 #define V8_COUNTERS_H_ | 6 #define V8_COUNTERS_H_ |
7 | 7 |
8 #include "include/v8.h" | 8 #include "include/v8.h" |
9 #include "src/allocation.h" | 9 #include "src/allocation.h" |
10 #include "src/base/atomic-utils.h" | 10 #include "src/base/atomic-utils.h" |
(...skipping 817 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
828 #define CALL_BUILTIN_COUNTER(name) \ | 828 #define CALL_BUILTIN_COUNTER(name) \ |
829 RuntimeCallCounter API_##name = RuntimeCallCounter("API_" #name); | 829 RuntimeCallCounter API_##name = RuntimeCallCounter("API_" #name); |
830 FOR_EACH_API_COUNTER(CALL_BUILTIN_COUNTER) | 830 FOR_EACH_API_COUNTER(CALL_BUILTIN_COUNTER) |
831 #undef CALL_BUILTIN_COUNTER | 831 #undef CALL_BUILTIN_COUNTER |
832 #define CALL_BUILTIN_COUNTER(name) \ | 832 #define CALL_BUILTIN_COUNTER(name) \ |
833 RuntimeCallCounter Handler_##name = RuntimeCallCounter(#name); | 833 RuntimeCallCounter Handler_##name = RuntimeCallCounter(#name); |
834 FOR_EACH_HANDLER_COUNTER(CALL_BUILTIN_COUNTER) | 834 FOR_EACH_HANDLER_COUNTER(CALL_BUILTIN_COUNTER) |
835 #undef CALL_BUILTIN_COUNTER | 835 #undef CALL_BUILTIN_COUNTER |
836 | 836 |
837 static const CounterId counters[]; | 837 static const CounterId counters[]; |
| 838 static const int counters_count; |
838 | 839 |
839 // Starting measuring the time for a function. This will establish the | 840 // Starting measuring the time for a function. This will establish the |
840 // connection to the parent counter for properly calculating the own times. | 841 // connection to the parent counter for properly calculating the own times. |
841 V8_EXPORT_PRIVATE static void Enter(RuntimeCallStats* stats, | 842 V8_EXPORT_PRIVATE static void Enter(RuntimeCallStats* stats, |
842 RuntimeCallTimer* timer, | 843 RuntimeCallTimer* timer, |
843 CounterId counter_id); | 844 CounterId counter_id); |
844 | 845 |
845 // Leave a scope for a measured runtime function. This will properly add | 846 // Leave a scope for a measured runtime function. This will properly add |
846 // the time delta to the current_counter and subtract the delta from its | 847 // the time delta to the current_counter and subtract the delta from its |
847 // parent. | 848 // parent. |
(...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1324 | 1325 |
1325 explicit Counters(Isolate* isolate); | 1326 explicit Counters(Isolate* isolate); |
1326 | 1327 |
1327 DISALLOW_IMPLICIT_CONSTRUCTORS(Counters); | 1328 DISALLOW_IMPLICIT_CONSTRUCTORS(Counters); |
1328 }; | 1329 }; |
1329 | 1330 |
1330 } // namespace internal | 1331 } // namespace internal |
1331 } // namespace v8 | 1332 } // namespace v8 |
1332 | 1333 |
1333 #endif // V8_COUNTERS_H_ | 1334 #endif // V8_COUNTERS_H_ |
OLD | NEW |