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

Unified Diff: src/spaces.h

Issue 8692002: Only sweep one page eagerly unless we are running out of space. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 9 years, 1 month 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
« src/mark-compact.cc ('K') | « src/mark-compact.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/spaces.h
===================================================================
--- src/spaces.h (revision 10059)
+++ src/spaces.h (working copy)
@@ -1557,6 +1557,7 @@
}
void SetPagesToSweep(Page* first) {
+ if (first == &anchor_) first = NULL;
first_unswept_page_ = first;
}
@@ -1569,7 +1570,7 @@
Page* FirstPage() { return anchor_.next_page(); }
Page* LastPage() { return anchor_.prev_page(); }
- bool IsFragmented(Page* p) {
+ int Fragmentation(Page* p) {
Michael Starzinger 2011/11/24 14:43:49 A one-liner comment about the possible range of re
Erik Corry 2011/11/24 17:02:30 Done.
FreeList::SizeStats sizes;
free_list_.CountFreeListItems(p, &sizes);
@@ -1604,8 +1605,12 @@
(ratio > ratio_threshold) ? "[fragmented]" : "");
}
- return (ratio > ratio_threshold) ||
- (FLAG_always_compact && sizes.Total() != Page::kObjectAreaSize);
+ if (FLAG_always_compact && sizes.Total() != Page::kObjectAreaSize) {
+ return 1;
+ }
+ if (ratio <= ratio_threshold) return 0; // Not fragmented.
+
+ return static_cast<int>(ratio - ratio_threshold);
}
void EvictEvacuationCandidatesFromFreeLists();
« src/mark-compact.cc ('K') | « src/mark-compact.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698