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/platform/elapsed-timer.h" | 10 #include "src/base/platform/elapsed-timer.h" |
(...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
492 base::TimeDelta time; | 492 base::TimeDelta time; |
493 }; | 493 }; |
494 | 494 |
495 // RuntimeCallTimer is used to keep track of the stack of currently active | 495 // RuntimeCallTimer is used to keep track of the stack of currently active |
496 // timers used for properly measuring the own time of a RuntimeCallCounter. | 496 // timers used for properly measuring the own time of a RuntimeCallCounter. |
497 class RuntimeCallTimer { | 497 class RuntimeCallTimer { |
498 public: | 498 public: |
499 RuntimeCallTimer() {} | 499 RuntimeCallTimer() {} |
500 RuntimeCallCounter* counter() { return counter_; } | 500 RuntimeCallCounter* counter() { return counter_; } |
501 base::ElapsedTimer timer() { return timer_; } | 501 base::ElapsedTimer timer() { return timer_; } |
| 502 RuntimeCallTimer* parent() const { return parent_; } |
502 | 503 |
503 private: | 504 private: |
504 friend class RuntimeCallStats; | 505 friend class RuntimeCallStats; |
505 | 506 |
506 inline void Start(RuntimeCallCounter* counter, RuntimeCallTimer* parent) { | 507 inline void Start(RuntimeCallCounter* counter, RuntimeCallTimer* parent) { |
507 counter_ = counter; | 508 counter_ = counter; |
508 parent_ = parent; | 509 parent_ = parent; |
509 timer_.Start(); | 510 timer_.Start(); |
510 } | 511 } |
511 | 512 |
(...skipping 762 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1274 } | 1275 } |
1275 | 1276 |
1276 Isolate* isolate_ = nullptr; | 1277 Isolate* isolate_ = nullptr; |
1277 RuntimeCallTimer timer_; | 1278 RuntimeCallTimer timer_; |
1278 }; | 1279 }; |
1279 | 1280 |
1280 } // namespace internal | 1281 } // namespace internal |
1281 } // namespace v8 | 1282 } // namespace v8 |
1282 | 1283 |
1283 #endif // V8_COUNTERS_H_ | 1284 #endif // V8_COUNTERS_H_ |
OLD | NEW |