Index: src/spaces.cc |
diff --git a/src/spaces.cc b/src/spaces.cc |
index ebd3e6519208d9103a1b9d5e5bd975442d14c7fb..1bcea22b8e1850116c44ac91f384cad426888898 100644 |
--- a/src/spaces.cc |
+++ b/src/spaces.cc |
@@ -749,6 +749,20 @@ int PagedSpace::CountTotalPages() { |
} |
+intptr_t PagedSpace::SizeOfObjectsSlow() { |
Vyacheslav Egorov (Chromium)
2012/01/10 17:42:43
we will call this function at least once at the en
Michael Starzinger
2012/01/11 09:55:57
Done. Yes, we can.
|
+ PageIterator it(this); |
+ intptr_t size_of_objects = accounting_stats_.Size(); |
+ while (it.has_next()) { |
+ Page* p = it.next(); |
+ if (!p->WasSwept()) { |
+ size_of_objects -= Page::kObjectAreaSize; |
+ size_of_objects += p->LiveBytes(); |
+ } |
+ } |
+ return size_of_objects - (limit() - top()); |
+} |
+ |
+ |
void PagedSpace::ReleasePage(Page* page) { |
ASSERT(page->LiveBytes() == 0); |