Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(77)

Side by Side Diff: src/heap/gc-tracer.h

Issue 1826833002: Reland of [counters] adding runtime call timers for GC (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/counters.cc ('k') | src/heap/gc-tracer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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_HEAP_GC_TRACER_H_ 5 #ifndef V8_HEAP_GC_TRACER_H_
6 #define V8_HEAP_GC_TRACER_H_ 6 #define V8_HEAP_GC_TRACER_H_
7 7
8 #include "src/base/platform/platform.h" 8 #include "src/base/platform/platform.h"
9 #include "src/counters.h"
9 #include "src/globals.h" 10 #include "src/globals.h"
10 11
11 namespace v8 { 12 namespace v8 {
12 namespace internal { 13 namespace internal {
13 14
14 // A simple ring buffer class with maximum size known at compile time. 15 // A simple ring buffer class with maximum size known at compile time.
15 // The class only implements the functionality required in GCTracer. 16 // The class only implements the functionality required in GCTracer.
16 template <typename T, size_t MAX_SIZE> 17 template <typename T, size_t MAX_SIZE>
17 class RingBuffer { 18 class RingBuffer {
18 public: 19 public:
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 T elements_[MAX_SIZE + 1]; 82 T elements_[MAX_SIZE + 1];
82 size_t begin_; 83 size_t begin_;
83 size_t end_; 84 size_t end_;
84 85
85 DISALLOW_COPY_AND_ASSIGN(RingBuffer); 86 DISALLOW_COPY_AND_ASSIGN(RingBuffer);
86 }; 87 };
87 88
88 89
89 enum ScavengeSpeedMode { kForAllObjects, kForSurvivedObjects }; 90 enum ScavengeSpeedMode { kForAllObjects, kForSurvivedObjects };
90 91
91
92 // GCTracer collects and prints ONE line after each garbage collector 92 // GCTracer collects and prints ONE line after each garbage collector
93 // invocation IFF --trace_gc is used. 93 // invocation IFF --trace_gc is used.
94 // TODO(ernstm): Unit tests. 94 // TODO(ernstm): Unit tests.
95 class GCTracer { 95 class GCTracer {
96 public: 96 public:
97 class Scope { 97 class Scope {
98 public: 98 public:
99 enum ScopeId { 99 enum ScopeId {
100 EXTERNAL_WEAK_GLOBAL_HANDLES, 100 EXTERNAL_WEAK_GLOBAL_HANDLES,
101 MC_CLEAR, 101 MC_CLEAR,
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 NUMBER_OF_SCOPES 145 NUMBER_OF_SCOPES
146 }; 146 };
147 147
148 Scope(GCTracer* tracer, ScopeId scope); 148 Scope(GCTracer* tracer, ScopeId scope);
149 ~Scope(); 149 ~Scope();
150 150
151 private: 151 private:
152 GCTracer* tracer_; 152 GCTracer* tracer_;
153 ScopeId scope_; 153 ScopeId scope_;
154 double start_time_; 154 double start_time_;
155 RuntimeCallTimer timer_;
155 156
156 DISALLOW_COPY_AND_ASSIGN(Scope); 157 DISALLOW_COPY_AND_ASSIGN(Scope);
157 }; 158 };
158 159
159 160
160 class AllocationEvent { 161 class AllocationEvent {
161 public: 162 public:
162 // Default constructor leaves the event uninitialized. 163 // Default constructor leaves the event uninitialized.
163 AllocationEvent() {} 164 AllocationEvent() {}
164 165
(...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after
606 // Accumulated duration and allocated bytes since the last GC. 607 // Accumulated duration and allocated bytes since the last GC.
607 double allocation_duration_since_gc_; 608 double allocation_duration_since_gc_;
608 size_t new_space_allocation_in_bytes_since_gc_; 609 size_t new_space_allocation_in_bytes_since_gc_;
609 size_t old_generation_allocation_in_bytes_since_gc_; 610 size_t old_generation_allocation_in_bytes_since_gc_;
610 611
611 double combined_mark_compact_speed_cache_; 612 double combined_mark_compact_speed_cache_;
612 613
613 // Counts how many tracers were started without stopping. 614 // Counts how many tracers were started without stopping.
614 int start_counter_; 615 int start_counter_;
615 616
617 // Separate timer used for --runtime_call_stats
618 RuntimeCallTimer timer_;
619
616 DISALLOW_COPY_AND_ASSIGN(GCTracer); 620 DISALLOW_COPY_AND_ASSIGN(GCTracer);
617 }; 621 };
618 } // namespace internal 622 } // namespace internal
619 } // namespace v8 623 } // namespace v8
620 624
621 #endif // V8_HEAP_GC_TRACER_H_ 625 #endif // V8_HEAP_GC_TRACER_H_
OLDNEW
« no previous file with comments | « src/counters.cc ('k') | src/heap/gc-tracer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698