[heap] Ensure that sweeping is completed in ConcurrentMarking cctests.

Bug: chromium:694255
Change-Id: I5dc6157126544f20bca0ddee967e1d08d69bb060
Reviewed-on: https://chromium-review.googlesource.com/707104
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#48380}
This commit is contained in:
Ulan Degenbaev 2017-10-09 14:33:53 +02:00 committed by Commit Bot
parent 12008bcc41
commit b54c1a6ef6

View File

@ -33,6 +33,10 @@ TEST(ConcurrentMarking) {
Heap* heap = CcTest::heap();
CcTest::CollectAllGarbage();
if (!heap->incremental_marking()->IsStopped()) return;
MarkCompactCollector* collector = CcTest::heap()->mark_compact_collector();
if (collector->sweeping_in_progress()) {
collector->EnsureSweepingCompleted();
}
ConcurrentMarking::MarkingWorklist shared, bailout;
WeakObjects weak_objects;
ConcurrentMarking* concurrent_marking =
@ -49,6 +53,11 @@ TEST(ConcurrentMarkingReschedule) {
Heap* heap = CcTest::heap();
CcTest::CollectAllGarbage();
if (!heap->incremental_marking()->IsStopped()) return;
MarkCompactCollector* collector = CcTest::heap()->mark_compact_collector();
if (collector->sweeping_in_progress()) {
collector->EnsureSweepingCompleted();
}
ConcurrentMarking::MarkingWorklist shared, bailout;
WeakObjects weak_objects;
ConcurrentMarking* concurrent_marking =