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

Unified Diff: src/heap/spaces.cc

Issue 1863983002: 🏄 [heap] Add page evacuation mode for new->old (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Disable optimize_for_size for the feature test as we require >1 page new space Created 4 years, 8 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/spaces-inl.h » ('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 c4219df48b7dbbac8a29e1d1d7e3728b16415397..13fa8079b1bef6d7a7fc808e55ec80ff3929ecd7 100644
--- a/src/heap/spaces.cc
+++ b/src/heap/spaces.cc
@@ -1161,7 +1161,7 @@ bool PagedSpace::Expand() {
Page* p =
heap()->memory_allocator()->AllocatePage<Page>(size, this, executable());
- if (p == NULL) return false;
+ if (p == nullptr) return false;
AccountCommitted(static_cast<intptr_t>(p->size()));
@@ -1817,6 +1817,19 @@ void SemiSpace::Reset() {
current_page_ = anchor_.next_page();
}
+void SemiSpace::ReplaceWithEmptyPage(NewSpacePage* old_page) {
+ NewSpacePage* new_page =
+ heap()->memory_allocator()->AllocatePage<NewSpacePage>(
+ NewSpacePage::kAllocatableMemory, this, executable());
+ Bitmap::Clear(new_page);
+ new_page->SetFlags(old_page->GetFlags(), NewSpacePage::kCopyAllFlags);
+ new_page->set_next_page(old_page->next_page());
+ new_page->set_prev_page(old_page->prev_page());
+ old_page->next_page()->set_prev_page(new_page);
+ old_page->prev_page()->set_next_page(new_page);
+ heap()->CreateFillerObjectAt(new_page->area_start(), new_page->area_size(),
+ ClearRecordedSlots::kNo);
+}
void SemiSpace::Swap(SemiSpace* from, SemiSpace* to) {
// We won't be swapping semispaces without data in them.
« no previous file with comments | « src/heap/spaces.h ('k') | src/heap/spaces-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698