summaryrefslogtreecommitdiff
path: root/runtime/class_loader_utils.h
AgeCommit message (Collapse)Author
2024-01-24Add visibility attributes in runtime/c* Dmitrii Ishcheikin
Bug: 260881207 Test: presubmit Test: abtd app_compat_drm Test: abtd app_compat_top_100 Test: abtd app_compat_banking Change-Id: Id729aca1d8b6d003ff3e9755112f3283e9f2b507
2023-01-09Move one ObjPtr use to Handle. Nicolas Geoffray
The passed function being called might suspend, so make sure the `long_array` is in a handle. Test: test.py Bug: 262438759 Change-Id: I7ab179bebd881a76f42623992f44e3fd9242b6a2
2022-11-29Change well known class loader methods to `ArtMethod*`. Vladimir Marko
Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Test: atest CtsJdwpTestCases Change-Id: I7b94a481304f8899bcb828ed5875fe165dd90dda
2022-11-09Clean up decoding well-known classes. Vladimir Marko
Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Change-Id: I27b4e8f5513511ce1c320e3224dd9c2a40880b69
2022-10-18Reland "Change well known `ClassLoader` fields to `ArtField*`." Vladimír Marko
This reverts commit 839193ee2031d28aac2ce16c4b76ad40531b07cc. Reason for revert: Reland with a fix - make CompilerDriver reponsible for initializing required `ClassLoader` classes for boot image. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Test: Manually run Golem benchmark ArrayListStress. Bug: 253570082 Change-Id: I2ddb70566352f8728f089b3a6c58473270240e25
2022-10-17Revert "Change well known `ClassLoader` fields to `ArtField*`." Vladimír Marko
This reverts commit afe6902accb6a4d3b3382cc501c4d005b6fb5b96. Reason for revert: This may have broken Golem benchmarks. Bug: 253570082 Change-Id: I5507a4591c0bad8d778820f6fafc61fdc65e2f54
2022-10-17Change well known `ClassLoader` fields to `ArtField*`. Vladimir Marko
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
2022-06-28Fix bugprone-argument-comment clang-tidy issues Stefano Cianciulli
Test: m tidy-art Bug: 213953102 Change-Id: I5c703033db4fefd1cb3f1dd2dc95126930e28d53
2020-02-08Introduce BaseDexClassLoader.computeClassLoaderContextsNative Dan Zimmerman
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
2019-11-15Implement STL iterators on ObjectArray and add helpers Alex Light
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
2019-04-18Revert^2 "Fix correctness for fast path class loading" Andreas Gampe
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
2019-04-17Revert "Fix correctness for fast path class loading" Mathieu Chartier
Bug: 130310316 Bug: 130293184 Bug: 130209120 Bug: 130680590 Test: TH This reverts commit ef04ac6c05fa344428008ffa1eac7316c64a3467. Change-Id: I2ee8a20419da251eed2620b7feb390053c0cdcb9
2019-04-16Fix correctness for fast path class loading Mathieu Chartier
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
2019-04-02Partially ObjPtr<>-ify Object, fix stale ref in test. Vladimir Marko
Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Bug: 31113334 Change-Id: I0c0bc669c0ab8d99185e662a2fec16f32a42a0a2
2018-12-07Merge "Support class lookup for InMemoryDexClassLoader" David Brazdil
2018-12-06ART: Move to using locks.h instead of mutex.h Andreas Gampe
When only annotating lock requirements, use locks.h. Bug: 119869270 Test: mmma art Change-Id: I1608b03254712feff0072ebad012c3af0cc3dda4
2018-12-06Support class lookup for InMemoryDexClassLoader David Brazdil
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
2018-10-23ART: Refactor for bugprone-argument-comment Andreas Gampe
Handles runtime. Bug: 116054210 Test: WITH_TIDY=1 mmma art Change-Id: Ibc0d5086809d647f0ce4df5452eb84442d27ecf0
2018-06-19ART: Mask garbage-memory warnings Andreas Gampe
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
2018-05-09ART: Move JNI files to runtime/jni/ . Vladimir Marko
Test: Rely on TreeHugger. Change-Id: I9cae11191ef1567ae9453be498882a7767285140
2018-03-01ART: Refactor known-classloader visits Andreas Gampe
Refactor visiting dex Elements and DexFiles in known classloaders, unifying the walking code. Test: m test-art-host Change-Id: I4203ac4fbb0ee68660aadc0dfbf8affacbc03b8b
2017-07-18Create a class loader context starting from an existing ClassLoader Calin Juravle
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