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

Unified Diff: src/spaces.h

Issue 9323007: Tweak compaction candidate selection to avoid keeping page with low occupancy around. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 11 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
« src/mark-compact.cc ('K') | « src/runtime.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
diff --git a/src/spaces.h b/src/spaces.h
index 1a30078438ed74bdde507b7888b2e5a1f63ccdb4..0671b4a0b349eb063e37fef36e9fc82633375533 100644
--- a/src/spaces.h
+++ b/src/spaces.h
@@ -1589,50 +1589,8 @@ class PagedSpace : public Space {
Page* FirstPage() { return anchor_.next_page(); }
Page* LastPage() { return anchor_.prev_page(); }
- // Returns zero for pages that have so little fragmentation that it is not
- // worth defragmenting them. Otherwise a positive integer that gives an
- // estimate of fragmentation on an arbitrary scale.
- int Fragmentation(Page* p) {
- FreeList::SizeStats sizes;
- free_list_.CountFreeListItems(p, &sizes);
-
- intptr_t ratio;
- intptr_t ratio_threshold;
- if (identity() == CODE_SPACE) {
- ratio = (sizes.medium_size_ * 10 + sizes.large_size_ * 2) * 100 /
- Page::kObjectAreaSize;
- ratio_threshold = 10;
- } else {
- ratio = (sizes.small_size_ * 5 + sizes.medium_size_) * 100 /
- Page::kObjectAreaSize;
- ratio_threshold = 15;
- }
-
- if (FLAG_trace_fragmentation) {
- PrintF("%p [%d]: %d (%.2f%%) %d (%.2f%%) %d (%.2f%%) %d (%.2f%%) %s\n",
- reinterpret_cast<void*>(p),
- identity(),
- static_cast<int>(sizes.small_size_),
- static_cast<double>(sizes.small_size_ * 100) /
- Page::kObjectAreaSize,
- static_cast<int>(sizes.medium_size_),
- static_cast<double>(sizes.medium_size_ * 100) /
- Page::kObjectAreaSize,
- static_cast<int>(sizes.large_size_),
- static_cast<double>(sizes.large_size_ * 100) /
- Page::kObjectAreaSize,
- static_cast<int>(sizes.huge_size_),
- static_cast<double>(sizes.huge_size_ * 100) /
- Page::kObjectAreaSize,
- (ratio > ratio_threshold) ? "[fragmented]" : "");
- }
-
- 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 CountFreeListItems(Page* p, FreeList::SizeStats* sizes) {
+ free_list_.CountFreeListItems(p, sizes);
}
void EvictEvacuationCandidatesFromFreeLists();
« src/mark-compact.cc ('K') | « src/runtime.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698