Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(242)

Unified Diff: src/heap/spaces.cc

Issue 1614953002: [heap] Cleanup: Remove WAS_SWEPT flag. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressed comments Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/heap/spaces.h ('k') | src/heap/store-buffer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/spaces.cc
diff --git a/src/heap/spaces.cc b/src/heap/spaces.cc
index cdf1a193b60295099d38b111f09ebba3f550a9f8..3e3f593ae10a41b0f6681eeddf2d0b433077192f 100644
--- a/src/heap/spaces.cc
+++ b/src/heap/spaces.cc
@@ -35,7 +35,7 @@ HeapObjectIterator::HeapObjectIterator(Page* page) {
owner == page->heap()->code_space());
Initialize(reinterpret_cast<PagedSpace*>(owner), page->area_start(),
page->area_end(), kOnePageOnly);
- DCHECK(page->WasSwept() || page->SweepingCompleted());
+ DCHECK(page->SweepingDone());
}
@@ -66,7 +66,7 @@ bool HeapObjectIterator::AdvanceToNextPage() {
cur_page);
cur_addr_ = cur_page->area_start();
cur_end_ = cur_page->area_end();
- DCHECK(cur_page->WasSwept() || cur_page->SweepingCompleted());
+ DCHECK(cur_page->SweepingDone());
return true;
}
@@ -469,7 +469,7 @@ MemoryChunk* MemoryChunk::Initialize(Heap* heap, Address base, size_t size,
chunk->write_barrier_counter_ = kWriteBarrierCounterGranularity;
chunk->progress_bar_ = 0;
chunk->high_water_mark_.SetValue(static_cast<intptr_t>(area_start - base));
- chunk->parallel_sweeping_state().SetValue(kSweepingDone);
+ chunk->concurrent_sweeping_state().SetValue(kSweepingDone);
chunk->parallel_compaction_state().SetValue(kCompactingDone);
chunk->mutex_ = NULL;
chunk->available_in_small_free_list_ = 0;
@@ -480,7 +480,6 @@ MemoryChunk* MemoryChunk::Initialize(Heap* heap, Address base, size_t size,
chunk->ResetLiveBytes();
Bitmap::Clear(chunk);
chunk->initialize_scan_on_scavenge(false);
- chunk->SetFlag(WAS_SWEPT);
chunk->set_next_chunk(nullptr);
chunk->set_prev_chunk(nullptr);
@@ -923,7 +922,7 @@ bool MemoryAllocator::CommitExecutableMemory(base::VirtualMemory* vm,
void MemoryChunk::IncrementLiveBytesFromMutator(HeapObject* object, int by) {
MemoryChunk* chunk = MemoryChunk::FromAddress(object->address());
- if (!chunk->InNewSpace() && !static_cast<Page*>(chunk)->WasSwept()) {
+ if (!chunk->InNewSpace() && !static_cast<Page*>(chunk)->SweepingDone()) {
static_cast<PagedSpace*>(chunk->owner())->Allocate(by);
}
chunk->IncrementLiveBytes(by);
@@ -1225,11 +1224,11 @@ void PagedSpace::IncreaseCapacity(int size) {
}
-void PagedSpace::ReleasePage(Page* page) {
+void PagedSpace::ReleasePage(Page* page, bool evict_free_list_items) {
DCHECK(page->LiveBytes() == 0);
DCHECK(AreaSize() == page->area_size());
- if (page->WasSwept()) {
+ if (evict_free_list_items) {
intptr_t size = free_list_.EvictFreeListItems(page);
accounting_stats_.AllocateBytes(size);
DCHECK_EQ(AreaSize(), static_cast<int>(size));
@@ -1275,7 +1274,7 @@ void PagedSpace::Verify(ObjectVisitor* visitor) {
if (page == Page::FromAllocationTop(allocation_info_.top())) {
allocation_pointer_found_in_space = true;
}
- CHECK(page->WasSwept());
+ CHECK(page->SweepingDone());
HeapObjectIterator it(page);
Address end_of_previous_object = page->area_start();
Address top = page->area_end();
« no previous file with comments | « src/heap/spaces.h ('k') | src/heap/store-buffer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698