There are no evacuation candidates and slot buffers when marking is started.
authorhpayer <hpayer@chromium.org>
Fri, 20 Feb 2015 11:35:36 +0000 (03:35 -0800)
committerCommit bot <commit-bot@chromium.org>
Fri, 20 Feb 2015 11:35:51 +0000 (11:35 +0000)
BUG=

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

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

src/heap/mark-compact.cc

index b525bf6..961f5b3 100644 (file)
@@ -723,7 +723,12 @@ void MarkCompactCollector::CollectEvacuationCandidates(PagedSpace* space) {
   while (it.has_next()) {
     Page* p = it.next();
     if (p->NeverEvacuate()) continue;
-    p->ClearEvacuationCandidate();
+
+    // Invariant: Evacuation candidates are just created when marking is
+    // started. At the end of a GC all evacuation candidates are cleared and
+    // their slot buffers are released.
+    CHECK(!p->IsEvacuationCandidate());
+    CHECK(p->slots_buffer() == NULL);
 
     if (FLAG_stress_compaction) {
       unsigned int counter = space->heap()->ms_count();