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 #include "src/counters.h" | 5 #include "src/counters.h" |
6 | 6 |
7 #include <iomanip> | 7 #include <iomanip> |
8 | 8 |
9 #include "src/base/platform/platform.h" | 9 #include "src/base/platform/platform.h" |
10 #include "src/isolate.h" | 10 #include "src/isolate.h" |
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
317 #undef CALL_BUILTIN_COUNTER | 317 #undef CALL_BUILTIN_COUNTER |
318 #define CALL_BUILTIN_COUNTER(name) &RuntimeCallStats::API_##name, | 318 #define CALL_BUILTIN_COUNTER(name) &RuntimeCallStats::API_##name, |
319 FOR_EACH_API_COUNTER(CALL_BUILTIN_COUNTER) // | 319 FOR_EACH_API_COUNTER(CALL_BUILTIN_COUNTER) // |
320 #undef CALL_BUILTIN_COUNTER | 320 #undef CALL_BUILTIN_COUNTER |
321 #define CALL_BUILTIN_COUNTER(name) &RuntimeCallStats::Handler_##name, | 321 #define CALL_BUILTIN_COUNTER(name) &RuntimeCallStats::Handler_##name, |
322 FOR_EACH_HANDLER_COUNTER(CALL_BUILTIN_COUNTER) | 322 FOR_EACH_HANDLER_COUNTER(CALL_BUILTIN_COUNTER) |
323 #undef CALL_BUILTIN_COUNTER | 323 #undef CALL_BUILTIN_COUNTER |
324 }; | 324 }; |
325 | 325 |
326 // static | 326 // static |
| 327 const int RuntimeCallStats::counters_count = |
| 328 arraysize(RuntimeCallStats::counters); |
| 329 |
| 330 // static |
327 void RuntimeCallStats::Enter(RuntimeCallStats* stats, RuntimeCallTimer* timer, | 331 void RuntimeCallStats::Enter(RuntimeCallStats* stats, RuntimeCallTimer* timer, |
328 CounterId counter_id) { | 332 CounterId counter_id) { |
329 RuntimeCallCounter* counter = &(stats->*counter_id); | 333 RuntimeCallCounter* counter = &(stats->*counter_id); |
330 DCHECK(counter->name() != nullptr); | 334 DCHECK(counter->name() != nullptr); |
331 timer->Start(counter, stats->current_timer_.Value()); | 335 timer->Start(counter, stats->current_timer_.Value()); |
332 stats->current_timer_.SetValue(timer); | 336 stats->current_timer_.SetValue(timer); |
333 } | 337 } |
334 | 338 |
335 // static | 339 // static |
336 void RuntimeCallStats::Leave(RuntimeCallStats* stats, RuntimeCallTimer* timer) { | 340 void RuntimeCallStats::Leave(RuntimeCallStats* stats, RuntimeCallTimer* timer) { |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
403 RuntimeCallStats::counters) { | 407 RuntimeCallStats::counters) { |
404 RuntimeCallCounter* counter = &(this->*counter_id); | 408 RuntimeCallCounter* counter = &(this->*counter_id); |
405 if (counter->count() > 0) counter->Dump(value); | 409 if (counter->count() > 0) counter->Dump(value); |
406 } | 410 } |
407 | 411 |
408 in_use_ = false; | 412 in_use_ = false; |
409 } | 413 } |
410 | 414 |
411 } // namespace internal | 415 } // namespace internal |
412 } // namespace v8 | 416 } // namespace v8 |
OLD | NEW |