Index: test/cctest/test-spaces.cc |
diff --git a/test/cctest/test-spaces.cc b/test/cctest/test-spaces.cc |
index f3f299cc59ad1fcf22658bff0e8790f840ef379a..a40987da2dc70e4d39cb2588d304ada3b6111b5b 100644 |
--- a/test/cctest/test-spaces.cc |
+++ b/test/cctest/test-spaces.cc |
@@ -400,3 +400,24 @@ TEST(LargeObjectSpace) { |
CHECK(lo->AllocateRaw(lo_size, NOT_EXECUTABLE)->IsFailure()); |
} |
+ |
+ |
+TEST(SizeOfFirstPageIsLargeEnough) { |
+ 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()); |
+} |