Check point root marking.

Added thread list checkpoint function, this goes through every thread and runs
the checkpoint on each thread. Threads that are runnable run the checkpoint
callback themselves in the next suspend check, while suspended threads are
left suspended but have the callback called on them.

Added a checkpoint visitor member to each thread, this visitor called when the
checkpoint request flag is set during transitions to suspended from runnable.

Using the checkpoint to mark the roots reduces the first pause of partial /
full gc to around 1 ms.

Change-Id: I97239cc72ee0e4a3397e9138a62ee559268dce0a
diff --git a/src/runtime.cc b/src/runtime.cc
index 3a5c41c..7bc1b70 100644
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -1002,10 +1002,9 @@
   }
 }
 
-void Runtime::VisitNonConcurrentRoots(Heap::RootVisitor* visitor, void* arg) {
+void Runtime::VisitNonThreadRoots(Heap::RootVisitor* visitor, void* arg) {
   Dbg::VisitRoots(visitor, arg);
   java_vm_->VisitRoots(visitor, arg);
-  thread_list_->VisitRoots(visitor, arg);
   if (pre_allocated_OutOfMemoryError_ != NULL) {
     visitor(pre_allocated_OutOfMemoryError_, arg);
   }
@@ -1020,6 +1019,11 @@
   }
 }
 
+void Runtime::VisitNonConcurrentRoots(Heap::RootVisitor* visitor, void* arg) {
+  thread_list_->VisitRoots(visitor, arg);
+  VisitNonThreadRoots(visitor, arg);
+}
+
 void Runtime::DirtyRoots() {
   intern_table_->Dirty();
   class_linker_->Dirty();