Reviewers: oliv,

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

[email protected]
TEST=cctest/test-spaces/SizeOfFirstPageIsLargeEnough

Please review this at https://codereview.chromium.org/24261007/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files (+21, -0 lines):
  M test/cctest/test-spaces.cc


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());
+}


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to