Commit 4776305e authored by Franziska Hinkelmann's avatar Franziska Hinkelmann Committed by Commit Bot

[cleanup] Make SweptList an std::vector.

There's no point in using our own implemention of List for this.

Bug:v8:6325

Change-Id: Ibe9a5c65df3c9ae577ece93616bcfa47f332c212
Reviewed-on: https://chromium-review.googlesource.com/489542Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
Reviewed-by: 's avatarDaniel Clifford <danno@chromium.org>
Commit-Queue: Franziska Hinkelmann <franzih@chromium.org>
Cr-Commit-Position: refs/heads/master@{#45738}
parent b4241540
...@@ -655,8 +655,10 @@ void MarkCompactCollector::SweepAndRefill(CompactionSpace* space) { ...@@ -655,8 +655,10 @@ void MarkCompactCollector::SweepAndRefill(CompactionSpace* space) {
Page* MarkCompactCollector::Sweeper::GetSweptPageSafe(PagedSpace* space) { Page* MarkCompactCollector::Sweeper::GetSweptPageSafe(PagedSpace* space) {
base::LockGuard<base::Mutex> guard(&mutex_); base::LockGuard<base::Mutex> guard(&mutex_);
SweptList& list = swept_list_[space->identity()]; SweptList& list = swept_list_[space->identity()];
if (list.length() > 0) { if (!list.empty()) {
return list.RemoveLast(); auto last_page = list.back();
list.pop_back();
return last_page;
} }
return nullptr; return nullptr;
} }
...@@ -678,7 +680,7 @@ void MarkCompactCollector::Sweeper::EnsureCompleted() { ...@@ -678,7 +680,7 @@ void MarkCompactCollector::Sweeper::EnsureCompleted() {
ForAllSweepingSpaces([this](AllocationSpace space) { ForAllSweepingSpaces([this](AllocationSpace space) {
if (space == NEW_SPACE) { if (space == NEW_SPACE) {
swept_list_[NEW_SPACE].Clear(); swept_list_[NEW_SPACE].clear();
} }
DCHECK(sweeping_list_[space].empty()); DCHECK(sweeping_list_[space].empty());
}); });
...@@ -4186,7 +4188,7 @@ void LiveObjectVisitor::RecomputeLiveBytes(MemoryChunk* chunk, ...@@ -4186,7 +4188,7 @@ void LiveObjectVisitor::RecomputeLiveBytes(MemoryChunk* chunk,
void MarkCompactCollector::Sweeper::AddSweptPageSafe(PagedSpace* space, void MarkCompactCollector::Sweeper::AddSweptPageSafe(PagedSpace* space,
Page* page) { Page* page) {
base::LockGuard<base::Mutex> guard(&mutex_); base::LockGuard<base::Mutex> guard(&mutex_);
swept_list_[space->identity()].Add(page); swept_list_[space->identity()].push_back(page);
} }
void MarkCompactCollector::Evacuate() { void MarkCompactCollector::Evacuate() {
...@@ -4650,7 +4652,7 @@ int MarkCompactCollector::Sweeper::ParallelSweepPage(Page* page, ...@@ -4650,7 +4652,7 @@ int MarkCompactCollector::Sweeper::ParallelSweepPage(Page* page,
{ {
base::LockGuard<base::Mutex> guard(&mutex_); base::LockGuard<base::Mutex> guard(&mutex_);
swept_list_[identity].Add(page); swept_list_[identity].push_back(page);
} }
return max_freed; return max_freed;
} }
......
...@@ -368,7 +368,7 @@ class MarkCompactCollector final : public MarkCompactCollectorBase { ...@@ -368,7 +368,7 @@ class MarkCompactCollector final : public MarkCompactCollectorBase {
}; };
typedef std::deque<Page*> SweepingList; typedef std::deque<Page*> SweepingList;
typedef List<Page*> SweptList; typedef std::vector<Page*> SweptList;
static int RawSweep(Page* p, FreeListRebuildingMode free_list_mode, static int RawSweep(Page* p, FreeListRebuildingMode free_list_mode,
FreeSpaceTreatmentMode free_space_mode); FreeSpaceTreatmentMode free_space_mode);
......
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