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

Unified Diff: runtime/vm/gc_sweeper.cc

Issue 649743002: - Fine grain locking of free list when sweeping concurrently. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 2 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/gc_sweeper.cc
===================================================================
--- runtime/vm/gc_sweeper.cc (revision 41045)
+++ runtime/vm/gc_sweeper.cc (working copy)
@@ -13,7 +13,7 @@
namespace dart {
-bool GCSweeper::SweepPage(HeapPage* page, FreeList* freelist) {
+bool GCSweeper::SweepPage(HeapPage* page, FreeList* freelist, bool locked) {
// Keep track whether this page is still in use.
bool in_use = false;
@@ -47,7 +47,11 @@
}
if ((current != start) || (free_end != end)) {
// Only add to the free list if not covering the whole page.
- freelist->FreeLocked(current, obj_size);
+ if (locked) {
+ freelist->FreeLocked(current, obj_size);
+ } else {
+ freelist->Free(current, obj_size);
+ }
}
}
current += obj_size;
@@ -112,11 +116,7 @@
while (page != NULL) {
HeapPage* next_page = page->next();
ASSERT(page->type() == HeapPage::kData);
- bool page_in_use = true;
- {
- MutexLocker ml(freelist_->mutex());
- page_in_use = sweeper.SweepPage(page, freelist_);
- }
+ bool page_in_use = sweeper.SweepPage(page, freelist_, false);
if (page_in_use) {
prev_page = page;
} else {
« runtime/vm/gc_sweeper.h ('K') | « runtime/vm/gc_sweeper.h ('k') | runtime/vm/pages.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698