OLD | NEW |
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/compiler-specific.h" | 8 #include "src/base/compiler-specific.h" |
9 #include "src/base/platform/platform.h" | 9 #include "src/base/platform/platform.h" |
10 #include "src/counters.h" | 10 #include "src/counters.h" |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 F(SCAVENGER_OBJECT_GROUPS) \ | 105 F(SCAVENGER_OBJECT_GROUPS) \ |
106 F(SCAVENGER_OLD_TO_NEW_POINTERS) \ | 106 F(SCAVENGER_OLD_TO_NEW_POINTERS) \ |
107 F(SCAVENGER_ROOTS) \ | 107 F(SCAVENGER_ROOTS) \ |
108 F(SCAVENGER_SCAVENGE) \ | 108 F(SCAVENGER_SCAVENGE) \ |
109 F(SCAVENGER_SEMISPACE) \ | 109 F(SCAVENGER_SEMISPACE) \ |
110 F(SCAVENGER_WEAK) | 110 F(SCAVENGER_WEAK) |
111 | 111 |
112 #define TRACE_GC(tracer, scope_id) \ | 112 #define TRACE_GC(tracer, scope_id) \ |
113 GCTracer::Scope::ScopeId gc_tracer_scope_id(scope_id); \ | 113 GCTracer::Scope::ScopeId gc_tracer_scope_id(scope_id); \ |
114 GCTracer::Scope gc_tracer_scope(tracer, gc_tracer_scope_id); \ | 114 GCTracer::Scope gc_tracer_scope(tracer, gc_tracer_scope_id); \ |
115 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8"), \ | 115 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.gc"), \ |
116 GCTracer::Scope::Name(gc_tracer_scope_id)) | 116 GCTracer::Scope::Name(gc_tracer_scope_id)) |
117 | 117 |
118 // GCTracer collects and prints ONE line after each garbage collector | 118 // GCTracer collects and prints ONE line after each garbage collector |
119 // invocation IFF --trace_gc is used. | 119 // invocation IFF --trace_gc is used. |
120 // TODO(ernstm): Unit tests. | 120 // TODO(ernstm): Unit tests. |
121 class GCTracer { | 121 class GCTracer { |
122 public: | 122 public: |
123 class Scope { | 123 class Scope { |
124 public: | 124 public: |
125 enum ScopeId { | 125 enum ScopeId { |
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
490 RingBuffer<BytesAndDuration> recorded_old_generation_allocations_; | 490 RingBuffer<BytesAndDuration> recorded_old_generation_allocations_; |
491 RingBuffer<double> recorded_context_disposal_times_; | 491 RingBuffer<double> recorded_context_disposal_times_; |
492 RingBuffer<double> recorded_survival_ratios_; | 492 RingBuffer<double> recorded_survival_ratios_; |
493 | 493 |
494 DISALLOW_COPY_AND_ASSIGN(GCTracer); | 494 DISALLOW_COPY_AND_ASSIGN(GCTracer); |
495 }; | 495 }; |
496 } // namespace internal | 496 } // namespace internal |
497 } // namespace v8 | 497 } // namespace v8 |
498 | 498 |
499 #endif // V8_HEAP_GC_TRACER_H_ | 499 #endif // V8_HEAP_GC_TRACER_H_ |
OLD | NEW |