Commit 51b189a2 authored by hpayer@chromium.org's avatar hpayer@chromium.org

Wait for sweeper threads when expansion of old generation fails.

BUG=
R=ulan@chromium.org

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

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@22007 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 70ef1c24
......@@ -2595,15 +2595,6 @@ HeapObject* PagedSpace::SlowAllocateRaw(int size_in_bytes) {
// collection.
if (!heap()->always_allocate() &&
heap()->OldGenerationAllocationLimitReached()) {
return NULL;
}
// Try to expand the space and allocate in the new next page.
if (Expand()) {
ASSERT(CountTotalPages() > 1 || size_in_bytes <= free_list_.available());
return free_list_.Allocate(size_in_bytes);
}
// If sweeper threads are active, wait for them at that point.
if (collector->IsConcurrentSweepingInProgress()) {
collector->WaitUntilSweepingCompleted();
......@@ -2614,6 +2605,15 @@ HeapObject* PagedSpace::SlowAllocateRaw(int size_in_bytes) {
if (object != NULL) return object;
}
return NULL;
}
// Try to expand the space and allocate in the new next page.
if (Expand()) {
ASSERT(CountTotalPages() > 1 || size_in_bytes <= free_list_.available());
return free_list_.Allocate(size_in_bytes);
}
// Finally, fail.
return NULL;
}
......
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