Chromium Code Reviews| Index: runtime/vm/pages.h |
| =================================================================== |
| --- runtime/vm/pages.h (revision 39568) |
| +++ runtime/vm/pages.h (working copy) |
| @@ -296,6 +296,10 @@ |
| is_protected, is_locked); |
| } |
| + Monitor* tasks_lock() const { return tasks_lock_; } |
| + intptr_t tasks() const { return tasks_; } |
| + void set_tasks(intptr_t val) { tasks_ = val; } |
|
koda
2014/08/26 23:34:49
ASSERT(tasks_ >= 0);
Also consider just having in
Ivan Posva
2014/08/27 01:00:22
Done.
|
| + |
| private: |
| // Ids for time and data records in Heap::GCStats. |
| enum { |
| @@ -311,10 +315,6 @@ |
| kAllowedGrowth = 3 |
| }; |
| - Monitor* tasks_lock() const { return tasks_lock_; } |
| - intptr_t tasks() const { return tasks_; } |
| - void set_tasks(intptr_t val) { tasks_ = val; } |
| - |
| static const intptr_t kAllocatablePageSize = 64 * KB; |
| uword TryAllocateInternal(intptr_t size, |
| @@ -329,8 +329,12 @@ |
| void FreeLargePage(HeapPage* page, HeapPage* previous_page); |
| void FreePages(HeapPage* pages); |
| HeapPage* NextPageAnySize(HeapPage* page) const { |
| - ASSERT(pages_tail_ == NULL || pages_tail_->next() == NULL); |
| - return page == pages_tail_ ? large_pages_ : page->next(); |
| + ASSERT((pages_tail_ == NULL) || (pages_tail_->next() == NULL)); |
| + ASSERT((exec_pages_tail_ == NULL) || (exec_pages_tail_->next() == NULL)); |
| + if (page == pages_tail_) { |
| + return (exec_pages_ != NULL) ? exec_pages_ : large_pages_; |
| + } |
| + return page == exec_pages_tail_ ? large_pages_ : page->next(); |
| } |
| static intptr_t LargePageSizeInWordsFor(intptr_t size); |
| @@ -344,8 +348,11 @@ |
| Heap* heap_; |
| + Mutex* pages_lock_; |
| HeapPage* pages_; |
| HeapPage* pages_tail_; |
| + HeapPage* exec_pages_; |
| + HeapPage* exec_pages_tail_; |
| HeapPage* large_pages_; |
|
koda
2014/08/26 23:34:49
Can large pages be executable?
Ivan Posva
2014/08/27 01:00:22
Yes, large pages survive as a mixed class list.
|
| // Various sizes being tracked for this generation. |
| @@ -362,6 +369,7 @@ |
| intptr_t collections_; |
| friend class PageSpaceController; |
| + friend class SweeperTask; |
| DISALLOW_IMPLICIT_CONSTRUCTORS(PageSpace); |
| }; |