Commit 20196642 authored by Hannes Payer's avatar Hannes Payer Committed by Commit Bot

[heap] Use std::vector in Sweeper everywhere.

Bug: v8:9093
Change-Id: I6d71e8ebd34e2495312b01facbb896e0d5ae8a8a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1581645
Auto-Submit: Hannes Payer <hpayer@chromium.org>
Commit-Queue: Hannes Payer <hpayer@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60988}
parent 7a2651cb
......@@ -155,12 +155,11 @@ void Sweeper::StartSweeping() {
heap_->mark_compact_collector()->non_atomic_marking_state();
ForAllSweepingSpaces([this, marking_state](AllocationSpace space) {
int space_index = GetSweepSpaceIndex(space);
std::sort(sweeping_list_[space_index].begin(),
sweeping_list_[space_index].end(),
[marking_state](Page* a, Page* b) {
return marking_state->live_bytes(a) <
marking_state->live_bytes(b);
});
std::sort(
sweeping_list_[space_index].begin(), sweeping_list_[space_index].end(),
[marking_state](Page* a, Page* b) {
return marking_state->live_bytes(a) > marking_state->live_bytes(b);
});
});
}
......@@ -503,8 +502,8 @@ Page* Sweeper::GetSweepingPageSafe(AllocationSpace space) {
int space_index = GetSweepSpaceIndex(space);
Page* page = nullptr;
if (!sweeping_list_[space_index].empty()) {
page = sweeping_list_[space_index].front();
sweeping_list_[space_index].pop_front();
page = sweeping_list_[space_index].back();
sweeping_list_[space_index].pop_back();
}
return page;
}
......
......@@ -24,7 +24,7 @@ enum FreeSpaceTreatmentMode { IGNORE_FREE_SPACE, ZAP_FREE_SPACE };
class Sweeper {
public:
using IterabilityList = std::vector<Page*>;
using SweepingList = std::deque<Page*>;
using SweepingList = std::vector<Page*>;
using SweptList = std::vector<Page*>;
// Pauses the sweeper tasks or completes sweeping.
......
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