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

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: 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..40f692ba267d1e407b0a72fa6490ae014bee4cdb 100644
--- a/src/heap/spaces.cc
+++ b/src/heap/spaces.cc
@@ -1826,9 +1826,10 @@ void SemiSpace::Reset() {
current_page_ = anchor_.next_page();
}
-void SemiSpace::ReplaceWithEmptyPage(Page* old_page) {
+bool SemiSpace::ReplaceWithEmptyPage(Page* old_page) {
Page* new_page = heap()->memory_allocator()->AllocatePage(
Page::kAllocatableMemory, this, executable());
+ if (new_page == nullptr) return false;
Hannes Payer (out of office) 2016/04/28 06:55:48 Maybe leave a TODO here that we do not have to get
Michael Lippautz 2016/04/28 07:00:58 Done.
Bitmap::Clear(new_page);
new_page->SetFlags(old_page->GetFlags(), Page::kCopyAllFlags);
new_page->set_next_page(old_page->next_page());
@@ -1837,6 +1838,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