diff options
author | 2022-10-17 14:40:10 +0000 | |
---|---|---|
committer | 2022-10-17 14:49:17 +0000 | |
commit | 839193ee2031d28aac2ce16c4b76ad40531b07cc (patch) | |
tree | 423345e359f13f854d595766f4305a1aa939afd3 /runtime/class_loader_utils.h | |
parent | b29834dfbf2bc36496c023c0d78c8c5b603cb825 (diff) |
Revert "Change well known `ClassLoader` fields to `ArtField*`."
This reverts commit afe6902accb6a4d3b3382cc501c4d005b6fb5b96.
Reason for revert: This may have broken Golem benchmarks.
Bug: 253570082
Change-Id: I5507a4591c0bad8d778820f6fafc61fdc65e2f54
Diffstat (limited to 'runtime/class_loader_utils.h')
-rw-r--r-- | runtime/class_loader_utils.h | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/runtime/class_loader_utils.h b/runtime/class_loader_utils.h index aabc4ca91d..c7773709bf 100644 --- a/runtime/class_loader_utils.h +++ b/runtime/class_loader_utils.h @@ -82,11 +82,13 @@ inline RetType VisitClassLoaderDexElements(ScopedObjectAccessAlreadyRunnable& so REQUIRES_SHARED(Locks::mutator_lock_) { Thread* self = soa.Self(); ObjPtr<mirror::Object> dex_path_list = - WellKnownClasses::dalvik_system_BaseDexClassLoader_pathList->GetObject(class_loader.Get()); + jni::DecodeArtField(WellKnownClasses::dalvik_system_BaseDexClassLoader_pathList)-> + GetObject(class_loader.Get()); if (dex_path_list != nullptr) { // DexPathList has an array dexElements of Elements[] which each contain a dex file. ObjPtr<mirror::Object> dex_elements_obj = - WellKnownClasses::dalvik_system_DexPathList_dexElements->GetObject(dex_path_list); + jni::DecodeArtField(WellKnownClasses::dalvik_system_DexPathList_dexElements)-> + GetObject(dex_path_list); // Loop through each dalvik.system.DexPathList$Element's dalvik.system.DexFile and look // at the mCookie which is a DexFile vector. if (dex_elements_obj != nullptr) { @@ -120,8 +122,10 @@ inline RetType VisitClassLoaderDexFiles(ScopedObjectAccessAlreadyRunnable& soa, Visitor fn, RetType defaultReturn) REQUIRES_SHARED(Locks::mutator_lock_) { - ArtField* const cookie_field = WellKnownClasses::dalvik_system_DexFile_cookie; - ArtField* const dex_file_field = WellKnownClasses::dalvik_system_DexPathList__Element_dexFile; + ArtField* const cookie_field = + jni::DecodeArtField(WellKnownClasses::dalvik_system_DexFile_cookie); + ArtField* const dex_file_field = + jni::DecodeArtField(WellKnownClasses::dalvik_system_DexPathList__Element_dexFile); if (dex_file_field == nullptr || cookie_field == nullptr) { return defaultReturn; } |