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

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

Issue 1225783002: Version 4.5.98.1 (cherry-pick) (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@4.5.98
Patch Set: Created 5 years, 5 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 815dd2913ae9d7e3d79531d327190c24acdcf926..6229670da848efbbf75c6d50e3605d0e052180a7 100644
--- a/test/cctest/test-heap.cc
+++ b/test/cctest/test-heap.cc
@@ -2029,10 +2029,6 @@ 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));
@@ -2041,7 +2037,6 @@ 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);
@@ -2053,7 +2048,6 @@ 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));
@@ -2062,7 +2056,6 @@ 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);
@@ -2073,7 +2066,6 @@ 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.
@@ -2081,7 +2073,6 @@ 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.
@@ -2092,7 +2083,6 @@ 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.
@@ -2103,7 +2093,6 @@ 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.
@@ -5401,10 +5390,9 @@ 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. If not, then abandon
- // the test, since this isn't actually something we can reasonably require.
+ // Ensure that the object allocated where we need it.
Page* page = Page::FromAddress(o->address());
- if (desired_offset != page->Offset(o->address())) return;
+ CHECK_EQ(desired_offset, page->Offset(o->address()));
// 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