| Index: test/cctest/test-heap.cc
|
| diff --git a/test/cctest/test-heap.cc b/test/cctest/test-heap.cc
|
| index e80f4f1d06dd86cc00b194f4cd66161ce6be09bb..5136953c1dad2a0e212b1273a5aa0ed446543013 100644
|
| --- a/test/cctest/test-heap.cc
|
| +++ b/test/cctest/test-heap.cc
|
| @@ -4993,3 +4993,20 @@ TEST(PathTracer) {
|
| CcTest::i_isolate()->heap()->TracePathToObject(*o);
|
| }
|
| #endif // DEBUG
|
| +
|
| +
|
| +TEST(FirstPageFitsStartup) {
|
| + // Test that the first page sizes provided by the default snapshot are large
|
| + // enough to fit everything right after startup and creating one context.
|
| + // If this test fails, we are allocating too much aside from deserialization.
|
| + if (!Snapshot::HaveASnapshotToStartFrom()) return;
|
| + if (Snapshot::EmbedsScript()) return;
|
| + CcTest::InitializeVM();
|
| + LocalContext env;
|
| + PagedSpaces spaces(CcTest::heap());
|
| + for (PagedSpace* s = spaces.next(); s != NULL; s = spaces.next()) {
|
| + int counter = 0;
|
| + for (PageIterator it(s); it.has_next(); it.next()) counter++;
|
| + CHECK_LE(counter, 1);
|
| + }
|
| +}
|
|
|