Commit 7ca036bf authored by hpayer's avatar hpayer Committed by Commit bot

[heap] Clean-up uses of EnsureSweepingComplete uses.

BUG=

Review-Url: https://codereview.chromium.org/2566133002
Cr-Commit-Position: refs/heads/master@{#41654}
parent 769442a1
......@@ -4046,9 +4046,7 @@ void Heap::MakeHeapIterable() {
CollectAllGarbage(kMakeHeapIterableMask,
GarbageCollectionReason::kMakeHeapIterable);
}
if (mark_compact_collector()->sweeping_in_progress()) {
mark_compact_collector()->EnsureSweepingCompleted();
}
mark_compact_collector()->EnsureSweepingCompleted();
DCHECK(IsHeapIterable());
}
......@@ -4698,10 +4696,8 @@ void Heap::Verify() {
CHECK(HasBeenSetUp());
HandleScope scope(isolate());
if (mark_compact_collector()->sweeping_in_progress()) {
// We have to wait here for the sweeper threads to have an iterable heap.
mark_compact_collector()->EnsureSweepingCompleted();
}
// We have to wait here for the sweeper threads to have an iterable heap.
mark_compact_collector()->EnsureSweepingCompleted();
VerifyPointersVisitor visitor;
IterateRoots(&visitor, VISIT_ONLY_STRONG);
......
......@@ -776,10 +776,8 @@ void MarkCompactCollector::Prepare() {
DCHECK(!FLAG_never_compact || !FLAG_always_compact);
if (sweeping_in_progress()) {
// Instead of waiting we could also abort the sweeper threads here.
EnsureSweepingCompleted();
}
// Instead of waiting we could also abort the sweeper threads here.
EnsureSweepingCompleted();
if (heap()->incremental_marking()->IsSweeping()) {
heap()->incremental_marking()->Stop();
......
......@@ -2792,7 +2792,6 @@ void PagedSpace::RepairFreeListsAfterDeserialization() {
}
}
HeapObject* PagedSpace::SweepAndRetryAllocation(int size_in_bytes) {
MarkCompactCollector* collector = heap()->mark_compact_collector();
if (collector->sweeping_in_progress()) {
......@@ -2806,7 +2805,6 @@ HeapObject* PagedSpace::SweepAndRetryAllocation(int size_in_bytes) {
return nullptr;
}
HeapObject* CompactionSpace::SweepAndRetryAllocation(int size_in_bytes) {
MarkCompactCollector* collector = heap()->mark_compact_collector();
if (collector->sweeping_in_progress()) {
......@@ -2863,9 +2861,7 @@ void PagedSpace::ReportStatistics() {
", available: %" V8PRIdPTR ", %%%d\n",
Capacity(), Waste(), Available(), pct);
if (heap()->mark_compact_collector()->sweeping_in_progress()) {
heap()->mark_compact_collector()->EnsureSweepingCompleted();
}
heap()->mark_compact_collector()->EnsureSweepingCompleted();
ClearHistograms(heap()->isolate());
HeapObjectIterator obj_it(this);
for (HeapObject* obj = obj_it.Next(); obj != NULL; obj = obj_it.Next())
......
......@@ -2258,9 +2258,7 @@ void Isolate::Deinit() {
optimizing_compile_dispatcher_ = NULL;
}
if (heap_.mark_compact_collector()->sweeping_in_progress()) {
heap_.mark_compact_collector()->EnsureSweepingCompleted();
}
heap_.mark_compact_collector()->EnsureSweepingCompleted();
DumpAndResetCompilationStats();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment