Chromium Code Reviews| Index: src/heap/gc-tracer.cc |
| diff --git a/src/heap/gc-tracer.cc b/src/heap/gc-tracer.cc |
| index 12de0e457e500d47ca8e77b1dffff435b53fd12a..a0f1c464cc26f33d1dae45c36a1f5ac76a606a6c 100644 |
| --- a/src/heap/gc-tracer.cc |
| +++ b/src/heap/gc-tracer.cc |
| @@ -103,6 +103,8 @@ void GCTracer::Start(GarbageCollector collector, const char* gc_reason, |
| current_.start_object_size = heap_->SizeOfObjects(); |
| current_.start_memory_size = heap_->isolate()->memory_allocator()->Size(); |
| current_.start_holes_size = CountTotalHolesSize(heap_); |
| + current_.new_space_object_size = |
| + heap_->new_space()->top() - heap_->new_space()->bottom(); |
|
Hannes Payer (out of office)
2014/08/19 11:52:59
The question here is: What is the right size we ca
|
| current_.cumulative_incremental_marking_steps = |
| cumulative_incremental_marking_steps_; |
| @@ -296,6 +298,8 @@ void GCTracer::PrintNVP() const { |
| if (current_.type == Event::SCAVENGER) { |
| PrintF("steps_count=%d ", current_.incremental_marking_steps); |
| PrintF("steps_took=%.1f ", current_.incremental_marking_duration); |
| + PrintF("scavenge_throughput=%" V8_PTR_PREFIX "d ", |
| + ScavengeSpeedInBytesPerMillisecond()); |
| } else { |
| PrintF("steps_count=%d ", current_.incremental_marking_steps); |
| PrintF("steps_took=%.1f ", current_.incremental_marking_duration); |
| @@ -398,5 +402,21 @@ intptr_t GCTracer::IncrementalMarkingSpeedInBytesPerMillisecond() const { |
| return static_cast<intptr_t>(bytes / durations); |
| } |
| + |
| + |
| +intptr_t GCTracer::ScavengeSpeedInBytesPerMillisecond() const { |
| + intptr_t bytes = 0; |
| + double durations = 0.0; |
| + EventBuffer::const_iterator iter = scavenger_events_.begin(); |
| + while (iter != scavenger_events_.end()) { |
| + bytes += iter->new_space_object_size; |
| + durations += iter->end_time - iter->start_time; |
| + ++iter; |
| + } |
| + |
| + if (durations == 0.0) return 0; |
| + |
| + return static_cast<intptr_t>(bytes / durations); |
| +} |
| } |
| } // namespace v8::internal |