OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
393 { MaybeObject* maybe_obj = lo->AllocateRaw(lo_size, NOT_EXECUTABLE); | 393 { MaybeObject* maybe_obj = lo->AllocateRaw(lo_size, NOT_EXECUTABLE); |
394 if (!maybe_obj->ToObject(&obj)) break; | 394 if (!maybe_obj->ToObject(&obj)) break; |
395 } | 395 } |
396 CHECK(lo->Available() < available); | 396 CHECK(lo->Available() < available); |
397 }; | 397 }; |
398 | 398 |
399 CHECK(!lo->IsEmpty()); | 399 CHECK(!lo->IsEmpty()); |
400 | 400 |
401 CHECK(lo->AllocateRaw(lo_size, NOT_EXECUTABLE)->IsFailure()); | 401 CHECK(lo->AllocateRaw(lo_size, NOT_EXECUTABLE)->IsFailure()); |
402 } | 402 } |
| 403 |
| 404 |
| 405 TEST(SizeOfFirstPageIsLargeEnough) { |
| 406 CcTest::InitializeVM(); |
| 407 Isolate* isolate = CcTest::i_isolate(); |
| 408 |
| 409 // Freshly initialized VM gets by with one page per space. |
| 410 for (int i = FIRST_PAGED_SPACE; i <= LAST_PAGED_SPACE; i++) { |
| 411 CHECK_EQ(1, isolate->heap()->paged_space(i)->CountTotalPages()); |
| 412 } |
| 413 |
| 414 // Executing the empty script gets by with one page per space. |
| 415 HandleScope scope(isolate); |
| 416 CompileRun("/*empty*/"); |
| 417 for (int i = FIRST_PAGED_SPACE; i <= LAST_PAGED_SPACE; i++) { |
| 418 CHECK_EQ(1, isolate->heap()->paged_space(i)->CountTotalPages()); |
| 419 } |
| 420 |
| 421 // No large objects required to perform the above steps. |
| 422 CHECK(isolate->heap()->lo_space()->IsEmpty()); |
| 423 } |
OLD | NEW |