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

Unified Diff: src/heap/mark-compact.cc

Issue 1058613003: Version 4.3.61.6 (cherry-pick) (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@4.3
Patch Set: Created 5 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 | « include/v8-version.h ('k') | src/heap/spaces.cc » ('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 286767e34c38828007a54e9d402df337bb0a3ec8..49fbd6e93e4c3f06157ba4680d6c9bd41f67acf9 100644
--- a/src/heap/mark-compact.cc
+++ b/src/heap/mark-compact.cc
@@ -3349,12 +3349,13 @@ void MarkCompactCollector::EvacuatePages() {
// Allocate emergency memory for the case when compaction fails due to out
// of memory.
if (!space->HasEmergencyMemory()) {
- space->CreateEmergencyMemory();
+ space->CreateEmergencyMemory(); // If the OS lets us.
}
if (p->IsEvacuationCandidate()) {
- // During compaction we might have to request a new page. Check that we
- // have an emergency page and the space still has room for that.
- if (space->HasEmergencyMemory() || space->CanExpand()) {
+ // During compaction we might have to request a new page in order to free
+ // up a page. Check that we actually got an emergency page above so we
+ // can guarantee that this succeeds.
+ if (space->HasEmergencyMemory()) {
EvacuateLiveObjectsFromPage(p);
// Unlink the page from the list of pages here. We must not iterate
// over that page later (e.g. when scan on scavenge pages are
« no previous file with comments | « include/v8-version.h ('k') | src/heap/spaces.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698