Always sweep precisely.
authorhpayer@chromium.org <hpayer@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Mon, 21 Jul 2014 10:39:10 +0000 (10:39 +0000)
committerhpayer@chromium.org <hpayer@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Mon, 21 Jul 2014 10:39:10 +0000 (10:39 +0000)
BUG=
R=jarin@chromium.org

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

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

src/flag-definitions.h
src/heap.cc

index 2c9907e..94d2d1c 100644 (file)
@@ -515,7 +515,7 @@ DEFINE_BOOL(trace_incremental_marking, false,
             "trace progress of the incremental marking")
 DEFINE_BOOL(track_gc_object_stats, false,
             "track object counts and memory usage")
-DEFINE_BOOL(always_precise_sweeping, false, "always sweep precisely")
+DEFINE_BOOL(always_precise_sweeping, true, "always sweep precisely")
 DEFINE_BOOL(parallel_sweeping, false, "enable parallel sweeping")
 DEFINE_BOOL(concurrent_sweeping, true, "enable concurrent sweeping")
 DEFINE_INT(sweeper_threads, 0,
index 3b36ef5..c53c9a7 100644 (file)
@@ -4208,6 +4208,8 @@ STRUCT_LIST(MAKE_CASE)
 
 
 bool Heap::IsHeapIterable() {
+  // TODO(hpayer): This function is not correct. Allocation folding in old
+  // space breaks the iterability.
   return (old_pointer_space()->swept_precisely() &&
           old_data_space()->swept_precisely() &&
           new_space_top_after_last_gc_ == new_space()->top());
@@ -4219,6 +4221,9 @@ void Heap::MakeHeapIterable() {
   if (!IsHeapIterable()) {
     CollectAllGarbage(kMakeHeapIterableMask, "Heap::MakeHeapIterable");
   }
+  if (mark_compact_collector()->sweeping_in_progress()) {
+    mark_compact_collector()->EnsureSweepingCompleted();
+  }
   ASSERT(IsHeapIterable());
 }