From d8922dd6f4acf90029eb7101fe0ec153be112cfd Mon Sep 17 00:00:00 2001 From: "mstarzinger@chromium.org" Date: Tue, 27 Nov 2012 17:03:12 +0000 Subject: [PATCH] Move assertion about stopped marking up (again). Weak persistent handle callbacks might trigger nested GCs that in turn can cause marking to be restarted. The assertion needs to hold before firing callbacks only. R=ulan@chromium.org TEST=cctest/test-api --stress-compaction Review URL: https://codereview.chromium.org/11413188 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13069 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/heap.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/heap.cc b/src/heap.cc index b3b2df9..a7c7b34 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); -- 2.7.4