| 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 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 356 | 356 |
| 357 OldSpace* s = new OldSpace(heap, | 357 OldSpace* s = new OldSpace(heap, |
| 358 heap->MaxOldGenerationSize(), | 358 heap->MaxOldGenerationSize(), |
| 359 OLD_POINTER_SPACE, | 359 OLD_POINTER_SPACE, |
| 360 NOT_EXECUTABLE); | 360 NOT_EXECUTABLE); |
| 361 CHECK(s != NULL); | 361 CHECK(s != NULL); |
| 362 | 362 |
| 363 CHECK(s->SetUp()); | 363 CHECK(s->SetUp()); |
| 364 | 364 |
| 365 while (s->Available() > 0) { | 365 while (s->Available() > 0) { |
| 366 s->AllocateRaw(Page::kMaxNonCodeHeapObjectSize)->ToObjectUnchecked(); | 366 s->AllocateRaw<FreeList::BEST_FIT>(Page::kMaxNonCodeHeapObjectSize)-> |
| 367 ToObjectUnchecked(); |
| 367 } | 368 } |
| 368 | 369 |
| 369 s->TearDown(); | 370 s->TearDown(); |
| 370 delete s; | 371 delete s; |
| 371 memory_allocator->TearDown(); | 372 memory_allocator->TearDown(); |
| 372 delete memory_allocator; | 373 delete memory_allocator; |
| 373 } | 374 } |
| 374 | 375 |
| 375 | 376 |
| 376 TEST(LargeObjectSpace) { | 377 TEST(LargeObjectSpace) { |
| (...skipping 20 matching lines...) Expand all Loading... |
| 397 { MaybeObject* maybe_obj = lo->AllocateRaw(lo_size, NOT_EXECUTABLE); | 398 { MaybeObject* maybe_obj = lo->AllocateRaw(lo_size, NOT_EXECUTABLE); |
| 398 if (!maybe_obj->ToObject(&obj)) break; | 399 if (!maybe_obj->ToObject(&obj)) break; |
| 399 } | 400 } |
| 400 CHECK(lo->Available() < available); | 401 CHECK(lo->Available() < available); |
| 401 }; | 402 }; |
| 402 | 403 |
| 403 CHECK(!lo->IsEmpty()); | 404 CHECK(!lo->IsEmpty()); |
| 404 | 405 |
| 405 CHECK(lo->AllocateRaw(lo_size, NOT_EXECUTABLE)->IsFailure()); | 406 CHECK(lo->AllocateRaw(lo_size, NOT_EXECUTABLE)->IsFailure()); |
| 406 } | 407 } |
| OLD | NEW |