From 0257c539bbee2e475af843d347a506173c0c34f7 Mon Sep 17 00:00:00 2001 From: Michael Lippautz Date: Wed, 20 Sep 2017 12:08:54 +0900 Subject: [PATCH] [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 Commit-Queue: Michael Lippautz Cr-Commit-Position: refs/heads/master@{#48087} --- src/heap/mark-compact.cc | 4 +++- src/heap/mark-compact.h | 2 -- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/heap/mark-compact.cc b/src/heap/mark-compact.cc index c3f7630b13..0a6e640b87 100644 --- a/src/heap/mark-compact.cc +++ b/src/heap/mark-compact.cc @@ -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() {} diff --git a/src/heap/mark-compact.h b/src/heap/mark-compact.h index f54ee4eb36..923a734294 100644 --- a/src/heap/mark-compact.h +++ b/src/heap/mark-compact.h @@ -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_);