Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(29)

Unified Diff: test/cctest/test-heap.cc

Issue 1077153004: Reland: Fix logic for incremental marking steps on tenured allocation (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Merge up Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/heap/spaces.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-heap.cc
diff --git a/test/cctest/test-heap.cc b/test/cctest/test-heap.cc
index 3f60f60af20825f287524ff6bb38784ea1b5d3b9..878d36be33c78f71cab54a22904d20fdd2467499 100644
--- a/test/cctest/test-heap.cc
+++ b/test/cctest/test-heap.cc
@@ -2029,6 +2029,10 @@ TEST(TestAlignedOverAllocation) {
HeapObject* filler2;
if (double_misalignment) {
start = AlignOldSpace(kDoubleAligned, 0);
+ // If we run out of linear allocation area then we might get null here. In
+ // that case we are unlucky and the test is not going to work, but it's not
+ // a test failure, this is a reasonable thing to happen. Just abandon.
+ if (start == NULL) return;
obj = OldSpaceAllocateAligned(kPointerSize, kDoubleAligned);
// The object is aligned, and a filler object is created after.
CHECK(IsAddressAligned(obj->address(), kDoubleAlignment));
@@ -2037,6 +2041,7 @@ TEST(TestAlignedOverAllocation) {
filler1->Size() == kPointerSize);
// Try the opposite alignment case.
start = AlignOldSpace(kDoubleAligned, kPointerSize);
+ if (start == NULL) return;
obj = OldSpaceAllocateAligned(kPointerSize, kDoubleAligned);
CHECK(IsAddressAligned(obj->address(), kDoubleAlignment));
filler1 = HeapObject::FromAddress(start);
@@ -2048,6 +2053,7 @@ TEST(TestAlignedOverAllocation) {
// Similarly for kDoubleUnaligned.
start = AlignOldSpace(kDoubleUnaligned, 0);
+ if (start == NULL) return;
obj = OldSpaceAllocateAligned(kPointerSize, kDoubleUnaligned);
// The object is aligned, and a filler object is created after.
CHECK(IsAddressAligned(obj->address(), kDoubleAlignment, kPointerSize));
@@ -2056,6 +2062,7 @@ TEST(TestAlignedOverAllocation) {
filler1->Size() == kPointerSize);
// Try the opposite alignment case.
start = AlignOldSpace(kDoubleUnaligned, kPointerSize);
+ if (start == NULL) return;
obj = OldSpaceAllocateAligned(kPointerSize, kDoubleUnaligned);
CHECK(IsAddressAligned(obj->address(), kDoubleAlignment, kPointerSize));
filler1 = HeapObject::FromAddress(start);
@@ -2066,6 +2073,7 @@ TEST(TestAlignedOverAllocation) {
// Now test SIMD alignment. There are 2 or 4 possible alignments, depending
// on platform.
start = AlignOldSpace(kSimd128Unaligned, 0);
+ if (start == NULL) return;
obj = OldSpaceAllocateAligned(kPointerSize, kSimd128Unaligned);
CHECK(IsAddressAligned(obj->address(), kSimd128Alignment, kPointerSize));
// There is a filler object after the object.
@@ -2073,6 +2081,7 @@ TEST(TestAlignedOverAllocation) {
CHECK(obj != filler1 && filler1->IsFiller() &&
filler1->Size() == kSimd128Size - kPointerSize);
start = AlignOldSpace(kSimd128Unaligned, kPointerSize);
+ if (start == NULL) return;
obj = OldSpaceAllocateAligned(kPointerSize, kSimd128Unaligned);
CHECK(IsAddressAligned(obj->address(), kSimd128Alignment, kPointerSize));
// There is a filler object before the object.
@@ -2083,6 +2092,7 @@ TEST(TestAlignedOverAllocation) {
if (double_misalignment) {
// Test the 2 other alignments possible on 32 bit platforms.
start = AlignOldSpace(kSimd128Unaligned, 2 * kPointerSize);
+ if (start == NULL) return;
obj = OldSpaceAllocateAligned(kPointerSize, kSimd128Unaligned);
CHECK(IsAddressAligned(obj->address(), kSimd128Alignment, kPointerSize));
// There are filler objects before and after the object.
@@ -2093,6 +2103,7 @@ TEST(TestAlignedOverAllocation) {
CHECK(obj != filler2 && filler2->IsFiller() &&
filler2->Size() == kPointerSize);
start = AlignOldSpace(kSimd128Unaligned, 3 * kPointerSize);
+ if (start == NULL) return;
obj = OldSpaceAllocateAligned(kPointerSize, kSimd128Unaligned);
CHECK(IsAddressAligned(obj->address(), kSimd128Alignment, kPointerSize));
// There are filler objects before and after the object.
@@ -5390,9 +5401,10 @@ TEST(Regress388880) {
Handle<JSObject> o = factory->NewJSObjectFromMap(map1, TENURED, false);
o->set_properties(*factory->empty_fixed_array());
- // Ensure that the object allocated where we need it.
+ // Ensure that the object allocated where we need it. If not, then abandon
+ // the test, since this isn't actually something we can reasonably require.
Page* page = Page::FromAddress(o->address());
- CHECK_EQ(desired_offset, page->Offset(o->address()));
+ if (desired_offset != page->Offset(o->address())) return;
// Now we have an object right at the end of the page.
« no previous file with comments | « src/heap/spaces.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698