Reviewers: ulan,

Description:
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.

[email protected]
TEST=cctest/test-api --stress-compaction


Please review this at https://codereview.chromium.org/11413188/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files:
  M src/heap.cc


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);


--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to