summaryrefslogtreecommitdiffstats
path: root/runtime/class_linker.cc
diff options
context:
space:
mode:
authorMathieu Chartier <mathieuc@google.com>2014-01-28 14:50:23 -0800
committerMathieu Chartier <mathieuc@google.com>2014-02-11 10:40:10 -0800
commit83c8ee000d525017ead8753fce6bc1020249b96a (patch)
treed5167ed15dee2629905ac3640b6ea0578d4ae312 /runtime/class_linker.cc
parent7cba217ab0661d74deccbb97160cdf60b74d4ea3 (diff)
downloadart-83c8ee000d525017ead8753fce6bc1020249b96a.zip
art-83c8ee000d525017ead8753fce6bc1020249b96a.tar.gz
art-83c8ee000d525017ead8753fce6bc1020249b96a.tar.bz2
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
Diffstat (limited to 'runtime/class_linker.cc')
-rw-r--r--runtime/class_linker.cc12
1 files changed, 7 insertions, 5 deletions
diff --git a/runtime/class_linker.cc b/runtime/class_linker.cc
index 978c99b..5acef70 100644
--- a/runtime/class_linker.cc
+++ b/runtime/class_linker.cc
@@ -1119,14 +1119,15 @@ void ClassLinker::InitFromImage() {
// Keep in sync with InitCallback. Anything we visit, we need to
// reinit references to when reinitializing a ClassLinker from a
// mapped image.
-void ClassLinker::VisitRoots(RootVisitor* visitor, void* arg, bool only_dirty, bool clean_dirty) {
- class_roots_ = down_cast<mirror::ObjectArray<mirror::Class>*>(visitor(class_roots_, arg));
+void ClassLinker::VisitRoots(RootCallback* callback, void* arg, bool only_dirty, bool clean_dirty) {
+ class_roots_ = down_cast<mirror::ObjectArray<mirror::Class>*>(
+ callback(class_roots_, arg, 0, kRootVMInternal));
Thread* self = Thread::Current();
{
ReaderMutexLock mu(self, dex_lock_);
if (!only_dirty || dex_caches_dirty_) {
for (mirror::DexCache*& dex_cache : dex_caches_) {
- dex_cache = down_cast<mirror::DexCache*>(visitor(dex_cache, arg));
+ dex_cache = down_cast<mirror::DexCache*>(callback(dex_cache, arg, 0, kRootVMInternal));
DCHECK(dex_cache != nullptr);
}
if (clean_dirty) {
@@ -1139,7 +1140,7 @@ void ClassLinker::VisitRoots(RootVisitor* visitor, void* arg, bool only_dirty, b
WriterMutexLock mu(self, *Locks::classlinker_classes_lock_);
if (!only_dirty || class_table_dirty_) {
for (std::pair<const size_t, mirror::Class*>& it : class_table_) {
- it.second = down_cast<mirror::Class*>(visitor(it.second, arg));
+ it.second = down_cast<mirror::Class*>(callback(it.second, arg, 0, kRootStickyClass));
DCHECK(it.second != nullptr);
}
if (clean_dirty) {
@@ -1151,7 +1152,8 @@ void ClassLinker::VisitRoots(RootVisitor* visitor, void* arg, bool only_dirty, b
// handle image roots by using the MS/CMS rescanning of dirty cards.
}
- array_iftable_ = reinterpret_cast<mirror::IfTable*>(visitor(array_iftable_, arg));
+ array_iftable_ = reinterpret_cast<mirror::IfTable*>(callback(array_iftable_, arg, 0,
+ kRootVMInternal));
DCHECK(array_iftable_ != nullptr);
}