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(); |