Commit 776a6568 authored by hpayer@chromium.org's avatar hpayer@chromium.org

Promote objects if semi-space copy fails while scavenging.

BUG=388188
LOG=N
R=jarin@chromium.org

Review URL: https://codereview.chromium.org/351853006

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@21980 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 0323525d
......@@ -2026,6 +2026,19 @@ class ScavengingVisitor : public StaticVisitorBase {
AllocationResult allocation =
heap->new_space()->AllocateRaw(allocation_size);
heap->promotion_queue()->SetNewLimit(heap->new_space()->top());
// Allocation in the other semi-space may fail due to fragmentation.
// In that case we allocate in the old generation.
if (allocation.IsRetry()) {
if (object_contents == DATA_OBJECT) {
ASSERT(heap->AllowedToBeMigrated(object, OLD_DATA_SPACE));
allocation = heap->old_data_space()->AllocateRaw(allocation_size);
} else {
ASSERT(heap->AllowedToBeMigrated(object, OLD_POINTER_SPACE));
allocation = heap->old_pointer_space()->AllocateRaw(allocation_size);
}
}
HeapObject* target = HeapObject::cast(allocation.ToObjectChecked());
if (alignment != kObjectAlignment) {
......
......@@ -2015,7 +2015,6 @@ int MarkCompactCollector::DiscoverAndEvacuateBlackObjectsOnPage(
continue;
}
// Promotion failed. Just migrate object to another semispace.
AllocationResult allocation = new_space->AllocateRaw(size);
if (allocation.IsRetry()) {
if (!new_space->AddFreshPage()) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment