summaryrefslogtreecommitdiff
path: root/runtime/reference_table_test.cc
Commit message (Collapse)AuthorAgeFilesLines
* Reword some comments to be more inclusiveOrion Hodson2020-07-231-1/+1
| | | | | | | | | | Also corrects a typo s/He/We/. Bug: 161336379 Bug: 161850439 Bug: 161896447 Test: m Change-Id: Ie8e37310eb777b7ee41a13f8894e99795c29a98a
* ObjPtr<>-ify String allocations, fix stale refs.Vladimir Marko2019-03-251-13/+15
| | | | | | | | | | | 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
* ART: Add class-alloc-inl.hAndreas Gampe2018-10-261-0/+1
| | | | | | | | | | 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
* ART: Add array-alloc-inl.hAndreas Gampe2018-10-251-0/+1
| | | | | | | | | | 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
* Refactor String resolution.Vladimir Marko2018-06-041-1/+1
| | | | | | | | | | 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
* ObjPtr<>-ify array allocations.Vladimir Marko2018-06-011-8/+11
| | | | | | | | | And remove some unnecessary calls to ObjPtr<>::Ptr(). Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Bug: 31113334 Change-Id: Ie313980f7f23b33b0ccea4fa8d5131d643c59080
* Header library to remove dependence on runtime/David Sehr2018-02-281-1/+1
| | | | | | | | | | | | 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
* cpplint: Remove many unnecessary NOLINTIgor Murashkin2017-11-161-1/+1
| | | | | | | | Now that we updated to upstream cpplint, a lot of these NOLINTs are no longer necessary. Bug: 68951293 Change-Id: If8ed5ffe89727f313f907a214b6d8fd2a2eddbad
* cpplint: Cleanup errorsIgor Murashkin2017-11-081-1/+1
| | | | | | | | | 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
* ART: Dump allocation stacks in reference table dumpsAndreas Gampe2017-10-021-0/+84
| | | | | | | | | | | | 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
* ART: Change method lookup to be more consistent to JLS and the RI.Vladimir Marko2017-07-201-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* ART: Introduce thread-current-inl.hAndreas Gampe2017-06-021-1/+1
| | | | | | | | | | | 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
* ART: Clean up art_method.hAndreas Gampe2017-04-211-0/+1
| | | | | | | | | | | 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
* ART: Add operator == and != with nullptr to HandleAndreas Gampe2017-02-141-2/+2
| | | | | | | Get it in line with ObjPtr and prettify our code. Test: m Change-Id: I1322e2a9bc7a85d7f2441034a19bf4d807b81a0e
* ART: Move to libbase StringPrintfAndreas Gampe2016-12-151-0/+4
| | | | | | | | Remove ART's StringPrintf implementation. Fix up clients. Add missing includes where necessary. Test: m test-art-host Change-Id: I564038d5868595ac3bb88d641af1000cea940e5a
* ART: Prioritize reference table dumpAndreas Gampe2016-11-141-0/+73
| | | | | | | | | | | 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
* Clean up ScopedThreadStateChange to use ObjPtrMathieu Chartier2016-09-291-1/+1
| | | | | | | | | | | | | | | 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
* ART: Dump referenced type in IRT overflowsAndreas Gampe2016-09-281-0/+60
| | | | | | | | | | | 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)
* Move mirror::ArtMethod to nativeMathieu Chartier2015-05-291-0/+2
| | | | | | | | | | | | | 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
* Replace NULL with nullptrMathieu Chartier2015-04-221-2/+2
| | | | | | | Also fixed some lines that were too long, and a few other minor details. Change-Id: I6efba5fb6e03eb5d0a300fddb2a75bf8e2f175cb
* ART: Use array-inl.h in reference_table_testAndreas Gampe2014-07-171-1/+1
| | | | | | The test allocates arrays, which is an inline definition. Change-Id: I1423c5419949d7c352ed0e614d4f9c5920831deb
* Break apart header files.Ian Rogers2014-07-151-0/+4
| | | | | | | | 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
* Split up CommonTest into CommonRuntimeTest and CommonCompilerTestBrian Carlstrom2014-02-261-4/+3
| | | | Change-Id: I8dcf6b29a5aecd445f1a3ddb06386cf81dbc9c70
* Create separate Android.mk for main build targetsBrian Carlstrom2013-07-121-0/+104
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