More of the concurrent copying collector.

Bug: 12687968
Change-Id: I62f70274d47df6d6cab714df95c518b750ce3105
diff --git a/runtime/runtime.cc b/runtime/runtime.cc
index 9dddf2f..57a849a 100644
--- a/runtime/runtime.cc
+++ b/runtime/runtime.cc
@@ -1219,6 +1219,12 @@
   }
 }
 
+void Runtime::VisitTransactionRoots(RootCallback* callback, void* arg) {
+  if (preinitialization_transaction_ != nullptr) {
+    preinitialization_transaction_->VisitRoots(callback, arg);
+  }
+}
+
 void Runtime::VisitNonThreadRoots(RootCallback* callback, void* arg) {
   java_vm_->VisitRoots(callback, arg);
   sentinel_.VisitRootIfNonNull(callback, arg, RootInfo(kRootVMInternal));
@@ -1238,9 +1244,7 @@
       verifier->VisitRoots(callback, arg);
     }
   }
-  if (preinitialization_transaction_ != nullptr) {
-    preinitialization_transaction_->VisitRoots(callback, arg);
-  }
+  VisitTransactionRoots(callback, arg);
   instrumentation_.VisitRoots(callback, arg);
 }
 
@@ -1249,6 +1253,15 @@
   VisitNonThreadRoots(callback, arg);
 }
 
+void Runtime::VisitThreadRoots(RootCallback* callback, void* arg) {
+  thread_list_->VisitRoots(callback, arg);
+}
+
+size_t Runtime::FlipThreadRoots(Closure* thread_flip_visitor, Closure* flip_callback,
+                                gc::collector::GarbageCollector* collector) {
+  return thread_list_->FlipThreadRoots(thread_flip_visitor, flip_callback, collector);
+}
+
 void Runtime::VisitRoots(RootCallback* callback, void* arg, VisitRootFlags flags) {
   VisitNonConcurrentRoots(callback, arg);
   VisitConcurrentRoots(callback, arg, flags);
@@ -1328,6 +1341,14 @@
   java_vm_->AllowNewWeakGlobals();
 }
 
+void Runtime::EnsureNewSystemWeaksDisallowed() {
+  // Lock and unlock the system weak locks once to ensure that no
+  // threads are still in the middle of adding new system weaks.
+  monitor_list_->EnsureNewMonitorsDisallowed();
+  intern_table_->EnsureNewInternsDisallowed();
+  java_vm_->EnsureNewWeakGlobalsDisallowed();
+}
+
 void Runtime::SetInstructionSet(InstructionSet instruction_set) {
   instruction_set_ = instruction_set;
   if ((instruction_set_ == kThumb2) || (instruction_set_ == kArm)) {