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 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
386 CHECK(lo->FindObject(ho->address()) == obj); | 386 CHECK(lo->FindObject(ho->address()) == obj); |
387 | 387 |
388 CHECK(lo->Contains(ho)); | 388 CHECK(lo->Contains(ho)); |
389 | 389 |
390 while (true) { | 390 while (true) { |
391 intptr_t available = lo->Available(); | 391 intptr_t available = lo->Available(); |
392 { AllocationResult allocation = lo->AllocateRaw(lo_size, NOT_EXECUTABLE); | 392 { AllocationResult allocation = lo->AllocateRaw(lo_size, NOT_EXECUTABLE); |
393 if (allocation.IsRetry()) break; | 393 if (allocation.IsRetry()) break; |
394 } | 394 } |
395 CHECK(lo->Available() < available); | 395 CHECK(lo->Available() < available); |
396 }; | 396 } |
397 | 397 |
398 CHECK(!lo->IsEmpty()); | 398 CHECK(!lo->IsEmpty()); |
399 | 399 |
400 CHECK(lo->AllocateRaw(lo_size, NOT_EXECUTABLE).IsRetry()); | 400 CHECK(lo->AllocateRaw(lo_size, NOT_EXECUTABLE).IsRetry()); |
401 } | 401 } |
402 | 402 |
403 | 403 |
404 TEST(SizeOfFirstPageIsLargeEnough) { | 404 TEST(SizeOfFirstPageIsLargeEnough) { |
405 if (i::FLAG_always_opt) return; | 405 if (i::FLAG_always_opt) return; |
406 CcTest::InitializeVM(); | 406 CcTest::InitializeVM(); |
(...skipping 11 matching lines...) Expand all Loading... |
418 CompileRun("/*empty*/"); | 418 CompileRun("/*empty*/"); |
419 for (int i = FIRST_PAGED_SPACE; i <= LAST_PAGED_SPACE; i++) { | 419 for (int i = FIRST_PAGED_SPACE; i <= LAST_PAGED_SPACE; i++) { |
420 // Debug code can be very large, so skip CODE_SPACE if we are generating it. | 420 // Debug code can be very large, so skip CODE_SPACE if we are generating it. |
421 if (i == CODE_SPACE && i::FLAG_debug_code) continue; | 421 if (i == CODE_SPACE && i::FLAG_debug_code) continue; |
422 CHECK_EQ(1, isolate->heap()->paged_space(i)->CountTotalPages()); | 422 CHECK_EQ(1, isolate->heap()->paged_space(i)->CountTotalPages()); |
423 } | 423 } |
424 | 424 |
425 // No large objects required to perform the above steps. | 425 // No large objects required to perform the above steps. |
426 CHECK(isolate->heap()->lo_space()->IsEmpty()); | 426 CHECK(isolate->heap()->lo_space()->IsEmpty()); |
427 } | 427 } |
OLD | NEW |