| 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 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 464 // Freshly initialized VM gets by with the snapshot size (which is below | 464 // Freshly initialized VM gets by with the snapshot size (which is below |
| 465 // kMaxInitialSizePerSpace per space). | 465 // kMaxInitialSizePerSpace per space). |
| 466 Heap* heap = isolate->heap(); | 466 Heap* heap = isolate->heap(); |
| 467 int page_count[LAST_PAGED_SPACE + 1] = {0, 0, 0, 0}; | 467 int page_count[LAST_PAGED_SPACE + 1] = {0, 0, 0, 0}; |
| 468 for (int i = FIRST_PAGED_SPACE; i <= LAST_PAGED_SPACE; i++) { | 468 for (int i = FIRST_PAGED_SPACE; i <= LAST_PAGED_SPACE; i++) { |
| 469 // Debug code can be very large, so skip CODE_SPACE if we are generating it. | 469 // Debug code can be very large, so skip CODE_SPACE if we are generating it. |
| 470 if (i == CODE_SPACE && i::FLAG_debug_code) continue; | 470 if (i == CODE_SPACE && i::FLAG_debug_code) continue; |
| 471 | 471 |
| 472 page_count[i] = heap->paged_space(i)->CountTotalPages(); | 472 page_count[i] = heap->paged_space(i)->CountTotalPages(); |
| 473 // Check that the initial heap is also below the limit. | 473 // Check that the initial heap is also below the limit. |
| 474 CHECK_LT(heap->paged_space(i)->CommittedMemory(), kMaxInitialSizePerSpace); | 474 CHECK_LE(heap->paged_space(i)->CommittedMemory(), kMaxInitialSizePerSpace); |
| 475 } | 475 } |
| 476 | 476 |
| 477 // Executing the empty script gets by with the same number of pages, i.e., | 477 // Executing the empty script gets by with the same number of pages, i.e., |
| 478 // requires no extra space. | 478 // requires no extra space. |
| 479 CompileRun("/*empty*/"); | 479 CompileRun("/*empty*/"); |
| 480 for (int i = FIRST_PAGED_SPACE; i <= LAST_PAGED_SPACE; i++) { | 480 for (int i = FIRST_PAGED_SPACE; i <= LAST_PAGED_SPACE; i++) { |
| 481 // Skip CODE_SPACE, since we had to generate code even for an empty script. | 481 // Skip CODE_SPACE, since we had to generate code even for an empty script. |
| 482 if (i == CODE_SPACE) continue; | 482 if (i == CODE_SPACE) continue; |
| 483 CHECK_EQ(page_count[i], isolate->heap()->paged_space(i)->CountTotalPages()); | 483 CHECK_EQ(page_count[i], isolate->heap()->paged_space(i)->CountTotalPages()); |
| 484 } | 484 } |
| (...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 752 HeapObject* filler = | 752 HeapObject* filler = |
| 753 HeapObject::FromAddress(array->address() + array->Size()); | 753 HeapObject::FromAddress(array->address() + array->Size()); |
| 754 CHECK_EQ(filler->map(), CcTest::heap()->two_pointer_filler_map()); | 754 CHECK_EQ(filler->map(), CcTest::heap()->two_pointer_filler_map()); |
| 755 | 755 |
| 756 const size_t shrinked = page->ShrinkToHighWaterMark(); | 756 const size_t shrinked = page->ShrinkToHighWaterMark(); |
| 757 CHECK_EQ(0u, shrinked); | 757 CHECK_EQ(0u, shrinked); |
| 758 } | 758 } |
| 759 | 759 |
| 760 } // namespace internal | 760 } // namespace internal |
| 761 } // namespace v8 | 761 } // namespace v8 |
| OLD | NEW |