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