Fix invalid root detection using wrong function to find space from object.

Fixes issue where a check would fail when we have a bad root instead of
returning NULL. This caused us to abort before outputting some of the
information.

Add large object space to DumpSpaces.

Add DumpSpaces calls to most places calling IsHeapAddress.

Change-Id: I34879fbaa3cd4d6589834a71b1069ca0cee9e701
diff --git a/src/gc/large_object_space.cc b/src/gc/large_object_space.cc
index 72c6c73..b066dd5 100644
--- a/src/gc/large_object_space.cc
+++ b/src/gc/large_object_space.cc
@@ -267,4 +267,10 @@
   return reinterpret_cast<Object*>(addr);
 }
 
+void FreeListSpace::Dump(std::ostream& os) const{
+  os << GetName() << " -"
+     << " begin: " << reinterpret_cast<void*>(Begin())
+     << " end: " << reinterpret_cast<void*>(End());
+}
+
 }
diff --git a/src/gc/large_object_space.h b/src/gc/large_object_space.h
index 2bf6abf..979fce6 100644
--- a/src/gc/large_object_space.h
+++ b/src/gc/large_object_space.h
@@ -131,6 +131,9 @@
   size_t Size() const {
     return End() - Begin();
   }
+
+  virtual void Dump(std::ostream& os) const;
+
  private:
   static const size_t kAlignment = kPageSize;
 
diff --git a/src/gc/mark_sweep.cc b/src/gc/mark_sweep.cc
index e4cb4d6..da6a593 100644
--- a/src/gc/mark_sweep.cc
+++ b/src/gc/mark_sweep.cc
@@ -179,7 +179,7 @@
 
 void MarkSweep::VerifyRoot(const Object* root, size_t vreg, const AbstractMethod* method) {
   // See if the root is on any space bitmap.
-  if (heap_->FindSpaceFromObject(root) == NULL) {
+  if (GetHeap()->GetLiveBitmap()->GetSpaceBitmap(root) == NULL) {
     LargeObjectSpace* large_object_space = GetHeap()->GetLargeObjectsSpace();
     if (large_object_space->Contains(root)) {
       LOG(ERROR) << "Found invalid root: " << root;
diff --git a/src/gc/space.cc b/src/gc/space.cc
index 4d5ce93..a7a5942 100644
--- a/src/gc/space.cc
+++ b/src/gc/space.cc
@@ -434,7 +434,6 @@
     new_size = current_space_size;
   }
   mspace_set_footprint_limit(mspace_, new_size);
-  LOG(INFO) << "Setting footprint limit to " << new_size;
 }
 
 size_t ImageSpace::bitmap_index_ = 0;