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

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

Issue 2229403003: Revert of [heap] Switch to 500k pages (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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
« no previous file with comments | « test/cctest/heap/test-heap.cc ('k') | test/cctest/test-serialize.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/heap/test-spaces.cc
diff --git a/test/cctest/heap/test-spaces.cc b/test/cctest/heap/test-spaces.cc
index ad11c817cac33435324aef9db98ea5731c1e1b62..2328518f2a68cd0a9bed0cef3ab8277a8e179892 100644
--- a/test/cctest/heap/test-spaces.cc
+++ b/test/cctest/heap/test-spaces.cc
@@ -478,7 +478,8 @@
CHECK(lo->AllocateRaw(lo_size, NOT_EXECUTABLE).IsRetry());
}
-TEST(SizeOfInitialHeap) {
+
+TEST(SizeOfFirstPageIsLargeEnough) {
if (i::FLAG_always_opt) return;
// Bootstrapping without a snapshot causes more allocations.
CcTest::InitializeVM();
@@ -494,31 +495,22 @@
return;
}
- // The limit for each space for an empty isolate containing just the
- // snapshot.
- const size_t kMaxInitialSizePerSpace = 1536 * KB; // 1.5MB
-
- // Freshly initialized VM gets by with the snapshot size (which is below
- // kMaxInitialSizePerSpace per space).
- Heap* heap = isolate->heap();
- int page_count[LAST_PAGED_SPACE + 1];
+ // If this test fails due to enabling experimental natives that are not part
+ // of the snapshot, we may need to adjust CalculateFirstPageSizes.
+
+ // Freshly initialized VM gets by with one page per space.
for (int i = FIRST_PAGED_SPACE; i <= LAST_PAGED_SPACE; i++) {
// Debug code can be very large, so skip CODE_SPACE if we are generating it.
if (i == CODE_SPACE && i::FLAG_debug_code) continue;
-
- page_count[i] = heap->paged_space(i)->CountTotalPages();
- // Check that the initial heap is also below the limit.
- CHECK_LT(static_cast<size_t>(heap->paged_space(i)->CommittedMemory()),
- kMaxInitialSizePerSpace);
- }
-
- // Executing the empty script gets by with the same number of pages, i.e.,
- // requires no extra space.
+ CHECK_EQ(1, isolate->heap()->paged_space(i)->CountTotalPages());
+ }
+
+ // Executing the empty script gets by with one page per space.
CompileRun("/*empty*/");
for (int i = FIRST_PAGED_SPACE; i <= LAST_PAGED_SPACE; i++) {
// Debug code can be very large, so skip CODE_SPACE if we are generating it.
if (i == CODE_SPACE && i::FLAG_debug_code) continue;
- CHECK_EQ(page_count[i], isolate->heap()->paged_space(i)->CountTotalPages());
+ CHECK_EQ(1, isolate->heap()->paged_space(i)->CountTotalPages());
}
// No large objects required to perform the above steps.
« no previous file with comments | « test/cctest/heap/test-heap.cc ('k') | test/cctest/test-serialize.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698