| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef VM_PAGES_H_ | 5 #ifndef VM_PAGES_H_ |
| 6 #define VM_PAGES_H_ | 6 #define VM_PAGES_H_ |
| 7 | 7 |
| 8 #include "vm/freelist.h" | 8 #include "vm/freelist.h" |
| 9 #include "vm/globals.h" | 9 #include "vm/globals.h" |
| 10 #include "vm/virtual_memory.h" | 10 #include "vm/virtual_memory.h" |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 private: | 97 private: |
| 98 static const intptr_t kAllocatablePageSize = kPageSize - sizeof(HeapPage); | 98 static const intptr_t kAllocatablePageSize = kPageSize - sizeof(HeapPage); |
| 99 | 99 |
| 100 void AllocatePage(); | 100 void AllocatePage(); |
| 101 HeapPage* AllocateLargePage(intptr_t size); | 101 HeapPage* AllocateLargePage(intptr_t size); |
| 102 void FreeLargePage(HeapPage* page, HeapPage* previous_page); | 102 void FreeLargePage(HeapPage* page, HeapPage* previous_page); |
| 103 void FreePages(HeapPage* pages); | 103 void FreePages(HeapPage* pages); |
| 104 | 104 |
| 105 static intptr_t LargePageSizeFor(intptr_t size); | 105 static intptr_t LargePageSizeFor(intptr_t size); |
| 106 bool CanIncreaseCapacity(intptr_t increase) { | 106 bool CanIncreaseCapacity(intptr_t increase) { |
| 107 ASSERT(capacity_ < max_capacity_); | 107 ASSERT(capacity_ <= max_capacity_); |
| 108 return increase <= (max_capacity_ - capacity_); | 108 return increase <= (max_capacity_ - capacity_); |
| 109 } | 109 } |
| 110 | 110 |
| 111 uword TryBumpAllocate(intptr_t size); | 111 uword TryBumpAllocate(intptr_t size); |
| 112 | 112 |
| 113 FreeList freelist_; | 113 FreeList freelist_; |
| 114 | 114 |
| 115 Heap* heap_; | 115 Heap* heap_; |
| 116 | 116 |
| 117 HeapPage* pages_; | 117 HeapPage* pages_; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 130 | 130 |
| 131 // Keep track whether a MarkSweep is currently running. | 131 // Keep track whether a MarkSweep is currently running. |
| 132 bool sweeping_; | 132 bool sweeping_; |
| 133 | 133 |
| 134 DISALLOW_IMPLICIT_CONSTRUCTORS(PageSpace); | 134 DISALLOW_IMPLICIT_CONSTRUCTORS(PageSpace); |
| 135 }; | 135 }; |
| 136 | 136 |
| 137 } // namespace dart | 137 } // namespace dart |
| 138 | 138 |
| 139 #endif // VM_PAGES_H_ | 139 #endif // VM_PAGES_H_ |
| OLD | NEW |