Reviewers: Michael Starzinger,

Description:
Fix assert in PagedSpace::SizeOfObject for concurrent sweeping.


BUG=


Please review this at https://codereview.chromium.org/12378071/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files:
  M src/spaces.h
  M src/spaces.cc


Index: src/spaces.cc
diff --git a/src/spaces.cc b/src/spaces.cc
index 91f8b81ed8c27be4702ee51b9a14d2dca1f6f8fe..1d6a4ac36e0ed2bb0268977e771b31100f3a1448 100644
--- a/src/spaces.cc
+++ b/src/spaces.cc
@@ -2476,6 +2476,13 @@ bool PagedSpace::ReserveSpace(int size_in_bytes) {
 }


+intptr_t PagedSpace::SizeOfObjects() {
+  ASSERT(!IsLazySweepingComplete() || (unswept_free_bytes_ == 0) ||
+ heap()->mark_compact_collector()->IsConcurrentSweepingInProgress());
+  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: src/spaces.h
diff --git a/src/spaces.h b/src/spaces.h
index e7e11db55f7e9de7c91342e13f6268a74454514e..fe22341308f029dd8dd15128f0c7682056b8630e 100644
--- a/src/spaces.h
+++ b/src/spaces.h
@@ -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


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to