Test that we can bootstrap into the first page of each space.

R=olivf@chromium.org
TEST=cctest/test-spaces/SizeOfFirstPageIsLargeEnough

Review URL: https://codereview.chromium.org/24261007

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@16863 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 35142b81
......@@ -400,3 +400,25 @@ TEST(LargeObjectSpace) {
CHECK(lo->AllocateRaw(lo_size, NOT_EXECUTABLE)->IsFailure());
}
TEST(SizeOfFirstPageIsLargeEnough) {
if (i::FLAG_always_opt) return;
CcTest::InitializeVM();
Isolate* isolate = CcTest::i_isolate();
// Freshly initialized VM gets by with one page per space.
for (int i = FIRST_PAGED_SPACE; i <= LAST_PAGED_SPACE; i++) {
CHECK_EQ(1, isolate->heap()->paged_space(i)->CountTotalPages());
}
// Executing the empty script gets by with one page per space.
HandleScope scope(isolate);
CompileRun("/*empty*/");
for (int i = FIRST_PAGED_SPACE; i <= LAST_PAGED_SPACE; i++) {
CHECK_EQ(1, isolate->heap()->paged_space(i)->CountTotalPages());
}
// No large objects required to perform the above steps.
CHECK(isolate->heap()->lo_space()->IsEmpty());
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment