OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 5075 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5086 #ifdef DEBUG | 5086 #ifdef DEBUG |
5087 TEST(PathTracer) { | 5087 TEST(PathTracer) { |
5088 CcTest::InitializeVM(); | 5088 CcTest::InitializeVM(); |
5089 v8::HandleScope scope(CcTest::isolate()); | 5089 v8::HandleScope scope(CcTest::isolate()); |
5090 | 5090 |
5091 v8::Local<v8::Value> result = CompileRun("'abc'"); | 5091 v8::Local<v8::Value> result = CompileRun("'abc'"); |
5092 Handle<Object> o = v8::Utils::OpenHandle(*result); | 5092 Handle<Object> o = v8::Utils::OpenHandle(*result); |
5093 CcTest::i_isolate()->heap()->TracePathToObject(*o); | 5093 CcTest::i_isolate()->heap()->TracePathToObject(*o); |
5094 } | 5094 } |
5095 #endif // DEBUG | 5095 #endif // DEBUG |
| 5096 |
| 5097 |
| 5098 TEST(FirstPageFitsStartup) { |
| 5099 // Test that the first page sizes provided by the default snapshot are large |
| 5100 // enough to fit everything right after startup and creating one context. |
| 5101 // If this test fails, we are allocating too much aside from deserialization. |
| 5102 if (!Snapshot::HaveASnapshotToStartFrom()) return; |
| 5103 if (Snapshot::EmbedsScript()) return; |
| 5104 CcTest::InitializeVM(); |
| 5105 LocalContext env; |
| 5106 PagedSpaces spaces(CcTest::heap()); |
| 5107 for (PagedSpace* s = spaces.next(); s != NULL; s = spaces.next()) { |
| 5108 uint32_t default_size = s->AreaSize(); |
| 5109 uint32_t reduced_size = Snapshot::SizeOfFirstPage(s->identity()); |
| 5110 if (reduced_size == default_size) continue; |
| 5111 int counter = 0; |
| 5112 Page* page = NULL; |
| 5113 for (PageIterator it(s); it.has_next(); page = it.next()) counter++; |
| 5114 CHECK_LE(counter, 1); |
| 5115 CHECK(static_cast<uint32_t>(page->area_size()) == reduced_size); |
| 5116 } |
| 5117 } |
OLD | NEW |