Add root types and thread id to root visiting.
Enables us to pass the root type and thread id to hprof.
Bug: 12680863
Change-Id: I6a0f1f9e3aa8f9b4033d695818ae7ca3460d67cb
diff --git a/runtime/native/dalvik_system_VMDebug.cc b/runtime/native/dalvik_system_VMDebug.cc
index d9baaaf..6482917 100644
--- a/runtime/native/dalvik_system_VMDebug.cc
+++ b/runtime/native/dalvik_system_VMDebug.cc
@@ -234,9 +234,8 @@
jboolean countAssignable) {
ScopedObjectAccess soa(env);
gc::Heap* heap = Runtime::Current()->GetHeap();
- // We only want reachable instances, so do a GC. This also ensures that the alloc stack
- // is empty, so the live bitmap is the only place we need to look. Need to do GC before decoding
- // any jobjects.
+ // We only want reachable instances, so do a GC. Heap::VisitObjects visits all of the heap
+ // objects in the all spaces and the allocation stack.
heap->CollectGarbage(false);
mirror::Class* c = soa.Decode<mirror::Class*>(javaClass);
if (c == nullptr) {