Commit 59a06418 authored by mbrandy's avatar mbrandy Committed by Commit bot

Fix test-heap/LargeObjectSlotRecording.

Remove hard-coded assumption of large object size threshold.

This test fails on PPC in version 4.7 where the threshold is derived
directly from the allocator's pagesize.

R=hpayer@chromium.org, mstarzinger@chromium.org, michael_dawson@ca.ibm.com
BUG=

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

Cr-Commit-Position: refs/heads/master@{#31963}
parent d001cd56
...@@ -37,7 +37,7 @@ class Isolate; ...@@ -37,7 +37,7 @@ class Isolate;
// area. // area.
// //
// There is a separate large object space for objects larger than // There is a separate large object space for objects larger than
// Page::kMaxHeapObjectSize, so that they do not have to move during // Page::kMaxRegularHeapObjectSize, so that they do not have to move during
// collection. The large object space is paged. Pages in large object space // collection. The large object space is paged. Pages in large object space
// may be larger than the page size. // may be larger than the page size.
// //
...@@ -2995,9 +2995,9 @@ class MapSpace : public PagedSpace { ...@@ -2995,9 +2995,9 @@ class MapSpace : public PagedSpace {
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
// Large objects ( > Page::kMaxHeapObjectSize ) are allocated and managed by // Large objects ( > Page::kMaxRegularHeapObjectSize ) are allocated and
// the large object space. A large object is allocated from OS heap with // managed by the large object space. A large object is allocated from OS
// extra padding bytes (Page::kPageSize + Page::kObjectStartOffset). // heap with extra padding bytes (Page::kPageSize + Page::kObjectStartOffset).
// A large object always starts at Page::kObjectStartOffset to a page. // A large object always starts at Page::kObjectStartOffset to a page.
// Large objects do not move during garbage collections. // Large objects do not move during garbage collections.
......
...@@ -4576,8 +4576,9 @@ TEST(LargeObjectSlotRecording) { ...@@ -4576,8 +4576,9 @@ TEST(LargeObjectSlotRecording) {
FixedArray* old_location = *lit; FixedArray* old_location = *lit;
// Allocate a large object. // Allocate a large object.
const int kSize = 1000000; int size = Max(1000000, Page::kMaxRegularHeapObjectSize + KB);
Handle<FixedArray> lo = isolate->factory()->NewFixedArray(kSize, TENURED); CHECK(size > Page::kMaxRegularHeapObjectSize);
Handle<FixedArray> lo = isolate->factory()->NewFixedArray(size, TENURED);
CHECK(heap->lo_space()->Contains(*lo)); CHECK(heap->lo_space()->Contains(*lo));
// Start incremental marking to active write barrier. // Start incremental marking to active write barrier.
...@@ -4587,8 +4588,8 @@ TEST(LargeObjectSlotRecording) { ...@@ -4587,8 +4588,8 @@ TEST(LargeObjectSlotRecording) {
// Create references from the large object to the object on the evacuation // Create references from the large object to the object on the evacuation
// candidate. // candidate.
const int kStep = kSize / 10; const int kStep = size / 10;
for (int i = 0; i < kSize; i += kStep) { for (int i = 0; i < size; i += kStep) {
lo->set(i, *lit); lo->set(i, *lit);
CHECK(lo->get(i) == old_location); CHECK(lo->get(i) == old_location);
} }
...@@ -4597,7 +4598,7 @@ TEST(LargeObjectSlotRecording) { ...@@ -4597,7 +4598,7 @@ TEST(LargeObjectSlotRecording) {
CcTest::heap()->CollectAllGarbage(); CcTest::heap()->CollectAllGarbage();
// Verify that the pointers in the large object got updated. // Verify that the pointers in the large object got updated.
for (int i = 0; i < kSize; i += kStep) { for (int i = 0; i < size; i += kStep) {
CHECK_EQ(lo->get(i), *lit); CHECK_EQ(lo->get(i), *lit);
CHECK(lo->get(i) != old_location); CHECK(lo->get(i) != old_location);
} }
......
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