Chromium Code Reviews| Index: src/heap/heap.cc |
| diff --git a/src/heap/heap.cc b/src/heap/heap.cc |
| index 76046641cd4f07ee6b44262ae100e914bf03af61..32461c152dbeb54cd829a8f756ffeaea73268d34 100644 |
| --- a/src/heap/heap.cc |
| +++ b/src/heap/heap.cc |
| @@ -846,7 +846,7 @@ bool Heap::CollectGarbage(GarbageCollector collector, const char* gc_reason, |
| // generator needs incremental marking to stay off after it aborted. |
| if (!mark_compact_collector()->abort_incremental_marking() && |
| incremental_marking()->IsStopped() && |
| - incremental_marking()->WorthActivating() && NextGCIsLikelyToBeFull()) { |
| + WorthActivatingIncrementalMarking()) { |
| incremental_marking()->Start(); |
| } |
| @@ -4283,6 +4283,11 @@ void Heap::AdvanceIdleIncrementalMarking(intptr_t step_size) { |
| } |
| +bool Heap::WorthActivatingIncrementalMarking() { |
| + return incremental_marking()->WorthActivating() && NextGCIsLikelyToBeFull(); |
|
Hannes Payer (out of office)
2014/08/21 15:46:20
We could also move the IsStopped check into this f
|
| +} |
| + |
| + |
| bool Heap::IdleNotification(int idle_time_in_ms) { |
| // If incremental marking is off, we do not perform idle notification. |
| if (!FLAG_incremental_marking) return true; |
| @@ -4291,9 +4296,16 @@ bool Heap::IdleNotification(int idle_time_in_ms) { |
| HistogramTimerScope idle_notification_scope( |
| isolate_->counters()->gc_idle_notification()); |
| - GCIdleTimeAction action = gc_idle_time_handler_.Compute( |
| - idle_time_in_ms, contexts_disposed_, static_cast<size_t>(SizeOfObjects()), |
| - incremental_marking()->IsStopped(), tracer()); |
| + GCIdleTimeHandler::HeapState heap_state; |
| + heap_state.contexts_disposed = contexts_disposed_; |
| + heap_state.size_of_objects = static_cast<size_t>(SizeOfObjects()); |
| + heap_state.incremental_marking_stopped = incremental_marking()->IsStopped(); |
| + heap_state.can_start_incremental_marking = |
| + incremental_marking()->IsStopped() && WorthActivatingIncrementalMarking(); |
| + |
| + GCIdleTimeAction action = |
| + gc_idle_time_handler_.Compute(idle_time_in_ms, heap_state, tracer()); |
| + |
| contexts_disposed_ = 0; |
| bool result = false; |
| switch (action.type) { |