Revision: 9772
Author:   [email protected]
Date:     Tue Oct 25 05:13:06 2011
Log:      Speed up debug mode GC.
Review URL: http://codereview.chromium.org/8380038
http://code.google.com/p/v8/source/detail?r=9772

Modified:
 /branches/bleeding_edge/src/incremental-marking.cc
 /branches/bleeding_edge/src/mark-compact-inl.h
 /branches/bleeding_edge/src/mark-compact.cc
 /branches/bleeding_edge/src/mark-compact.h

=======================================
--- /branches/bleeding_edge/src/incremental-marking.cc Fri Oct 21 03:33:50 2011 +++ /branches/bleeding_edge/src/incremental-marking.cc Tue Oct 25 05:13:06 2011
@@ -473,7 +473,9 @@

 #ifdef DEBUG
   // Marking bits are cleared by the sweeper.
-  heap_->mark_compact_collector()->VerifyMarkbitsAreClean();
+  if (FLAG_enable_slow_asserts) {
+    heap_->mark_compact_collector()->VerifyMarkbitsAreClean();
+  }
 #endif

   heap_->CompletelyClearInstanceofCache();
=======================================
--- /branches/bleeding_edge/src/mark-compact-inl.h      Thu Oct 13 04:50:00 2011
+++ /branches/bleeding_edge/src/mark-compact-inl.h      Tue Oct 25 05:13:06 2011
@@ -54,9 +54,6 @@
   if (!mark_bit.Get()) {
     mark_bit.Set();
     MemoryChunk::IncrementLiveBytes(obj->address(), obj->Size());
-#ifdef DEBUG
-    UpdateLiveObjectCount(obj);
-#endif
     ProcessNewlyMarkedObject(obj);
   }
 }
@@ -67,9 +64,6 @@
   ASSERT(Marking::MarkBitFrom(obj) == mark_bit);
   mark_bit.Set();
   MemoryChunk::IncrementLiveBytes(obj->address(), obj->Size());
-#ifdef DEBUG
-  UpdateLiveObjectCount(obj);
-#endif
 }


=======================================
--- /branches/bleeding_edge/src/mark-compact.cc Thu Oct 20 04:40:16 2011
+++ /branches/bleeding_edge/src/mark-compact.cc Tue Oct 25 05:13:06 2011
@@ -65,16 +65,6 @@
       collect_maps_(FLAG_collect_maps),
       tracer_(NULL),
       migration_slots_buffer_(NULL),
-#ifdef DEBUG
-      live_young_objects_size_(0),
-      live_old_pointer_objects_size_(0),
-      live_old_data_objects_size_(0),
-      live_code_objects_size_(0),
-      live_map_objects_size_(0),
-      live_cell_objects_size_(0),
-      live_lo_objects_size_(0),
-      live_bytes_(0),
-#endif
       heap_(NULL),
       code_flusher_(NULL),
       encountered_weak_maps_(NULL) { }
@@ -523,21 +513,10 @@
   }

 #ifdef DEBUG
-  if (!was_marked_incrementally_) {
+  if (!was_marked_incrementally_ && FLAG_verify_heap) {
     VerifyMarkbitsAreClean();
   }
 #endif
-
-#ifdef DEBUG
-  live_bytes_ = 0;
-  live_young_objects_size_ = 0;
-  live_old_pointer_objects_size_ = 0;
-  live_old_data_objects_size_ = 0;
-  live_code_objects_size_ = 0;
-  live_map_objects_size_ = 0;
-  live_cell_objects_size_ = 0;
-  live_lo_objects_size_ = 0;
-#endif
 }


@@ -2174,32 +2153,6 @@
   }
   ProcessMarkingDeque();
 }
-
-
-#ifdef DEBUG
-void MarkCompactCollector::UpdateLiveObjectCount(HeapObject* obj) {
-  live_bytes_ += obj->Size();
-  if (heap()->new_space()->Contains(obj)) {
-    live_young_objects_size_ += obj->Size();
-  } else if (heap()->map_space()->Contains(obj)) {
-    ASSERT(obj->IsMap());
-    live_map_objects_size_ += obj->Size();
-  } else if (heap()->cell_space()->Contains(obj)) {
-    ASSERT(obj->IsJSGlobalPropertyCell());
-    live_cell_objects_size_ += obj->Size();
-  } else if (heap()->old_pointer_space()->Contains(obj)) {
-    live_old_pointer_objects_size_ += obj->Size();
-  } else if (heap()->old_data_space()->Contains(obj)) {
-    live_old_data_objects_size_ += obj->Size();
-  } else if (heap()->code_space()->Contains(obj)) {
-    live_code_objects_size_ += obj->Size();
-  } else if (heap()->lo_space()->Contains(obj)) {
-    live_lo_objects_size_ += obj->Size();
-  } else {
-    UNREACHABLE();
-  }
-}
-#endif  // DEBUG


 void MarkCompactCollector::ReattachInitialMaps() {
@@ -3649,8 +3602,6 @@
   // of the previous ones.
   SweepSpace(heap()->map_space(), PRECISE);

-  ASSERT(live_map_objects_size_ <= heap()->map_space()->Size());
-
   // Deallocate unmarked objects and clear marked bits for marked objects.
   heap_->lo_space()->FreeUnmarkedObjects();
 }
=======================================
--- /branches/bleeding_edge/src/mark-compact.h  Thu Oct 20 04:40:16 2011
+++ /branches/bleeding_edge/src/mark-compact.h  Tue Oct 25 05:13:06 2011
@@ -669,10 +669,6 @@
   // heap object.
   static bool IsUnmarkedHeapObject(Object** p);

-#ifdef DEBUG
-  void UpdateLiveObjectCount(HeapObject* obj);
-#endif
-
   // Map transitions from a live map to a dead map must be killed.
   // We replace them with a null descriptor, with the same key.
   void ClearNonLiveTransitions();
@@ -720,35 +716,6 @@
   void SweepSpace(PagedSpace* space, SweeperType sweeper);

 #ifdef DEBUG
- // -----------------------------------------------------------------------
-  // Debugging variables, functions and classes
-  // Counters used for debugging the marking phase of mark-compact or
-  // mark-sweep collection.
-
-  // Size of live objects in Heap::to_space_.
-  int live_young_objects_size_;
-
-  // Size of live objects in Heap::old_pointer_space_.
-  int live_old_pointer_objects_size_;
-
-  // Size of live objects in Heap::old_data_space_.
-  int live_old_data_objects_size_;
-
-  // Size of live objects in Heap::code_space_.
-  int live_code_objects_size_;
-
-  // Size of live objects in Heap::map_space_.
-  int live_map_objects_size_;
-
-  // Size of live objects in Heap::cell_space_.
-  int live_cell_objects_size_;
-
-  // Size of live objects in Heap::lo_space_.
-  int live_lo_objects_size_;
-
-  // Number of live bytes in this collection.
-  int live_bytes_;
-
   friend class MarkObjectVisitor;
   static void VisitObject(HeapObject* obj);

--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to