diff options
author | Andreas Gampe <agampe@google.com> | 2015-03-02 20:57:47 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2015-03-02 20:59:13 +0000 |
commit | 9924fd8f27e020e9336a085333ef7c68699b8c22 (patch) | |
tree | 0d68afb266795d2dfaf8ce152710e0b56cf2a2df /runtime/class_linker.cc | |
parent | 0b25c71ac93fb10c484dbacb9e23db505a8e2353 (diff) | |
parent | 324b9bb2f48be39e20077c1d7da45cf3dc47fe06 (diff) | |
download | android_art-9924fd8f27e020e9336a085333ef7c68699b8c22.tar.gz android_art-9924fd8f27e020e9336a085333ef7c68699b8c22.tar.bz2 android_art-9924fd8f27e020e9336a085333ef7c68699b8c22.zip |
Merge "ART: Move DexFile vector to Java array"
Diffstat (limited to 'runtime/class_linker.cc')
-rw-r--r-- | runtime/class_linker.cc | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/runtime/class_linker.cc b/runtime/class_linker.cc index ee5eefbc45..03c5a1188f 100644 --- a/runtime/class_linker.cc +++ b/runtime/class_linker.cc @@ -2133,15 +2133,16 @@ mirror::Class* ClassLinker::FindClassInPathClassLoader(ScopedObjectAccessAlready } mirror::Object* dex_file = dex_file_field->GetObject(element); if (dex_file != nullptr) { - const uint64_t cookie = cookie_field->GetLong(dex_file); - auto* dex_files = - reinterpret_cast<std::vector<const DexFile*>*>(static_cast<uintptr_t>(cookie)); - if (dex_files == nullptr) { + mirror::LongArray* long_array = cookie_field->GetObject(dex_file)->AsLongArray(); + if (long_array == nullptr) { // This should never happen so log a warning. LOG(WARNING) << "Null DexFile::mCookie for " << descriptor; break; } - for (const DexFile* cp_dex_file : *dex_files) { + int32_t long_array_size = long_array->GetLength(); + for (int32_t j = 0; j < long_array_size; ++j) { + const DexFile* cp_dex_file = reinterpret_cast<const DexFile*>(static_cast<uintptr_t>( + long_array->GetWithoutChecks(j))); const DexFile::ClassDef* dex_class_def = cp_dex_file->FindClassDef(descriptor, hash); if (dex_class_def != nullptr) { RegisterDexFile(*cp_dex_file); |