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 4975 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4986 #ifdef DEBUG | 4986 #ifdef DEBUG |
4987 TEST(PathTracer) { | 4987 TEST(PathTracer) { |
4988 CcTest::InitializeVM(); | 4988 CcTest::InitializeVM(); |
4989 v8::HandleScope scope(CcTest::isolate()); | 4989 v8::HandleScope scope(CcTest::isolate()); |
4990 | 4990 |
4991 v8::Local<v8::Value> result = CompileRun("'abc'"); | 4991 v8::Local<v8::Value> result = CompileRun("'abc'"); |
4992 Handle<Object> o = v8::Utils::OpenHandle(*result); | 4992 Handle<Object> o = v8::Utils::OpenHandle(*result); |
4993 CcTest::i_isolate()->heap()->TracePathToObject(*o); | 4993 CcTest::i_isolate()->heap()->TracePathToObject(*o); |
4994 } | 4994 } |
4995 #endif // DEBUG | 4995 #endif // DEBUG |
| 4996 |
| 4997 |
| 4998 TEST(FirstPageFitsStartup) { |
| 4999 // Test that the first page sizes provided by the default snapshot are large |
| 5000 // enough to fit everything right after startup and creating one context. |
| 5001 // If this test fails, we are allocating too much aside from deserialization. |
| 5002 if (!Snapshot::HaveASnapshotToStartFrom()) return; |
| 5003 if (Snapshot::EmbedsScript()) return; |
| 5004 CcTest::InitializeVM(); |
| 5005 LocalContext env; |
| 5006 PagedSpaces spaces(CcTest::heap()); |
| 5007 for (PagedSpace* s = spaces.next(); s != NULL; s = spaces.next()) { |
| 5008 int counter = 0; |
| 5009 for (PageIterator it(s); it.has_next(); it.next()) counter++; |
| 5010 CHECK_LE(counter, 1); |
| 5011 } |
| 5012 } |
OLD | NEW |