Fix assert in PagedSpace::SizeOfObject for concurrent sweeping.
authorhpayer@chromium.org <hpayer@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Mon, 4 Mar 2013 15:47:59 +0000 (15:47 +0000)
committerhpayer@chromium.org <hpayer@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Mon, 4 Mar 2013 15:47:59 +0000 (15:47 +0000)
BUG=

Review URL: https://codereview.chromium.org/12378071

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13814 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/spaces.cc
src/spaces.h

index 91f8b81..0af587d 100644 (file)
@@ -2476,6 +2476,12 @@ bool PagedSpace::ReserveSpace(int size_in_bytes) {
 }
 
 
+intptr_t PagedSpace::SizeOfObjects() {
+  ASSERT(!heap()->IsSweepingComplete() || (unswept_free_bytes_ == 0));
+  return Size() - unswept_free_bytes_ - (limit() - top());
+}
+
+
 // After we have booted, we have created a map which represents free space
 // on the heap.  If there was already a free list then the elements on it
 // were created with the wrong FreeSpaceMap (normally NULL), so we need to
index e7e11db..fe22341 100644 (file)
@@ -1648,11 +1648,7 @@ class PagedSpace : public Space {
 
   // As size, but the bytes in lazily swept pages are estimated and the bytes
   // in the current linear allocation area are not included.
-  virtual intptr_t SizeOfObjects() {
-    // TODO(hpayer): broken when concurrent sweeping turned on
-    ASSERT(!IsLazySweepingComplete() || (unswept_free_bytes_ == 0));
-    return Size() - unswept_free_bytes_ - (limit() - top());
-  }
+  virtual intptr_t SizeOfObjects();
 
   // Wasted bytes in this space.  These are just the bytes that were thrown away
   // due to being too small to use for allocation.  They do not include the