ART: Clean up heap headers

Use more forward declarations for accounting structures and spaces.
Factor out structs to reduce header surface. Remove heap include where
unnecessary. Fix up transitive users. Move some debug-only code out
of line.

Test: m test-art-host
Change-Id: I16db4aaa803f39e155ce6e1b0778b7e393dcbb17
diff --git a/runtime/thread.cc b/runtime/thread.cc
index 6848686..c849a12 100644
--- a/runtime/thread.cc
+++ b/runtime/thread.cc
@@ -3442,11 +3442,13 @@
 };
 
 void Thread::VerifyStackImpl() {
-  VerifyRootVisitor visitor;
-  std::unique_ptr<Context> context(Context::Create());
-  RootCallbackVisitor visitor_to_callback(&visitor, GetThreadId());
-  ReferenceMapVisitor<RootCallbackVisitor> mapper(this, context.get(), visitor_to_callback);
-  mapper.WalkStack();
+  if (Runtime::Current()->GetHeap()->IsObjectValidationEnabled()) {
+    VerifyRootVisitor visitor;
+    std::unique_ptr<Context> context(Context::Create());
+    RootCallbackVisitor visitor_to_callback(&visitor, GetThreadId());
+    ReferenceMapVisitor<RootCallbackVisitor> mapper(this, context.get(), visitor_to_callback);
+    mapper.WalkStack();
+  }
 }
 
 // Set the stack end to that to be used during a stack overflow