Commit 82d645e5 authored by Anton Bikineev's avatar Anton Bikineev Committed by Commit Bot

Oilpan: Remove unused lazy_sweep flag from NormalPage.

Change-Id: Ie81593dafa4e19f7d816b990fc81496d67634b9f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1660857Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Reviewed-by: default avatarMichael Lippautz <mlippautz@chromium.org>
Commit-Queue: Anton Bikineev <bikineev@chromium.org>
Cr-Commit-Position: refs/heads/master@{#669655}
parent 75caba1f
...@@ -312,15 +312,6 @@ bool BaseArena::LazySweepWithDeadline(TimeTicks deadline) { ...@@ -312,15 +312,6 @@ bool BaseArena::LazySweepWithDeadline(TimeTicks deadline) {
DCHECK(GetThreadState()->SweepForbidden()); DCHECK(GetThreadState()->SweepForbidden());
DCHECK(ScriptForbiddenScope::IsScriptForbidden()); DCHECK(ScriptForbiddenScope::IsScriptForbidden());
NormalPageArena* normal_arena = nullptr;
if (BasePage* top = unswept_pages_.Top()) {
if (!top->IsLargeObjectPage()) {
// Mark this NormalPageArena as being lazily swept.
NormalPage* normal_page = static_cast<NormalPage*>(top);
normal_arena = normal_page->ArenaForNormalPage();
normal_arena->SetIsLazySweeping(true);
}
}
int page_count = 1; int page_count = 1;
// TODO(bikineev): We should probably process pages in the reverse order. This // TODO(bikineev): We should probably process pages in the reverse order. This
// will leave more work for concurrent sweeper and reduce memory footprint // will leave more work for concurrent sweeper and reduce memory footprint
...@@ -330,8 +321,6 @@ bool BaseArena::LazySweepWithDeadline(TimeTicks deadline) { ...@@ -330,8 +321,6 @@ bool BaseArena::LazySweepWithDeadline(TimeTicks deadline) {
if (page_count % kDeadlineCheckInterval == 0) { if (page_count % kDeadlineCheckInterval == 0) {
if (deadline <= CurrentTimeTicks()) { if (deadline <= CurrentTimeTicks()) {
// Deadline has come. // Deadline has come.
if (normal_arena)
normal_arena->SetIsLazySweeping(false);
return SweepingAndFinalizationCompleted(); return SweepingAndFinalizationCompleted();
} }
} }
...@@ -343,8 +332,6 @@ bool BaseArena::LazySweepWithDeadline(TimeTicks deadline) { ...@@ -343,8 +332,6 @@ bool BaseArena::LazySweepWithDeadline(TimeTicks deadline) {
if (page_count % kDeadlineCheckInterval == 0) { if (page_count % kDeadlineCheckInterval == 0) {
if (deadline <= CurrentTimeTicks()) { if (deadline <= CurrentTimeTicks()) {
// Deadline has come. // Deadline has come.
if (normal_arena)
normal_arena->SetIsLazySweeping(false);
return SweepingAndFinalizationCompleted(); return SweepingAndFinalizationCompleted();
} }
} }
...@@ -355,16 +342,12 @@ bool BaseArena::LazySweepWithDeadline(TimeTicks deadline) { ...@@ -355,16 +342,12 @@ bool BaseArena::LazySweepWithDeadline(TimeTicks deadline) {
if (page_count % kDeadlineCheckInterval == 0) { if (page_count % kDeadlineCheckInterval == 0) {
if (deadline <= CurrentTimeTicks()) { if (deadline <= CurrentTimeTicks()) {
// Deadline has come. // Deadline has come.
if (normal_arena)
normal_arena->SetIsLazySweeping(false);
return SweepingAndFinalizationCompleted(); return SweepingAndFinalizationCompleted();
} }
} }
page_count++; page_count++;
} }
if (normal_arena)
normal_arena->SetIsLazySweeping(false);
return true; return true;
} }
...@@ -415,8 +398,7 @@ NormalPageArena::NormalPageArena(ThreadState* state, int index) ...@@ -415,8 +398,7 @@ NormalPageArena::NormalPageArena(ThreadState* state, int index)
current_allocation_point_(nullptr), current_allocation_point_(nullptr),
remaining_allocation_size_(0), remaining_allocation_size_(0),
last_remaining_allocation_size_(0), last_remaining_allocation_size_(0),
promptly_freed_size_(0), promptly_freed_size_(0) {
is_lazy_sweeping_(false) {
ClearFreeLists(); ClearFreeLists();
} }
...@@ -827,7 +809,6 @@ Address NormalPageArena::AllocateFromFreeList(size_t allocation_size, ...@@ -827,7 +809,6 @@ Address NormalPageArena::AllocateFromFreeList(size_t allocation_size,
Address NormalPageArena::LazySweepPages(size_t allocation_size, Address NormalPageArena::LazySweepPages(size_t allocation_size,
size_t gc_info_index) { size_t gc_info_index) {
DCHECK(!HasCurrentAllocationArea()); DCHECK(!HasCurrentAllocationArea());
base::AutoReset<bool> is_lazy_sweeping(&is_lazy_sweeping_, true);
Address result = nullptr; Address result = nullptr;
// First, process unfinalized pages as finalizing a page is faster than // First, process unfinalized pages as finalizing a page is faster than
// sweeping. // sweeping.
......
...@@ -900,9 +900,6 @@ class PLATFORM_EXPORT NormalPageArena final : public BaseArena { ...@@ -900,9 +900,6 @@ class PLATFORM_EXPORT NormalPageArena final : public BaseArena {
return header->PayloadEnd() == current_allocation_point_; return header->PayloadEnd() == current_allocation_point_;
} }
bool IsLazySweeping() const { return is_lazy_sweeping_; }
void SetIsLazySweeping(bool sweeping) { is_lazy_sweeping_ = sweeping; }
size_t ArenaSize(); size_t ArenaSize();
size_t FreeListSize(); size_t FreeListSize();
...@@ -957,8 +954,6 @@ class PLATFORM_EXPORT NormalPageArena final : public BaseArena { ...@@ -957,8 +954,6 @@ class PLATFORM_EXPORT NormalPageArena final : public BaseArena {
// zero before sweeping when clearing the free list and after coalescing. // zero before sweeping when clearing the free list and after coalescing.
// It will increase for promptly freed objects on already swept pages. // It will increase for promptly freed objects on already swept pages.
size_t promptly_freed_size_; size_t promptly_freed_size_;
bool is_lazy_sweeping_;
}; };
class LargeObjectArena final : public BaseArena { class LargeObjectArena final : public BaseArena {
......
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