OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/base/bits.h" | 7 #include "src/base/bits.h" |
8 #include "src/base/platform/platform.h" | 8 #include "src/base/platform/platform.h" |
9 #include "src/full-codegen.h" | 9 #include "src/full-codegen.h" |
10 #include "src/heap/mark-compact.h" | 10 #include "src/heap/mark-compact.h" |
(...skipping 904 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
915 if (!chunk->InNewSpace() && !static_cast<Page*>(chunk)->WasSwept()) { | 915 if (!chunk->InNewSpace() && !static_cast<Page*>(chunk)->WasSwept()) { |
916 static_cast<PagedSpace*>(chunk->owner())->IncrementUnsweptFreeBytes(-by); | 916 static_cast<PagedSpace*>(chunk->owner())->IncrementUnsweptFreeBytes(-by); |
917 } | 917 } |
918 chunk->IncrementLiveBytes(by); | 918 chunk->IncrementLiveBytes(by); |
919 } | 919 } |
920 | 920 |
921 | 921 |
922 // ----------------------------------------------------------------------------- | 922 // ----------------------------------------------------------------------------- |
923 // PagedSpace implementation | 923 // PagedSpace implementation |
924 | 924 |
| 925 STATIC_ASSERT(static_cast<ObjectSpace>(1 << AllocationSpace::NEW_SPACE) == |
| 926 ObjectSpace::kObjectSpaceNewSpace); |
| 927 STATIC_ASSERT(static_cast<ObjectSpace>(1 |
| 928 << AllocationSpace::OLD_POINTER_SPACE) == |
| 929 ObjectSpace::kObjectSpaceOldPointerSpace); |
| 930 STATIC_ASSERT(static_cast<ObjectSpace>(1 << AllocationSpace::OLD_DATA_SPACE) == |
| 931 ObjectSpace::kObjectSpaceOldDataSpace); |
| 932 STATIC_ASSERT(static_cast<ObjectSpace>(1 << AllocationSpace::CODE_SPACE) == |
| 933 ObjectSpace::kObjectSpaceCodeSpace); |
| 934 STATIC_ASSERT(static_cast<ObjectSpace>(1 << AllocationSpace::CELL_SPACE) == |
| 935 ObjectSpace::kObjectSpaceCellSpace); |
| 936 STATIC_ASSERT( |
| 937 static_cast<ObjectSpace>(1 << AllocationSpace::PROPERTY_CELL_SPACE) == |
| 938 ObjectSpace::kObjectSpacePropertyCellSpace); |
| 939 STATIC_ASSERT(static_cast<ObjectSpace>(1 << AllocationSpace::MAP_SPACE) == |
| 940 ObjectSpace::kObjectSpaceMapSpace); |
| 941 |
| 942 |
925 PagedSpace::PagedSpace(Heap* heap, intptr_t max_capacity, AllocationSpace space, | 943 PagedSpace::PagedSpace(Heap* heap, intptr_t max_capacity, AllocationSpace space, |
926 Executability executable) | 944 Executability executable) |
927 : Space(heap, space, executable), | 945 : Space(heap, space, executable), |
928 free_list_(this), | 946 free_list_(this), |
929 unswept_free_bytes_(0), | 947 unswept_free_bytes_(0), |
930 end_of_unswept_pages_(NULL), | 948 end_of_unswept_pages_(NULL), |
931 emergency_memory_(NULL) { | 949 emergency_memory_(NULL) { |
932 area_size_ = MemoryAllocator::PageAreaSize(space); | 950 area_size_ = MemoryAllocator::PageAreaSize(space); |
933 max_capacity_ = | 951 max_capacity_ = |
934 (RoundDown(max_capacity, Page::kPageSize) / Page::kPageSize) * AreaSize(); | 952 (RoundDown(max_capacity, Page::kPageSize) / Page::kPageSize) * AreaSize(); |
(...skipping 2270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3205 object->ShortPrint(); | 3223 object->ShortPrint(); |
3206 PrintF("\n"); | 3224 PrintF("\n"); |
3207 } | 3225 } |
3208 printf(" --------------------------------------\n"); | 3226 printf(" --------------------------------------\n"); |
3209 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes()); | 3227 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes()); |
3210 } | 3228 } |
3211 | 3229 |
3212 #endif // DEBUG | 3230 #endif // DEBUG |
3213 } | 3231 } |
3214 } // namespace v8::internal | 3232 } // namespace v8::internal |
OLD | NEW |