summaryrefslogtreecommitdiff
path: root/runtime/class_loader_utils.h
diff options
context:
space:
mode:
author Vladimir Marko <vmarko@google.com> 2022-10-14 16:17:32 +0200
committer Treehugger Robot <treehugger-gerrit@google.com> 2022-10-17 10:49:13 +0000
commitafe6902accb6a4d3b3382cc501c4d005b6fb5b96 (patch)
treed2e240e275c483c309e8a106822232fb7b07890a /runtime/class_loader_utils.h
parentba5cc5b551fb72017c341ce243279351dea57267 (diff)
Change well known `ClassLoader` fields to `ArtField*`.
Note that the new field caching does not resolve the field's type and does not initialize the class holding the field. There is no reason why the `WellKnownClasses` should be responsible for this type resolution and initialization. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Bug: 253570082 Change-Id: I692afdc891d161c813864543e47a2c02f93e93e8
Diffstat (limited to 'runtime/class_loader_utils.h')
-rw-r--r--runtime/class_loader_utils.h12
1 files changed, 4 insertions, 8 deletions
diff --git a/runtime/class_loader_utils.h b/runtime/class_loader_utils.h
index c7773709bf..aabc4ca91d 100644
--- a/runtime/class_loader_utils.h
+++ b/runtime/class_loader_utils.h
@@ -82,13 +82,11 @@ inline RetType VisitClassLoaderDexElements(ScopedObjectAccessAlreadyRunnable& so
REQUIRES_SHARED(Locks::mutator_lock_) {
Thread* self = soa.Self();
ObjPtr<mirror::Object> dex_path_list =
- jni::DecodeArtField(WellKnownClasses::dalvik_system_BaseDexClassLoader_pathList)->
- GetObject(class_loader.Get());
+ 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 =
- jni::DecodeArtField(WellKnownClasses::dalvik_system_DexPathList_dexElements)->
- GetObject(dex_path_list);
+ 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) {
@@ -122,10 +120,8 @@ inline RetType VisitClassLoaderDexFiles(ScopedObjectAccessAlreadyRunnable& soa,
Visitor fn,
RetType defaultReturn)
REQUIRES_SHARED(Locks::mutator_lock_) {
- ArtField* const cookie_field =
- jni::DecodeArtField(WellKnownClasses::dalvik_system_DexFile_cookie);
- ArtField* const dex_file_field =
- jni::DecodeArtField(WellKnownClasses::dalvik_system_DexPathList__Element_dexFile);
+ ArtField* const cookie_field = WellKnownClasses::dalvik_system_DexFile_cookie;
+ ArtField* const dex_file_field = WellKnownClasses::dalvik_system_DexPathList__Element_dexFile;
if (dex_file_field == nullptr || cookie_field == nullptr) {
return defaultReturn;
}