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

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

Issue 2013713003: [heap] Switch to 500k pages (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Updating the constant used for determining wanted tasks Created 4 years, 4 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
Index: test/cctest/heap/test-heap.cc
diff --git a/test/cctest/heap/test-heap.cc b/test/cctest/heap/test-heap.cc
index f76b6ba7a4cde08c7c3a331ebb477b52f2222d9c..7a3c1a86d85b6a0e50a9d4755764d492c6570691 100644
--- a/test/cctest/heap/test-heap.cc
+++ b/test/cctest/heap/test-heap.cc
@@ -2186,6 +2186,18 @@ static Address AlignOldSpace(AllocationAlignment alignment, int offset) {
// Test the case where allocation must be done from the free list, so filler
// may precede or follow the object.
TEST(TestAlignedOverAllocation) {
+ Heap* heap = CcTest::heap();
+ // Test checks for fillers before and behind objects and requires a fresh
+ // page and empty free list.
+ heap::AbandonCurrentlyFreeMemory(heap->old_space());
+ // Allocate a dummy object to properly set up the linear allocation info.
+ AllocationResult dummy =
+ heap->old_space()->AllocateRawUnaligned(kPointerSize);
+ CHECK(!dummy.IsRetry());
+ heap->CreateFillerObjectAt(
+ HeapObject::cast(dummy.ToObjectChecked())->address(), kPointerSize,
+ ClearRecordedSlots::kNo);
+
// Double misalignment is 4 on 32-bit platforms, 0 on 64-bit ones.
const intptr_t double_misalignment = kDoubleSize - kPointerSize;
Address start;
@@ -3571,6 +3583,11 @@ TEST(ReleaseOverReservedPages) {
Isolate* isolate = CcTest::i_isolate();
Factory* factory = isolate->factory();
Heap* heap = isolate->heap();
+
+ // The initial GC makes sure that objects that are allocated in new space
+ // don't play a part in the test.
+ heap->CollectAllAvailableGarbage("initial GC");
+
v8::HandleScope scope(CcTest::isolate());
static const int number_of_test_pages = 20;

Powered by Google App Engine
This is Rietveld 408576698