Index: src/heap.cc |
diff --git a/src/heap.cc b/src/heap.cc |
index b3b2df9148fde8a0719bd91d3f214f1bd71d464e..a7c7b34eaea41b8e3eb9cc5a774537c0946249ac 100644 |
--- a/src/heap.cc |
+++ b/src/heap.cc |
@@ -651,9 +651,6 @@ bool Heap::CollectGarbage(AllocationSpace space, |
PerformGarbageCollection(collector, &tracer); |
} |
- ASSERT(collector == SCAVENGER || incremental_marking()->IsStopped()); |
- |
- // This can do debug callbacks and restart incremental marking. |
GarbageCollectionEpilogue(); |
} |
@@ -960,6 +957,10 @@ bool Heap::PerformGarbageCollection(GarbageCollector collector, |
isolate_->counters()->objs_since_last_young()->Set(0); |
+ // Callbacks that fire after this point might trigger nested GCs and |
+ // restart incremental marking, the assertion can't be moved down. |
+ ASSERT(collector == SCAVENGER || incremental_marking()->IsStopped()); |
+ |
gc_post_processing_depth_++; |
{ DisableAssertNoAllocation allow_allocation; |
GCTracer::Scope scope(tracer, GCTracer::Scope::EXTERNAL); |