Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(47)

Unified Diff: runtime/vm/pages.h

Issue 503363005: - Add and enable concurrent sweeper. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: runtime/vm/pages.h
===================================================================
--- runtime/vm/pages.h (revision 39573)
+++ runtime/vm/pages.h (working copy)
@@ -296,6 +296,13 @@
is_protected, is_locked);
}
+ Monitor* tasks_lock() const { return tasks_lock_; }
+ intptr_t tasks() const { return tasks_; }
+ void set_tasks(intptr_t val) {
+ ASSERT(val >= 0);
+ tasks_ = val;
+ }
+
private:
// Ids for time and data records in Heap::GCStats.
enum {
@@ -311,10 +318,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 +332,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 +351,11 @@
Heap* heap_;
+ Mutex* pages_lock_;
HeapPage* pages_;
HeapPage* pages_tail_;
+ HeapPage* exec_pages_;
+ HeapPage* exec_pages_tail_;
HeapPage* large_pages_;
// Various sizes being tracked for this generation.
@@ -362,6 +372,7 @@
intptr_t collections_;
friend class PageSpaceController;
+ friend class SweeperTask;
DISALLOW_IMPLICIT_CONSTRUCTORS(PageSpace);
};
« runtime/vm/heap.cc ('K') | « runtime/vm/metrics.cc ('k') | runtime/vm/pages.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698