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 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
284 #endif | 284 #endif |
285 } | 285 } |
286 | 286 |
287 private: | 287 private: |
288 HistogramTimer* timer_; | 288 HistogramTimer* timer_; |
289 #ifdef DEBUG | 289 #ifdef DEBUG |
290 bool skipped_timer_start_; | 290 bool skipped_timer_start_; |
291 #endif | 291 #endif |
292 }; | 292 }; |
293 | 293 |
| 294 #define HISTOGRAM_RANGE_LIST(HR) \ |
| 295 HR(gc_idle_time_allotted_in_ms, V8.GCIdleTimeAllottedInMS) |
294 | 296 |
295 #define HISTOGRAM_TIMER_LIST(HT) \ | 297 #define HISTOGRAM_TIMER_LIST(HT) \ |
296 /* Garbage collection timers. */ \ | 298 /* Garbage collection timers. */ \ |
297 HT(gc_compactor, V8.GCCompactor) \ | 299 HT(gc_compactor, V8.GCCompactor) \ |
298 HT(gc_scavenger, V8.GCScavenger) \ | 300 HT(gc_scavenger, V8.GCScavenger) \ |
299 HT(gc_context, V8.GCContext) /* GC context cleanup time */ \ | 301 HT(gc_context, V8.GCContext) /* GC context cleanup time */ \ |
300 HT(gc_idle_notification, V8.GCIdleNotification) \ | 302 HT(gc_idle_notification, V8.GCIdleNotification) \ |
301 HT(gc_incremental_marking, V8.GCIncrementalMarking) \ | 303 HT(gc_incremental_marking, V8.GCIncrementalMarking) \ |
302 /* Parsing timers. */ \ | 304 /* Parsing timers. */ \ |
303 HT(parse, V8.Parse) \ | 305 HT(parse, V8.Parse) \ |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
544 SC(property_cell_space_bytes_used, \ | 546 SC(property_cell_space_bytes_used, \ |
545 V8.MemoryPropertyCellSpaceBytesUsed) \ | 547 V8.MemoryPropertyCellSpaceBytesUsed) \ |
546 SC(lo_space_bytes_available, V8.MemoryLoSpaceBytesAvailable) \ | 548 SC(lo_space_bytes_available, V8.MemoryLoSpaceBytesAvailable) \ |
547 SC(lo_space_bytes_committed, V8.MemoryLoSpaceBytesCommitted) \ | 549 SC(lo_space_bytes_committed, V8.MemoryLoSpaceBytesCommitted) \ |
548 SC(lo_space_bytes_used, V8.MemoryLoSpaceBytesUsed) | 550 SC(lo_space_bytes_used, V8.MemoryLoSpaceBytesUsed) |
549 | 551 |
550 | 552 |
551 // This file contains all the v8 counters that are in use. | 553 // This file contains all the v8 counters that are in use. |
552 class Counters { | 554 class Counters { |
553 public: | 555 public: |
| 556 #define HR(name, caption) \ |
| 557 Histogram* name() { return &name##_; } |
| 558 HISTOGRAM_RANGE_LIST(HR) |
| 559 #undef HR |
| 560 |
554 #define HT(name, caption) \ | 561 #define HT(name, caption) \ |
555 HistogramTimer* name() { return &name##_; } | 562 HistogramTimer* name() { return &name##_; } |
556 HISTOGRAM_TIMER_LIST(HT) | 563 HISTOGRAM_TIMER_LIST(HT) |
557 #undef HT | 564 #undef HT |
558 | 565 |
559 #define HP(name, caption) \ | 566 #define HP(name, caption) \ |
560 Histogram* name() { return &name##_; } | 567 Histogram* name() { return &name##_; } |
561 HISTOGRAM_PERCENTAGE_LIST(HP) | 568 HISTOGRAM_PERCENTAGE_LIST(HP) |
562 #undef HP | 569 #undef HP |
563 | 570 |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
631 kSizeOfCODE_AGE__##name, | 638 kSizeOfCODE_AGE__##name, |
632 CODE_AGE_LIST_COMPLETE(COUNTER_ID) | 639 CODE_AGE_LIST_COMPLETE(COUNTER_ID) |
633 #undef COUNTER_ID | 640 #undef COUNTER_ID |
634 stats_counter_count | 641 stats_counter_count |
635 }; | 642 }; |
636 | 643 |
637 void ResetCounters(); | 644 void ResetCounters(); |
638 void ResetHistograms(); | 645 void ResetHistograms(); |
639 | 646 |
640 private: | 647 private: |
| 648 #define HR(name, caption) Histogram name##_; |
| 649 HISTOGRAM_RANGE_LIST(HR) |
| 650 #undef HR |
| 651 |
641 #define HT(name, caption) \ | 652 #define HT(name, caption) \ |
642 HistogramTimer name##_; | 653 HistogramTimer name##_; |
643 HISTOGRAM_TIMER_LIST(HT) | 654 HISTOGRAM_TIMER_LIST(HT) |
644 #undef HT | 655 #undef HT |
645 | 656 |
646 #define HP(name, caption) \ | 657 #define HP(name, caption) \ |
647 Histogram name##_; | 658 Histogram name##_; |
648 HISTOGRAM_PERCENTAGE_LIST(HP) | 659 HISTOGRAM_PERCENTAGE_LIST(HP) |
649 #undef HP | 660 #undef HP |
650 | 661 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
686 friend class Isolate; | 697 friend class Isolate; |
687 | 698 |
688 explicit Counters(Isolate* isolate); | 699 explicit Counters(Isolate* isolate); |
689 | 700 |
690 DISALLOW_IMPLICIT_CONSTRUCTORS(Counters); | 701 DISALLOW_IMPLICIT_CONSTRUCTORS(Counters); |
691 }; | 702 }; |
692 | 703 |
693 } } // namespace v8::internal | 704 } } // namespace v8::internal |
694 | 705 |
695 #endif // V8_COUNTERS_H_ | 706 #endif // V8_COUNTERS_H_ |
OLD | NEW |