From 9c924e89e5f52da9faadd1e4e60c73eaed6bc9d1 Mon Sep 17 00:00:00 2001 From: Brad Stenning Date: Mon, 11 Oct 2021 19:09:00 -0700 Subject: Add support to place shared libraries after the dex path This allows for a shared library to overriden by content in the dex path Bug: 179429740 Test: m test-art-host-gtest-art_runtime_tests32 Change-Id: I5f69c7bf32b7bd389eff8bdbb21616ba89ed9e87 --- runtime/class_linker.h | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) (limited to 'runtime/class_linker.h') diff --git a/runtime/class_linker.h b/runtime/class_linker.h index 8f334051ca..eaaf128527 100644 --- a/runtime/class_linker.h +++ b/runtime/class_linker.h @@ -665,7 +665,8 @@ class ClassLinker { const std::vector& dex_files, jclass loader_class, jobject parent_loader, - jobject shared_libraries = nullptr) + jobject shared_libraries = nullptr, + jobject shared_libraries_after = nullptr) REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(!Locks::dex_lock_); @@ -683,7 +684,8 @@ class ClassLinker { const std::vector& dex_files, Handle loader_class, Handle parent_loader, - Handle> shared_libraries) + Handle> shared_libraries, + Handle> shared_libraries_after) REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(!Locks::dex_lock_); @@ -1015,6 +1017,25 @@ class ClassLinker { REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(!Locks::dex_lock_); + bool FindClassInSharedLibrariesHelper(ScopedObjectAccessAlreadyRunnable& soa, + Thread* self, + const char* descriptor, + size_t hash, + Handle class_loader, + ArtField* field, + /*out*/ ObjPtr* result) + REQUIRES_SHARED(Locks::mutator_lock_) + REQUIRES(!Locks::dex_lock_); + + bool FindClassInSharedLibrariesAfter(ScopedObjectAccessAlreadyRunnable& soa, + Thread* self, + const char* descriptor, + size_t hash, + Handle class_loader, + /*out*/ ObjPtr* result) + REQUIRES_SHARED(Locks::mutator_lock_) + REQUIRES(!Locks::dex_lock_); + // Finds the class in the classpath of the given class loader. It only searches the class loader // dex files and does not recurse into its parent. // The method checks that the provided class loader is either a PathClassLoader or a -- cgit v1.2.3-59-g8ed1b