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

Unified Diff: src/heap/spaces.cc

Issue 1928883002: [heap] Bail out to regular evacuation if new->old fails to allocate a page (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: addressed comment 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') | no next file » | 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 98c0c4a3661d3d657843cba611b6bde1c0e00429..674838fde3d1cb3017207ef78f78e77c7fc80668 100644
--- a/src/heap/spaces.cc
+++ b/src/heap/spaces.cc
@@ -1826,9 +1826,12 @@ void SemiSpace::Reset() {
current_page_ = anchor_.next_page();
}
-void SemiSpace::ReplaceWithEmptyPage(Page* old_page) {
+bool SemiSpace::ReplaceWithEmptyPage(Page* old_page) {
+ // TODO(mlippautz): We do not have to get a new page here when the semispace
+ // is uncommitted later on.
Page* new_page = heap()->memory_allocator()->AllocatePage(
Page::kAllocatableMemory, this, executable());
+ if (new_page == nullptr) return false;
Bitmap::Clear(new_page);
new_page->SetFlags(old_page->GetFlags(), Page::kCopyAllFlags);
new_page->set_next_page(old_page->next_page());
@@ -1837,6 +1840,7 @@ void SemiSpace::ReplaceWithEmptyPage(Page* old_page) {
old_page->prev_page()->set_next_page(new_page);
heap()->CreateFillerObjectAt(new_page->area_start(), new_page->area_size(),
ClearRecordedSlots::kNo);
+ return true;
}
void SemiSpace::Swap(SemiSpace* from, SemiSpace* to) {
« no previous file with comments | « src/heap/spaces.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698