Index: src/heap/incremental-marking.cc |
diff --git a/src/heap/incremental-marking.cc b/src/heap/incremental-marking.cc |
index 7767bed6c3898a0eb093d8153c94999583eb729c..94d8d946f1ba27836d56a8c11e6a4042e35bf0aa 100644 |
--- a/src/heap/incremental-marking.cc |
+++ b/src/heap/incremental-marking.cc |
@@ -474,13 +474,21 @@ |
bool IncrementalMarking::CanBeActivated() { |
+#ifndef DEBUG |
+ static const intptr_t kActivationThreshold = 8 * MB; |
+#else |
+ // TODO(gc) consider setting this to some low level so that some |
+ // debug tests run with incremental marking and some without. |
+ static const intptr_t kActivationThreshold = 0; |
+#endif |
// Only start incremental marking in a safe state: 1) when incremental |
// marking is turned on, 2) when we are currently not in a GC, and |
// 3) when we are currently not serializing or deserializing the heap. |
// Don't switch on for very small heaps. |
return FLAG_incremental_marking && heap_->gc_state() == Heap::NOT_IN_GC && |
heap_->deserialization_complete() && |
- !heap_->isolate()->serializer_enabled(); |
+ !heap_->isolate()->serializer_enabled() && |
+ heap_->PromotedSpaceSizeOfObjects() > kActivationThreshold; |
} |