Commit 33dbc65b authored by Michael Lippautz's avatar Michael Lippautz Committed by Commit Bot

[heap] Simplify CompactionSpace::SweepAndRetry

Bug: v8:6923
Change-Id: Ic8c8829d39d482463309507719379cd17346b52a
Reviewed-on: https://chromium-review.googlesource.com/723179Reviewed-by: 's avatarHannes Payer <hpayer@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#48644}
parent 9b46f383
......@@ -710,13 +710,6 @@ void MarkCompactCollector::Sweeper::SweepOrWaitUntilSweepingCompleted(
}
}
void MarkCompactCollector::SweepAndRefill(CompactionSpace* space) {
if (FLAG_concurrent_sweeping && sweeper().sweeping_in_progress()) {
sweeper().ParallelSweepSpace(space->identity(), 0);
space->RefillFreeList();
}
}
Page* MarkCompactCollector::Sweeper::GetSweptPageSafe(PagedSpace* space) {
base::LockGuard<base::Mutex> guard(&mutex_);
SweptList& list = swept_list_[space->identity()];
......
......@@ -744,12 +744,6 @@ class MarkCompactCollector final : public MarkCompactCollectorBase {
// Note: Can only be called safely from main thread.
void EnsureSweepingCompleted();
// Help out in sweeping the corresponding space and refill memory that has
// been regained.
//
// Note: Thread-safe.
void SweepAndRefill(CompactionSpace* space);
// Checks if sweeping is in progress right now on any space.
bool sweeping_in_progress() { return sweeper().sweeping_in_progress(); }
......
......@@ -3165,8 +3165,9 @@ bool PagedSpace::SweepAndRetryAllocation(int size_in_bytes) {
bool CompactionSpace::SweepAndRetryAllocation(int size_in_bytes) {
MarkCompactCollector* collector = heap()->mark_compact_collector();
if (collector->sweeping_in_progress()) {
collector->SweepAndRefill(this);
if (FLAG_concurrent_sweeping && collector->sweeping_in_progress()) {
collector->sweeper().ParallelSweepSpace(identity(), 0);
RefillFreeList();
return free_list_.Allocate(size_in_bytes);
}
return false;
......
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