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}
This commit is contained in:
parent
d001cd5665
commit
59a0641820
@ -37,7 +37,7 @@ class Isolate;
|
||||
// area.
|
||||
//
|
||||
// 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
|
||||
// may be larger than the page size.
|
||||
//
|
||||
@ -2995,9 +2995,9 @@ class MapSpace : public PagedSpace {
|
||||
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Large objects ( > Page::kMaxHeapObjectSize ) are allocated and managed by
|
||||
// the large object space. A large object is allocated from OS heap with
|
||||
// extra padding bytes (Page::kPageSize + Page::kObjectStartOffset).
|
||||
// Large objects ( > Page::kMaxRegularHeapObjectSize ) are allocated and
|
||||
// managed by the large object space. A large object is allocated from OS
|
||||
// heap with extra padding bytes (Page::kPageSize + Page::kObjectStartOffset).
|
||||
// A large object always starts at Page::kObjectStartOffset to a page.
|
||||
// Large objects do not move during garbage collections.
|
||||
|
||||
|
@ -4576,8 +4576,9 @@ TEST(LargeObjectSlotRecording) {
|
||||
FixedArray* old_location = *lit;
|
||||
|
||||
// Allocate a large object.
|
||||
const int kSize = 1000000;
|
||||
Handle<FixedArray> lo = isolate->factory()->NewFixedArray(kSize, TENURED);
|
||||
int size = Max(1000000, Page::kMaxRegularHeapObjectSize + KB);
|
||||
CHECK(size > Page::kMaxRegularHeapObjectSize);
|
||||
Handle<FixedArray> lo = isolate->factory()->NewFixedArray(size, TENURED);
|
||||
CHECK(heap->lo_space()->Contains(*lo));
|
||||
|
||||
// Start incremental marking to active write barrier.
|
||||
@ -4587,8 +4588,8 @@ TEST(LargeObjectSlotRecording) {
|
||||
|
||||
// Create references from the large object to the object on the evacuation
|
||||
// candidate.
|
||||
const int kStep = kSize / 10;
|
||||
for (int i = 0; i < kSize; i += kStep) {
|
||||
const int kStep = size / 10;
|
||||
for (int i = 0; i < size; i += kStep) {
|
||||
lo->set(i, *lit);
|
||||
CHECK(lo->get(i) == old_location);
|
||||
}
|
||||
@ -4597,7 +4598,7 @@ TEST(LargeObjectSlotRecording) {
|
||||
CcTest::heap()->CollectAllGarbage();
|
||||
|
||||
// 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(lo->get(i) != old_location);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user