Chromium Code Reviews| Index: src/heap/gc-tracer.cc |
| diff --git a/src/heap/gc-tracer.cc b/src/heap/gc-tracer.cc |
| index a0f1c464cc26f33d1dae45c36a1f5ac76a606a6c..035e3ee0c493c75fa1cc3f583c23ccd04da30358 100644 |
| --- a/src/heap/gc-tracer.cc |
| +++ b/src/heap/gc-tracer.cc |
| @@ -418,5 +418,22 @@ intptr_t GCTracer::ScavengeSpeedInBytesPerMillisecond() const { |
| return static_cast<intptr_t>(bytes / durations); |
| } |
| + |
| + |
| +intptr_t GCTracer::MarkCompactSpeedInBytesPerMillisecond() const { |
|
Hannes Payer (out of office)
2014/08/21 09:47:53
The GCTracer functions should also operate on size
ulan
2014/08/21 11:44:00
Acknowledged.
|
| + intptr_t bytes = 0; |
| + double durations = 0.0; |
| + EventBuffer::const_iterator iter = mark_compactor_events_.begin(); |
| + while (iter != mark_compactor_events_.end()) { |
| + bytes += iter->start_object_size; |
| + durations += iter->end_time - iter->start_time + |
| + iter->pure_incremental_marking_duration; |
| + ++iter; |
| + } |
| + |
| + if (durations == 0.0) return 0; |
| + |
| + return static_cast<intptr_t>(bytes / durations); |
| +} |
| } |
| } // namespace v8::internal |