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 499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
510 // Freshly initialized VM gets by with the snapshot size (which is below | 510 // Freshly initialized VM gets by with the snapshot size (which is below |
511 // kMaxInitialSizePerSpace per space). | 511 // kMaxInitialSizePerSpace per space). |
512 Heap* heap = isolate->heap(); | 512 Heap* heap = isolate->heap(); |
513 int page_count[LAST_PAGED_SPACE + 1] = {0, 0, 0, 0}; | 513 int page_count[LAST_PAGED_SPACE + 1] = {0, 0, 0, 0}; |
514 for (int i = FIRST_PAGED_SPACE; i <= LAST_PAGED_SPACE; i++) { | 514 for (int i = FIRST_PAGED_SPACE; i <= LAST_PAGED_SPACE; i++) { |
515 // Debug code can be very large, so skip CODE_SPACE if we are generating it. | 515 // Debug code can be very large, so skip CODE_SPACE if we are generating it. |
516 if (i == CODE_SPACE && i::FLAG_debug_code) continue; | 516 if (i == CODE_SPACE && i::FLAG_debug_code) continue; |
517 | 517 |
518 page_count[i] = heap->paged_space(i)->CountTotalPages(); | 518 page_count[i] = heap->paged_space(i)->CountTotalPages(); |
519 // Check that the initial heap is also below the limit. | 519 // Check that the initial heap is also below the limit. |
520 // In PPC the page size is 64K, hence no memory will be freed causing | |
521 // the initial committed memory in code spaces to be exactly 2M. | |
522 // changing the test case to accomodate this. | |
523 #if V8_OS_LINUX && V8_HOST_ARCH_PPC | |
524 CHECK_LE(heap->paged_space(i)->CommittedMemory(), kMaxInitialSizePerSpace); | |
Michael Lippautz
2016/11/25 15:23:51
I would put the #define_s around kMaxInitialSizePe
| |
525 #else | |
520 CHECK_LT(heap->paged_space(i)->CommittedMemory(), kMaxInitialSizePerSpace); | 526 CHECK_LT(heap->paged_space(i)->CommittedMemory(), kMaxInitialSizePerSpace); |
527 #endif | |
521 } | 528 } |
522 | 529 |
523 // Executing the empty script gets by with the same number of pages, i.e., | 530 // Executing the empty script gets by with the same number of pages, i.e., |
524 // requires no extra space. | 531 // requires no extra space. |
525 CompileRun("/*empty*/"); | 532 CompileRun("/*empty*/"); |
526 for (int i = FIRST_PAGED_SPACE; i <= LAST_PAGED_SPACE; i++) { | 533 for (int i = FIRST_PAGED_SPACE; i <= LAST_PAGED_SPACE; i++) { |
527 // Debug code can be very large, so skip CODE_SPACE if we are generating it. | 534 // Debug code can be very large, so skip CODE_SPACE if we are generating it. |
528 if (i == CODE_SPACE && i::FLAG_debug_code) continue; | 535 if (i == CODE_SPACE && i::FLAG_debug_code) continue; |
529 CHECK_EQ(page_count[i], isolate->heap()->paged_space(i)->CountTotalPages()); | 536 CHECK_EQ(page_count[i], isolate->heap()->paged_space(i)->CountTotalPages()); |
530 } | 537 } |
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
792 HeapObject* filler = | 799 HeapObject* filler = |
793 HeapObject::FromAddress(array->address() + array->Size()); | 800 HeapObject::FromAddress(array->address() + array->Size()); |
794 CHECK_EQ(filler->map(), CcTest::heap()->two_pointer_filler_map()); | 801 CHECK_EQ(filler->map(), CcTest::heap()->two_pointer_filler_map()); |
795 | 802 |
796 const size_t shrinked = page->ShrinkToHighWaterMark(); | 803 const size_t shrinked = page->ShrinkToHighWaterMark(); |
797 CHECK_EQ(0u, shrinked); | 804 CHECK_EQ(0u, shrinked); |
798 } | 805 } |
799 | 806 |
800 } // namespace internal | 807 } // namespace internal |
801 } // namespace v8 | 808 } // namespace v8 |
OLD | NEW |