Index: src/heap.cc |
diff --git a/src/heap.cc b/src/heap.cc |
index 976d65e959fdc35e50a8efe8964ff9e00a1388c4..9cc9b88865acfde2d220f4f693e440b0f724e2ec 100644 |
--- a/src/heap.cc |
+++ b/src/heap.cc |
@@ -644,13 +644,13 @@ bool Heap::CollectGarbage(AllocationSpace space, |
// Tell the tracer which collector we've selected. |
tracer.set_collector(collector); |
- HistogramTimer* rate = (collector == SCAVENGER) |
- ? isolate_->counters()->gc_scavenger() |
- : isolate_->counters()->gc_compactor(); |
- rate->Start(); |
- next_gc_likely_to_collect_more = |
- PerformGarbageCollection(collector, &tracer); |
- rate->Stop(); |
+ { |
+ HistogramTimerScope histogram_timer_scope( |
+ (collector == SCAVENGER) ? isolate_->counters()->gc_scavenger() |
+ : isolate_->counters()->gc_compactor()); |
+ next_gc_likely_to_collect_more = |
+ PerformGarbageCollection(collector, &tracer); |
+ } |
ASSERT(collector == SCAVENGER || incremental_marking()->IsStopped()); |