From e59cf6214d2136f2c4bc039c6ec084504759e169 Mon Sep 17 00:00:00 2001 From: "mstarzinger@chromium.org" Date: Fri, 20 Sep 2013 12:18:17 +0000 Subject: [PATCH] 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 --- test/cctest/test-spaces.cc | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/test/cctest/test-spaces.cc b/test/cctest/test-spaces.cc index f3f299c..7371065 100644 --- a/test/cctest/test-spaces.cc +++ b/test/cctest/test-spaces.cc @@ -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()); +} -- 2.7.4