Perform full GC if incremental marking is completed or marking deque is empty.
authorhpayer <hpayer@chromium.org>
Mon, 26 Jan 2015 14:54:58 +0000 (06:54 -0800)
committerCommit bot <commit-bot@chromium.org>
Mon, 26 Jan 2015 14:55:13 +0000 (14:55 +0000)
BUG=

Review URL: https://codereview.chromium.org/874993003

Cr-Commit-Position: refs/heads/master@{#26272}

src/heap/heap.cc

index d455094..bc55f9e 100644 (file)
@@ -827,7 +827,8 @@ bool Heap::CollectGarbage(GarbageCollector collector, const char* gc_reason,
     const intptr_t kStepSizeWhenDelayedByScavenge = 1 * MB;
     incremental_marking()->Step(kStepSizeWhenDelayedByScavenge,
                                 IncrementalMarking::NO_GC_VIA_STACK_GUARD);
-    if (!incremental_marking()->IsComplete() && !FLAG_gc_global) {
+    if (!incremental_marking()->IsComplete() &&
+        !mark_compact_collector_.marking_deque_.IsEmpty() && !FLAG_gc_global) {
       if (FLAG_trace_incremental_marking) {
         PrintF("[IncrementalMarking] Delaying MarkSweep.\n");
       }