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 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
365 // Discard all recorded survival events. | 365 // Discard all recorded survival events. |
366 void ResetSurvivalEvents(); | 366 void ResetSurvivalEvents(); |
367 | 367 |
368 // Returns the average speed of the events in the buffer. | 368 // Returns the average speed of the events in the buffer. |
369 // If the buffer is empty, the result is 0. | 369 // If the buffer is empty, the result is 0. |
370 // Otherwise, the result is between 1 byte/ms and 1 GB/ms. | 370 // Otherwise, the result is between 1 byte/ms and 1 GB/ms. |
371 static double AverageSpeed(const RingBuffer<BytesAndDuration>& buffer); | 371 static double AverageSpeed(const RingBuffer<BytesAndDuration>& buffer); |
372 static double AverageSpeed(const RingBuffer<BytesAndDuration>& buffer, | 372 static double AverageSpeed(const RingBuffer<BytesAndDuration>& buffer, |
373 const BytesAndDuration& initial, double time_ms); | 373 const BytesAndDuration& initial, double time_ms); |
374 | 374 |
| 375 void ResetForTesting(); |
| 376 |
375 private: | 377 private: |
376 // Print one detailed trace line in name=value format. | 378 // Print one detailed trace line in name=value format. |
377 // TODO(ernstm): Move to Heap. | 379 // TODO(ernstm): Move to Heap. |
378 void PrintNVP() const; | 380 void PrintNVP() const; |
379 | 381 |
380 // Print one trace line. | 382 // Print one trace line. |
381 // TODO(ernstm): Move to Heap. | 383 // TODO(ernstm): Move to Heap. |
382 void Print() const; | 384 void Print() const; |
383 | 385 |
384 // Prints a line and also adds it to the heap's ring buffer so that | 386 // Prints a line and also adds it to the heap's ring buffer so that |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
490 RingBuffer<BytesAndDuration> recorded_old_generation_allocations_; | 492 RingBuffer<BytesAndDuration> recorded_old_generation_allocations_; |
491 RingBuffer<double> recorded_context_disposal_times_; | 493 RingBuffer<double> recorded_context_disposal_times_; |
492 RingBuffer<double> recorded_survival_ratios_; | 494 RingBuffer<double> recorded_survival_ratios_; |
493 | 495 |
494 DISALLOW_COPY_AND_ASSIGN(GCTracer); | 496 DISALLOW_COPY_AND_ASSIGN(GCTracer); |
495 }; | 497 }; |
496 } // namespace internal | 498 } // namespace internal |
497 } // namespace v8 | 499 } // namespace v8 |
498 | 500 |
499 #endif // V8_HEAP_GC_TRACER_H_ | 501 #endif // V8_HEAP_GC_TRACER_H_ |
OLD | NEW |