Add root verification when we try to mark an invalid object.

Now when we try to mark an object not contained by any spaces, We call verify
roots. This prints the root's vreg and method when it finds an invalid root.

Fixed a error in the total paused time statistic.

Change-Id: Id10e4097cce56bc54ee488de32183c18ba3f3780
diff --git a/src/gc/mark_sweep.h b/src/gc/mark_sweep.h
index 74b2aa7..76c5428 100644
--- a/src/gc/mark_sweep.h
+++ b/src/gc/mark_sweep.h
@@ -234,6 +234,17 @@
       EXCLUSIVE_LOCKS_REQUIRED(Locks::heap_bitmap_lock_)
       SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
 
+  // Verify the roots of the heap and print out information related to any invalid roots.
+  // Called in MarkObject, so may we may not hold the mutator lock.
+  void VerifyRoots()
+      NO_THREAD_SAFETY_ANALYSIS;
+
+  static void VerifyRootCallback(const Object* root, void* arg, size_t vreg,
+                                 const AbstractMethod* method);
+
+  void VerifyRoot(const Object* root, size_t vreg, const AbstractMethod* method)
+      NO_THREAD_SAFETY_ANALYSIS;
+
   template <typename Visitor>
   static void VisitInstanceFieldsReferences(const Object* obj, const Visitor& visitor)
       SHARED_LOCKS_REQUIRED(Locks::heap_bitmap_lock_, Locks::mutator_lock_) {