Index: src/heap.cc |
=================================================================== |
--- src/heap.cc (revision 2034) |
+++ src/heap.cc (working copy) |
@@ -2663,12 +2663,13 @@ |
#endif // DEBUG |
-void Heap::IterateRSetRange(Address object_start, |
- Address object_end, |
- Address rset_start, |
- ObjectSlotCallback copy_object_func) { |
+int Heap::IterateRSetRange(Address object_start, |
+ Address object_end, |
+ Address rset_start, |
+ ObjectSlotCallback copy_object_func) { |
Address object_address = object_start; |
Address rset_address = rset_start; |
+ int set_bits_count = 0; |
// Loop over all the pointers in [object_start, object_end). |
while (object_address < object_end) { |
@@ -2685,6 +2686,7 @@ |
// If this pointer does not need to be remembered anymore, clear |
// the remembered set bit. |
if (!Heap::InNewSpace(*object_p)) result_rset &= ~bitmask; |
+ set_bits_count++; |
} |
object_address += kPointerSize; |
} |
@@ -2698,18 +2700,28 @@ |
} |
rset_address += kIntSize; |
} |
+ return set_bits_count; |
} |
void Heap::IterateRSet(PagedSpace* space, ObjectSlotCallback copy_object_func) { |
ASSERT(Page::is_rset_in_use()); |
ASSERT(space == old_pointer_space_ || space == map_space_); |
+ |
+ static void* paged_rset_histogram = StatsTable::CreateHistogram( |
+ "V8.RSet_Paged", |
+ 0, |
+ Page::kObjectAreaSize / kPointerSize, |
+ 30); |
PageIterator it(space, PageIterator::PAGES_IN_USE); |
while (it.has_next()) { |
Page* page = it.next(); |
- IterateRSetRange(page->ObjectAreaStart(), page->AllocationTop(), |
- page->RSetStart(), copy_object_func); |
+ int count = IterateRSetRange(page->ObjectAreaStart(), page->AllocationTop(), |
+ page->RSetStart(), copy_object_func); |
+ if (paged_rset_histogram != NULL) { |
+ StatsTable::AddHistogramSample(paged_rset_histogram, count); |
+ } |
} |
} |