summaryrefslogtreecommitdiff
path: root/runtime/class_loader_utils.h
Commit message (Collapse)AuthorAgeFilesLines
* Introduce BaseDexClassLoader.computeClassLoaderContextsNativeDan Zimmerman2020-02-081-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | This will be used to compute the contexts that should be sent over to the dex load reporter. See associated changes in libcore & frameworks/base. Motivation: At the moment of committing there are two classloader context encoders- one in ART and one in the package manager. The duplicate logic is susceptible to divergences. For example at the moment if a package uses shared libraries and has secondary dex files then the context encoded for secondary dex files will be incorrect[1]. In order to eliminate this bug and future possible bugs lets centralize where all classloader context computation is done. [1]: The context will be incorrect because it doesn't take into account the shared libraries that are loaded at runtime. Test: m test-art-host-gtest-class_loader_context_test Test: m test-art-host-gtest Test: ./test/testrunner/testrunner.py --host -b Test: Introduced a set of tests for the new API(s) Test: See tests in associated libcore & framework/base commits Bug: 148494302 Change-Id: Id39293a2e1d3d05194f2864f4febb3e652bce075
* Implement STL iterators on ObjectArray and add helpersAlex Light2019-11-151-2/+2
| | | | | | | | | | | | | Iterating over an ObjectArray is rather cumbersome, requiring manual for-loops. To improve ergonomics and STL standard-ness this implements std::iterator's for ObjectArray and converts code to use this (in simple situations). This should allow us to use standard STL functions in the future when dealing with ObjectArrays. Also adds some helpers such as ZipCount and ZipLeft. Test: ./test.py --host Change-Id: Ifd515b8321775424b3256a6faf47b2ba970177d3
* Revert^2 "Fix correctness for fast path class loading"Andreas Gampe2019-04-181-1/+0
| | | | | | | | | | | | | | This reverts commit 2e2f9e8c6989dec22e4199a773a1e03954f82365. Bug: 130310316 Bug: 130293184 Bug: 130209120 Bug: 130746382 Test: m test-art-host Test: atest vm-tests-tf Change-Id: I2b6e6be530bb8b6c6222b11b7d93fb1f574d2ea4
* Revert "Fix correctness for fast path class loading"Mathieu Chartier2019-04-171-0/+1
| | | | | | | | | | | | Bug: 130310316 Bug: 130293184 Bug: 130209120 Bug: 130680590 Test: TH This reverts commit ef04ac6c05fa344428008ffa1eac7316c64a3467. Change-Id: I2ee8a20419da251eed2620b7feb390053c0cdcb9
* Fix correctness for fast path class loadingMathieu Chartier2019-04-161-1/+0
| | | | | | | | | | | | | | | | | | | For the fast path, we currently remove all exceptions and only return ClassNotFoundExceptions. This CL preserves exceptions that might occur such as linkage errors. The follow up is to add an additional fast path for faster class not found exception generation. Bug: 130310316 Bug: 130293184 Bug: 130209120 Test: test-art-host (cherry picked from commit ca19f9a8547999cb13de06458364d64ab143cb09) Merged-In: Iae55aaaae2be5b1330e8e54bee36e862cf9e12e0 Change-Id: I0fff3a748c07b5f3e05f4de24d56678a8b046844
* Partially ObjPtr<>-ify Object, fix stale ref in test.Vladimir Marko2019-04-021-3/+4
| | | | | | | Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Bug: 31113334 Change-Id: I0c0bc669c0ab8d99185e662a2fec16f32a42a0a2
* Merge "Support class lookup for InMemoryDexClassLoader"David Brazdil2018-12-071-1/+10
|\
| * Support class lookup for InMemoryDexClassLoaderDavid Brazdil2018-12-061-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | Setting up InMemoryDexClassLoader with 'null' as parent results in the class loader not being able to load any boot classpath classes. This is due to the fact that InMemoryDexClassLoader inherits class lookup from BaseDexClassLoader which delegates it to ART, but ART rejects InMemoryDexClassLoader as not supported. Bug: 120603906 Bug: 120613979 Test: InMemoryDexClassLoaderTest Change-Id: I3139b1bb343b5fc722bcf06f89a6f6a21a3c7c54
* | ART: Move to using locks.h instead of mutex.hAndreas Gampe2018-12-061-1/+1
|/ | | | | | | | When only annotating lock requirements, use locks.h. Bug: 119869270 Test: mmma art Change-Id: I1608b03254712feff0072ebad012c3af0cc3dda4
* ART: Refactor for bugprone-argument-commentAndreas Gampe2018-10-231-1/+1
| | | | | | | | Handles runtime. Bug: 116054210 Test: WITH_TIDY=1 mmma art Change-Id: Ibc0d5086809d647f0ce4df5452eb84442d27ecf0
* ART: Mask garbage-memory warningsAndreas Gampe2018-06-191-1/+7
| | | | | | | | | | | Add invariants or NOLINT to let clang-analyzer understand that there's no garbage involved. (The analysis itself is too expensive to force it on for all local builds.) Test: mmma art Change-Id: I6148d743321248195abb3a8f646e63941f11f9a9
* ART: Move JNI files to runtime/jni/ .Vladimir Marko2018-05-091-1/+1
| | | | | Test: Rely on TreeHugger. Change-Id: I9cae11191ef1567ae9453be498882a7767285140
* ART: Refactor known-classloader visitsAndreas Gampe2018-03-011-2/+114
| | | | | | | | Refactor visiting dex Elements and DexFiles in known classloaders, unifying the walking code. Test: m test-art-host Change-Id: I4203ac4fbb0ee68660aadc0dfbf8affacbc03b8b
* Create a class loader context starting from an existing ClassLoaderCalin Juravle2017-07-181-0/+50
Extend ClassLoaderContext to be able to generate a context from an existing class loader. This will be used in extending the duplicate class check to cover DelegateLastClassLoaders. Most of the functionality is migrated from OatFileManager with some cleanups consisting of extra docs and more conservative checks on the integrity of the class loader chain. Test: m test-art-host Bug: 38138251 Change-Id: If7c18cb75bfc9e6784676f96a666bf13b04c8b8b