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/ring_buffer.h" | 10 #include "vm/ring_buffer.h" |
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 kGCTimeFraction = 1, | 289 kGCTimeFraction = 1, |
290 kPageGrowth = 2, | 290 kPageGrowth = 2, |
291 kAllowedGrowth = 3 | 291 kAllowedGrowth = 3 |
292 }; | 292 }; |
293 | 293 |
294 static const intptr_t kAllocatablePageSize = 64 * KB; | 294 static const intptr_t kAllocatablePageSize = 64 * KB; |
295 | 295 |
296 HeapPage* AllocatePage(HeapPage::PageType type); | 296 HeapPage* AllocatePage(HeapPage::PageType type); |
297 void FreePage(HeapPage* page, HeapPage* previous_page); | 297 void FreePage(HeapPage* page, HeapPage* previous_page); |
298 HeapPage* AllocateLargePage(intptr_t size, HeapPage::PageType type); | 298 HeapPage* AllocateLargePage(intptr_t size, HeapPage::PageType type); |
| 299 void TruncateLargePage(HeapPage* page, intptr_t new_object_size_in_bytes); |
299 void FreeLargePage(HeapPage* page, HeapPage* previous_page); | 300 void FreeLargePage(HeapPage* page, HeapPage* previous_page); |
300 void FreePages(HeapPage* pages); | 301 void FreePages(HeapPage* pages); |
301 HeapPage* NextPageAnySize(HeapPage* page) const { | 302 HeapPage* NextPageAnySize(HeapPage* page) const { |
302 ASSERT(pages_tail_ == NULL || pages_tail_->next() == NULL); | 303 ASSERT(pages_tail_ == NULL || pages_tail_->next() == NULL); |
303 return page == pages_tail_ ? large_pages_ : page->next(); | 304 return page == pages_tail_ ? large_pages_ : page->next(); |
304 } | 305 } |
305 | 306 |
306 static intptr_t LargePageSizeInWordsFor(intptr_t size); | 307 static intptr_t LargePageSizeInWordsFor(intptr_t size); |
307 | 308 |
308 bool CanIncreaseCapacityInWords(intptr_t increase_in_words) { | 309 bool CanIncreaseCapacityInWords(intptr_t increase_in_words) { |
(...skipping 22 matching lines...) Expand all Loading... |
331 intptr_t collections_; | 332 intptr_t collections_; |
332 | 333 |
333 friend class PageSpaceController; | 334 friend class PageSpaceController; |
334 | 335 |
335 DISALLOW_IMPLICIT_CONSTRUCTORS(PageSpace); | 336 DISALLOW_IMPLICIT_CONSTRUCTORS(PageSpace); |
336 }; | 337 }; |
337 | 338 |
338 } // namespace dart | 339 } // namespace dart |
339 | 340 |
340 #endif // VM_PAGES_H_ | 341 #endif // VM_PAGES_H_ |
OLD | NEW |