[heap] Remove clear on tearing down marking work list when not marking

The work list should be empty in the case we are not tearing down
during incremental marking. Explicitly clear during incremental marking
and rely on DCHECKs for the other case.

Bug: chromium:758570
Change-Id: Iecc8935f0cbfda67f0e7afde42930050e7c94d2d
Reviewed-on: https://chromium-review.googlesource.com/674504
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#48087}
This commit is contained in:
Michael Lippautz 2017-09-20 12:08:54 +09:00 committed by Commit Bot
parent e80cbe03f8
commit 0257c539bb
2 changed files with 3 additions and 3 deletions

View File

@ -470,7 +470,9 @@ void MinorMarkCompactCollector::SetUp() {}
void MarkCompactCollector::TearDown() {
AbortCompaction();
AbortWeakObjects();
marking_worklist()->TearDown();
if (heap()->incremental_marking()->IsMarking()) {
marking_worklist()->Clear();
}
}
void MinorMarkCompactCollector::TearDown() {}

View File

@ -537,8 +537,6 @@ class MarkCompactCollector final : public MarkCompactCollectorBase {
ConcurrentMarkingWorklist* shared() { return &shared_; }
ConcurrentMarkingWorklist* bailout() { return &bailout_; }
void TearDown() { Clear(); }
void Print() {
PrintWorklist("shared", &shared_);
PrintWorklist("bailout", &bailout_);