Make debugger / jdwp compaction safe.

Fixed GetInstances, GetReferringObjects, CountInstances to use
VisitObjects instead of the live bitmap.

We now treat the object registry as system weaks and update the
objects when/if they move. Also added the recent_allocation_records_
as roots.

Bug: 12936165

Change-Id: I615c289efbf2977ceab5c4ffa73d216d799e6e33
diff --git a/runtime/runtime.cc b/runtime/runtime.cc
index 17afb43..09d05d1 100644
--- a/runtime/runtime.cc
+++ b/runtime/runtime.cc
@@ -379,6 +379,7 @@
   GetInternTable()->SweepInternTableWeaks(visitor, arg);
   GetMonitorList()->SweepMonitorList(visitor, arg);
   GetJavaVM()->SweepJniWeakGlobals(visitor, arg);
+  Dbg::UpdateObjectPointers(visitor, arg);
 }
 
 static gc::CollectorType ParseCollectorType(const std::string& option) {
@@ -1495,12 +1496,14 @@
   monitor_list_->DisallowNewMonitors();
   intern_table_->DisallowNewInterns();
   java_vm_->DisallowNewWeakGlobals();
+  Dbg::DisallowNewObjectRegistryObjects();
 }
 
 void Runtime::AllowNewSystemWeaks() {
   monitor_list_->AllowNewMonitors();
   intern_table_->AllowNewInterns();
   java_vm_->AllowNewWeakGlobals();
+  Dbg::AllowNewObjectRegistryObjects();
 }
 
 void Runtime::SetCalleeSaveMethod(mirror::ArtMethod* method, CalleeSaveType type) {