diff options
author | 2016-10-17 15:46:31 -0700 | |
---|---|---|
committer | 2016-10-17 16:16:50 -0700 | |
commit | bc5a795c0d486c84913d987cad5846ded840cea6 (patch) | |
tree | 90db29a97a21fa15f4cbc5ffbc1f6dd191add49c /runtime/class_table.cc | |
parent | 38a4223fcc0493553d9ad324a1dc145869eb663a (diff) |
Move art/native to ObjPtr
Bug: 31113334
Test: test-art-host
Change-Id: I67eb89cf042c762c6dcd5eb8b008b9a28e9b3319
Diffstat (limited to 'runtime/class_table.cc')
-rw-r--r-- | runtime/class_table.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/runtime/class_table.cc b/runtime/class_table.cc index 2ae7e8cc30..d43505054e 100644 --- a/runtime/class_table.cc +++ b/runtime/class_table.cc @@ -156,7 +156,7 @@ uint32_t ClassTable::ClassDescriptorHashEquals::operator()(const char* descripto return ComputeModifiedUtf8Hash(descriptor); } -bool ClassTable::InsertStrongRoot(mirror::Object* obj) { +bool ClassTable::InsertStrongRoot(ObjPtr<mirror::Object> obj) { WriterMutexLock mu(Thread::Current(), lock_); DCHECK(obj != nullptr); for (GcRoot<mirror::Object>& root : strong_roots_) { @@ -167,7 +167,7 @@ bool ClassTable::InsertStrongRoot(mirror::Object* obj) { strong_roots_.push_back(GcRoot<mirror::Object>(obj)); // If `obj` is a dex cache associated with a new oat file with GC roots, add it to oat_files_. if (obj->IsDexCache()) { - const DexFile* dex_file = down_cast<mirror::DexCache*>(obj)->GetDexFile(); + const DexFile* dex_file = ObjPtr<mirror::DexCache>::DownCast(obj)->GetDexFile(); if (dex_file != nullptr && dex_file->GetOatDexFile() != nullptr) { const OatFile* oat_file = dex_file->GetOatDexFile()->GetOatFile(); if (!oat_file->GetBssGcRoots().empty() && !ContainsElement(oat_files_, oat_file)) { |