Commit 1e0287c1 authored by Junliang Yan's avatar Junliang Yan Committed by Commit Bot

PPC: [test] fix heap/Regress589413

We need to reserve two pages for young objects and objects on
the evacuation candidate page.

Change-Id: I0c4e8f85971676c0b50dfd947678a33dd1b56084
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2224364Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68110}
parent 2ae3fa50
......@@ -5475,8 +5475,10 @@ HEAP_TEST(Regress589413) {
// Add the array in root set.
handle(array, isolate);
}
// Expand and fill one complete page with fixed arrays.
heap->set_force_oom(false);
size_t initial_pages = pages.size();
// Expand and fill two pages with fixed array to ensure enough space both
// the young objects and the evacuation candidate pages.
while (
AllocateFixedArrayForTest(heap, N, AllocationType::kOld).To(&array)) {
arrays.push_back(array);
......@@ -5484,7 +5486,9 @@ HEAP_TEST(Regress589413) {
// Add the array in root set.
handle(array, isolate);
// Do not expand anymore.
heap->set_force_oom(true);
if (pages.size() - initial_pages == 2) {
heap->set_force_oom(true);
}
}
// Expand and mark the new page as evacuation candidate.
heap->set_force_oom(false);
......
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