summaryrefslogtreecommitdiff
path: root/runtime/reference_table_test.cc
AgeCommit message (Collapse)Author
2024-11-11Avoid `strlen()` for `ClassLinker::FindClass()`... Vladimir Marko
... and related functions in most cases. Note that the `CompilerDriver` previously resolved the `ClassLoader` and `TransactionAbortError` using the provided class loaders. We're now using the `ClassLoader` from the class roots and resolving the `TransactionAbortError` in the BCP class loader. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Bug: 181943478 Bug: 338123769 Change-Id: I38e480cdcdb8bf02c958e4d0773437f5766f6be0
2024-02-06Add visibility attributes in runtime/r* Dmitrii Ishcheikin
Bug: 260881207 Test: presubmit Test: abtd app_compat_drm Test: abtd app_compat_top_100 Test: abtd app_compat_banking Change-Id: I9a12fe4d7c47090631415e813a00c2a2fdcaca62
2022-11-30Change well known method `String.charAt()` to `ArtMethod*`. Vladimir Marko
Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Change-Id: Idb34c5de408b98db746d385ae6e012a8997fcc96
2022-10-14ART: Speed up some gtests. Vladimir Marko
Avoid creating `Runtime` or create the `Runtime` with a boot image to make the test setup faster. Test: m test-art-host-gtest Test: run-gtests.sh Change-Id: I3f09de81491402442f1704d25bb06de995d8a3ca
2020-07-23Reword some comments to be more inclusive Orion Hodson
Also corrects a typo s/He/We/. Bug: 161336379 Bug: 161850439 Bug: 161896447 Test: m Change-Id: Ie8e37310eb777b7ee41a13f8894e99795c29a98a
2019-03-25ObjPtr<>-ify String allocations, fix stale refs. Vladimir Marko
ObjPtr<>-ify String allocation functions and related code and remove some unnecessary calls to ObjPtr<>::Ptr(). Fix stale reference uses in reference_table_test and stub_test. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Bug: 31113334 Change-Id: I42927fb8b7240e5132188f73318b2ccb218748fd
2018-10-26ART: Add class-alloc-inl.h Andreas Gampe
In an effort to reduce the (transitive) proliferation of heap-inl add a specific inline header for class instance allocation. Bug: 118385392 Test: mmma art Test: m test-art-host Change-Id: I32529f0221a836452c58687330a91ac0d5fde162
2018-10-25ART: Add array-alloc-inl.h Andreas Gampe
In an effort to reduce the (transitive) proliferation of heap-inl add a specific inline header for array allocation. Bug: 118385392 Test: mmma art Test: m test-art-host Change-Id: Id3378f40c52fa7ef4297af08cb7509e0c04b94d1
2018-06-04Refactor String resolution. Vladimir Marko
Use the same pattern as type resolution and avoid some unnecessary read barriers in the fast path. Consolidate naming between ArtField and ArtMethod. Test: m test-art-host-gtest Test: testrunner.py --host Change-Id: Iea69129085f61f04a4add09edd0eadbb7ac9ecb2
2018-06-01ObjPtr<>-ify array allocations. Vladimir Marko
And remove some unnecessary calls to ObjPtr<>::Ptr(). Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Bug: 31113334 Change-Id: Ie313980f7f23b33b0ccea4fa8d5131d643c59080
2018-02-28Header library to remove dependence on runtime/ David Sehr
Add a new header library to remove libdexfile and others' dependence on runtime (typically runtime/base) includes in libdexfile. Also a small step to tease dexlayout and profman away from relying on these as well. Bug: 22322814 Test: make -j 50 checkbuild make -j 50 test-art-host-gtest Change-Id: I38e2fe399a75f4bc6318c77a71954c00ea73ec2b
2017-11-16cpplint: Remove many unnecessary NOLINT Igor Murashkin
Now that we updated to upstream cpplint, a lot of these NOLINTs are no longer necessary. Bug: 68951293 Change-Id: If8ed5ffe89727f313f907a214b6d8fd2a2eddbad
2017-11-08cpplint: Cleanup errors Igor Murashkin
Cleanup errors from upstream cpplint in preparation for moving art's cpplint fork to upstream tip-of-tree cpplint. Test: cd art && mm Bug: 68951293 Change-Id: I15faed4594cbcb8399850f8bdee39d42c0c5b956
2017-10-02ART: Dump allocation stacks in reference table dumps Andreas Gampe
When allocation tracking is enabled and allocation stacks are available, print the stack traces of the objects in a reference table dumps, to aid tracking table overflows. Extend reference_table_test. Bug: 67044702 Test: m test-art-host Change-Id: I0118ba095f08dc66739707cd6a184487974b1570
2017-07-20ART: Change method lookup to be more consistent to JLS and the RI. Vladimir Marko
The method lookup for different invoke types was previously widely different and didn't work well with the dex cache method array where we have only a single slot for each MethodId. The new behavior is to perform the same lookup for all cases, distinguishing only between interface and non-interface referencing class, and to further align the behavior with the JLS and the RI. Where the JLS conflicts with the RI, we follow the JLS semantics. The new lookup for class methods first searches the methods declared in the superclass chain (ignoring "copied" methods) and only then looks in the "copied" methods. If the search in the superclass chain finds a method that has not been inherited (i.e. either a private method or a package-access method where one of the classes in the chain does not belong to the same package, see JLS 8.4.8), we still search the "copied" methods as there may actually be a method inherited from an interface. This follows the JLS semantics where inherited methods are included in the search (JLS 15.12.2.1) but conflicts with the RI where the private or package-access method takes precedence over methods inherited from interfaces. Note that this search can find an accessible method that is not inherited by the qualifying type, either for a package access method when the referrer is in the same package but the qualifying type is in another package, or for a private method where the referrer is in the same class but the qualifying type is actually a subclass. For the moment we allow such calls and we shall consider whether to throw an IncompatibleClassChangeError in this situation in future to comply with JLS 15.12.4.3. The new lookup for interface methods searches the interface class, then all the superinterfaces and then the java.lang.Object class, see implicitly declared methods in interfaces, JLS 9.2. The search for the maximally-specific non-abstract superinterface method is not yet implemented, but the difference should be difficult to observe as the usual subsequent call to FindVirtualMethodForInterface() should yield the same result for any matching method. The new test 162-method-idx-clash exposes several cases where we previously completely messed up due to the effects of the DexCache, or where we were out of line with the RI. It also tests a case where the JLS and the RI disagree and we follow the JLS. Test: art/test/run-test --host --jvm 162-method-resolution Test: m test-art-host-gtest Test: testrunner.py --host Test: testrunner.py --host --interp-ac Test: Nexus 6P boots. Test: testrunner.py --target Bug: 62855082 Bug: 30627598 Change-Id: If450c8cff2751369011d649c25d28a482a2c61a3
2017-06-02ART: Introduce thread-current-inl.h Andreas Gampe
Factor out Thread::Current() code into its own -inl file to remove transitive includes. This requires at the same time correcting mutex.h, i.e., moving some functions into mutex-inl.h. Test: m test-art-host Change-Id: I88f888b604e0897368d9b483edce6ce4332dd9c9
2017-04-21ART: Clean up art_method.h Andreas Gampe
Clean up the header. Fix up other headers including the -inl file, in an effort to prune the include graph. Fix broken transitive includes by making includes explicit. Introduce new -inl files for method handles and reference visiting. Test: source build/envsetup.sh && lunch aosp_angler-userdebug && mmma art Test: source build/envsetup.sh && lunch aosp_mips64-userdebug && mmma art Change-Id: I8f60f1160c2a702fdf3598149dae38f6fa6bc851
2017-02-14ART: Add operator == and != with nullptr to Handle Andreas Gampe
Get it in line with ObjPtr and prettify our code. Test: m Change-Id: I1322e2a9bc7a85d7f2441034a19bf4d807b81a0e
2016-12-15ART: Move to libbase StringPrintf Andreas Gampe
Remove ART's StringPrintf implementation. Fix up clients. Add missing includes where necessary. Test: m test-art-host Change-Id: I564038d5868595ac3bb88d641af1000cea940e5a
2016-11-14ART: Prioritize reference table dump Andreas Gampe
Sort the reference table summary dump by highest count, prioritizing repeated types and instances. This will help with triaging leaks. Add a test. Bug: 32857749 Test: m test-art-host-gtest-reference_table_test Change-Id: I7e61881b5badf9ac2b6b72333f31437ab498caee
2016-09-29Clean up ScopedThreadStateChange to use ObjPtr Mathieu Chartier
Also fixed inclusion of -inl.h files in .h files by adding scoped_object_access-inl.h and scoped_fast_natvie_object_access-inl.h Changed AddLocalReference / Decode to use ObjPtr. Changed libartbenchmark to be debug to avoid linkage errors. Bug: 31113334 Test: test-art-host Change-Id: I4d2e160483a29d21e1e0e440585ed328b9811483
2016-09-28ART: Dump referenced type in IRT overflows Andreas Gampe
When the runtime dumps a reference table, e.g., when aborting for an overflow, dump the type of stored referents for reference types to aid in debugging leaks. Bug: 31600693 Test: m test-art-host-gtest-reference_table_test Change-Id: Ia892dc84ca8827dd93a8b75d6f571c392f94859c (cherry picked from commit 280f32b095f55f24dc557f9a9067d223901214ce)
2015-05-29Move mirror::ArtMethod to native Mathieu Chartier
Optimizing + quick tests are passing, devices boot. TODO: Test and fix bugs in mips64. Saves 16 bytes per most ArtMethod, 7.5MB reduction in system PSS. Some of the savings are from removal of virtual methods and direct methods object arrays. Bug: 19264997 Change-Id: I622469a0cfa0e7082a2119f3d6a9491eb61e3f3d
2015-04-22Replace NULL with nullptr Mathieu Chartier
Also fixed some lines that were too long, and a few other minor details. Change-Id: I6efba5fb6e03eb5d0a300fddb2a75bf8e2f175cb
2014-07-17ART: Use array-inl.h in reference_table_test Andreas Gampe
The test allocates arrays, which is an inline definition. Change-Id: I1423c5419949d7c352ed0e614d4f9c5920831deb
2014-07-15Break apart header files. Ian Rogers
Create libart-gtest for common runtime and compiler gtest routines. Rename CompilerCallbacksImpl that is quick compiler specific. Rename trace clock source constants to not use the overloaded profiler term. Change-Id: I4aac4bdc7e7850c68335f81e59a390133b54e933
2014-02-26Split up CommonTest into CommonRuntimeTest and CommonCompilerTest Brian Carlstrom
Change-Id: I8dcf6b29a5aecd445f1a3ddb06386cf81dbc9c70
2013-07-12Create separate Android.mk for main build targets Brian Carlstrom
The runtime, compiler, dex2oat, and oatdump now are in seperate trees to prevent dependency creep. They can now be individually built without rebuilding the rest of the art projects. dalvikvm and jdwpspy were already this way. Builds in the art directory should behave as before, building everything including tests. Change-Id: Ic6b1151e5ed0f823c3dd301afd2b13eb2d8feb81