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

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

Issue 977013003: Remove promotion backup case and report OOM instead. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 10 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/heap.cc ('k') | no next file » | 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 77d084266264fbd78f56bc16115818a92b223ff4..1c5299fb6021b67fbcfd16e41bf81c6010660faa 100644
--- a/src/heap/mark-compact.cc
+++ b/src/heap/mark-compact.cc
@@ -1861,26 +1861,27 @@ int MarkCompactCollector::DiscoverAndEvacuateBlackObjectsOnPage(
current_cell >>= 1;
// TODO(hpayer): Refactor EvacuateObject and call this function instead.
- if (heap()->ShouldBePromoted(object->address(), size) &&
- TryPromoteObject(object, size)) {
- continue;
- }
-
- AllocationResult allocation = new_space->AllocateRaw(size);
- if (allocation.IsRetry()) {
- if (!new_space->AddFreshPage()) {
- // Shouldn't happen. We are sweeping linearly, and to-space
- // has the same number of pages as from-space, so there is
- // always room.
- UNREACHABLE();
+ if (heap()->ShouldBePromoted(object->address(), size)) {
+ if (!TryPromoteObject(object, size)) {
+ V8::FatalProcessOutOfMemory("Full GC promotion failed");
}
- allocation = new_space->AllocateRaw(size);
- DCHECK(!allocation.IsRetry());
- }
- Object* target = allocation.ToObjectChecked();
+ } else {
+ AllocationResult allocation = new_space->AllocateRaw(size);
+ if (allocation.IsRetry()) {
+ if (!new_space->AddFreshPage()) {
+ // Shouldn't happen. We are sweeping linearly, and to-space
+ // has the same number of pages as from-space, so there is
+ // always room.
+ UNREACHABLE();
+ }
+ allocation = new_space->AllocateRaw(size);
+ DCHECK(!allocation.IsRetry());
+ }
+ Object* target = allocation.ToObjectChecked();
- MigrateObject(HeapObject::cast(target), object, size, NEW_SPACE);
- heap()->IncrementSemiSpaceCopiedObjectSize(size);
+ MigrateObject(HeapObject::cast(target), object, size, NEW_SPACE);
+ heap()->IncrementSemiSpaceCopiedObjectSize(size);
+ }
}
*cells = 0;
}
« no previous file with comments | « src/heap/heap.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698