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

Unified Diff: src/heap/mark-compact.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 | « no previous file | src/heap/spaces.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/mark-compact.cc
diff --git a/src/heap/mark-compact.cc b/src/heap/mark-compact.cc
index 96940ed85f2c231d45e8bba280253fa688c776bd..129d82eaff6d8e8dcfb856bc0fb8d6b9c5c1eaed 100644
--- a/src/heap/mark-compact.cc
+++ b/src/heap/mark-compact.cc
@@ -1801,10 +1801,11 @@ class MarkCompactCollector::EvacuateNewSpacePageVisitor final
public:
EvacuateNewSpacePageVisitor() : promoted_size_(0) {}
- static void MoveToOldSpace(Page* page, PagedSpace* owner) {
- page->heap()->new_space()->ReplaceWithEmptyPage(page);
- Page* new_page = Page::ConvertNewToOld(page, owner);
- new_page->SetFlag(Page::PAGE_NEW_OLD_PROMOTION);
+ static void TryMoveToOldSpace(Page* page, PagedSpace* owner) {
+ if (page->heap()->new_space()->ReplaceWithEmptyPage(page)) {
+ Page* new_page = Page::ConvertNewToOld(page, owner);
+ new_page->SetFlag(Page::PAGE_NEW_OLD_PROMOTION);
+ }
}
inline bool Visit(HeapObject* object) {
@@ -3293,7 +3294,7 @@ void MarkCompactCollector::EvacuatePagesInParallel() {
(page->LiveBytes() > Evacuator::PageEvacuationThreshold()) &&
page->IsFlagSet(MemoryChunk::NEW_SPACE_BELOW_AGE_MARK) &&
!page->Contains(age_mark)) {
- EvacuateNewSpacePageVisitor::MoveToOldSpace(page, heap()->old_space());
+ EvacuateNewSpacePageVisitor::TryMoveToOldSpace(page, heap()->old_space());
}
job.AddPage(page, &abandoned_pages);
}
« no previous file with comments | « no previous file | src/heap/spaces.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698