summaryrefslogtreecommitdiff
path: root/runtime/dexopt_test.cc
Commit message (Collapse)AuthorAgeFilesLines
* Use verify when speed-profile gets an empty profileCalin Juravle2021-06-021-0/+21
| | | | | | | | | | | | Change the compiler filter to verify if we need to compile speed-profile but we don't get a profile, or the profile is empty. This will improve the clarity and the precision of the telemetry data which usually expects speed-profile to outperform verify. Test: gtest Bug: 188655918 Change-Id: I215552e0001d56df0e0d676721f0a741ef2573be (cherry picked from commit 028c7efaf7321a1e253fb4d9dcc5d85e8a9e6d68)
* Remove unused image space order argumentOrion Hodson2020-10-121-1/+0
| | | | | | Bug: 160683548 Test: Treehugger Change-Id: I249d2891b645fa103106ee946f014b9ce362cbda
* Device gtests: Use boot.art instead of core.art.David Srbecky2020-02-071-1/+26
| | | | | | | | | | | | | | | | | | | | | They are essentially the same. We can use boot.art to run gtests since it is already part of the apex, including the jar files. This will make it easier to run the tests in atest, since we will not have to worry about copying core.art to the device. The long-term goal is to avoid generating core.art altogether. Couple of tests also require "alternate" image which has no compiled code. The tests now generate it on-demand in code. The host gtests still use core.art for now (as there is no boot.art on host). The plan is to add it in future CLs. Test: m test-art-host-gtest Test: ./art/tools/run-gtests.sh Bug: 147817606 Change-Id: I3a750bb8e60eea0b4a7df1491285feffd5a0161c
* Use provided dex filenames in oat file.Vladimir Marko2019-12-061-2/+1
| | | | | | | | | | | | | | | | | | Remove OatFile::RemoveRelativeEncodedDexFileLocation() and use the provided `dex_filenames' (see below) if not empty, without checking for prefix match or host/target build type. Also add extra primary/multi-dex location checking when opening an oat file. Since some tests were already creating oat files from multiple dex files, rewrite the interface to better support that option, replacing the old argument `abs_dex_location` with `dex_filenames` that can provide paths to multiple dex files. Test: m test-art-host Test: testrunner.py --host --optimizing Test: aosp_taimen-userdebug boots. Change-Id: I36a9abca72872c41e4c10fdacbeadf551ca740dc
* Refactor oat.h.Vladimir Marko2019-11-071-0/+1
| | | | | | | | | | | Move OatClassType and OatMethodOffsets to oat_file.h and make all dependencies on oat.h explicit instead of relying on transitive #includes. This reduces the number of files that need to be rebuilt for oat version changes. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Change-Id: I89c8e397a4f423043d7a036a995cc33548b25051
* Oat file checksums for boot image extensions.Vladimir Marko2019-10-301-15/+15
| | | | | | | | | | | | | | | | | Modify the oat checksums check for boot image extensions. There may be more extensions loaded at runtime than when the oat file was compiled, so we need to check the checksum type from the checksums string to determine whether to use an image checksum or dex file checksum. Different checksums can be valid for the same boot class path. The creation of boot image extensions and other aspects of loading them shall be implemented in separate CLs. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Test: aosp_taimen-userdebug boots. Change-Id: I43d1f9464678784e902ad72f4a89cf38b4786122
* Remove obsolete patchoat-related code from dexopt_test.Vladimir Marko2019-10-231-3/+0
| | | | | Test: m test-art-host-gtest Change-Id: I3c0036c42bc2054bcfcd514717611d3021843792
* Set core platform API policy from command line flagDavid Brazdil2019-04-121-2/+2
| | | | | | | | | | | | | | | | So as to avoid any performance penalty from core platform API access checks, disable them by default. AndroidRuntime.cpp now passes the value of the "persist.debug.dalvik.vm.core_platform_api_policy" to the runtime, allowing a user to enable core platform API checks on demand. The workflow for a tester is: - adb shell setprop <property> "just-warn" - adb reboot - adb logcat | grep "Core platform API" Test: manual, observe warnings in logcat Test: art/test/testrunner/run_build_test_target.py art-test Bug: 125701194 Change-Id: Iae09a8f44918dc349bc10dbdd703043667f51268
* Revert^2 "Delete GSS"Mathieu Chartier2019-04-091-2/+0
| | | | | | | | | | | Bug: 73295078 Bug: 72738921 Bug: 33795328 Test: test/testrunner/run_build_test_target.py -j50 art-ss-gc This reverts commit e18588381b34a5ed24417c826dc389a91f8d2b7f. Change-Id: I116b7ab7dec7cafebb1e718caea71c95353417ea
* Revert "Delete GSS"Mathieu Chartier2019-04-061-0/+2
| | | | | | | | This reverts commit 1397ea10a8e0409c74efe251721a2ee9ffaa3127. Reason for revert: Tests failing Change-Id: Ie25f7342f67685e2b4f80f8344a8a4d7e988f09f
* Delete GSSMathieu Chartier2019-04-051-2/+0
| | | | | | | | | | | Deleted GSS and related code. Bug: 73295078 Bug: 72738921 Bug: 33795328 Test: test-art-host Change-Id: I56d6c25a01abf3a969771c2161f9216c34a622e3
* Open only necessary files for BCP checksums test.Vladimir Marko2019-03-251-1/+1
| | | | | | | | Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Test: aosp_taimen-userdebug boots. Bug: 128479972 Change-Id: I13040acb5603d9207c2aaaa51ffd2fc7d3de1d82
* ART: Allow to change boot image pickup orderAndreas Gampe2019-03-131-1/+5
| | | | | | | | | | Allow to change the pickup order of boot image files between system-first and data-first. Bug: 126307038 Test: m test-art-host Test: Boot device with image in /data/dalvik-cache Change-Id: Id80cfc06aeb023559e1a3706833e57ba4880f43b
* Create the class loader context within a Runtime scope.Nicolas Geoffray2019-01-101-3/+8
| | | | | | | | | | Otherwise, we would delete the maps owned by the class loader context *after* deleting the runtime, which is a destruction order violation as the runtime owns the map lock. bug: 122475825 Test: dexoptanalyzer_test Change-Id: Ia81b0720e3178a71f143a524b61e3e63e5973e16
* Revert^2 "Allow boot image for a part of the boot classpath."Vladimir Marko2018-12-141-8/+8
| | | | | | | | | | | | This reverts commit fb83d76a8b186df05f874216b535f5ad57e7bd02. Fixed host run-test dependencies, cleaned up target run-test and gtest dependencies. Test: rm -f out/host/linux-x86/framework/conscrypt-hostdex.jar testrunner.py -b --host --optimizing -t 660-clinit Bug: 119868597 Change-Id: Ia0a5aba0223ae6616bf3e109daf0af7b8355d048
* Revert "Allow boot image for a part of the boot classpath."Andreas Gampe2018-12-131-8/+8
| | | | | | | | This reverts commit 4433c4351aab98005e12a6b53905678758b74665. Reason for revert: May be breaking tests. Change-Id: I3b690dbb06278dc1adce5a389fff938a692bdebd
* Allow boot image for a part of the boot classpath.Vladimir Marko2018-12-121-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | Instead of recording a single uint32_t boot image checksum in the oat header, store a string representing composite boot class path checksums in the key-value store. When checking the boot class path while loading the boot image, allow the boot class path to contain more components. The runtime shall then load the additional dex files from these components. Test: Exclude conscrypt from the the core image modules. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Test: Pixel 2 XL boots. Test: m test-art-target-gtest Test: testrunner.py --target --optimizing Test: run-libcore-tests.sh --mode=host --variant=X64 Test: run-libcore-tests.sh --mode=device --variant=X64 Test: run-jdwp-tests.sh --mode=host --variant=X64 Test: run-jdwp-tests.sh --mode=device --variant=X64 Bug: 119868597 Change-Id: Ia872fdedea0570ace2c8e597ddb3c6f63a43e62a
* Reduce core image to 6 modules.Vladimir Marko2018-12-041-21/+3
| | | | | | | | | | | | | | | | | | | | This was Revert^2 "Reduce core image to core-{oj,libart,simple}." but we're now keeping three additional modules, namely conscrypt, okhttp and bouncycastle. And we fix the boot class path used by vogar with the companion change https://android-review.googlesource.com/840810 . This reverts commit 00fe35e4021e9a8679eca3ffaede48fd89b56258. Change-Id: I6137edd91c03c17be50de200267eb9adc971e8fb Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Test: Pixel 3 XL boots. Test: m test-art-target-gtest Test: testrunner.py --target --optimizing Test: art/tools/run-libcore-tests.sh --mode=device --variant=X64 Bug: 119868597
* Revert "Reduce core image to core-{oj,libart,simple}."Vladimir Marko2018-12-031-3/+21
| | | | | | | | This reverts commit ec91d48cade73c54f7a03c5d53d863bc2490976e. Reason for revert: Breaks libcore tests. Change-Id: I0ea55f74635332177eadd9a69fb831e7f5dc16c7
* Reduce core image to core-{oj,libart,simple}.Vladimir Marko2018-11-301-21/+3
| | | | | | | | | | | | | | | | | | | | | | | And pass the -Xbootclasspath: and -Xbootclasspath-locations: options to tests. This eliminates a discrepancy between the image and boot class path (BCP). Next CL shall check the BCP stored in the primary boot image oat file against the BCP from the runtime. Use actual *-hostdex.jar/*-testdex.jar files for compiling the core.art. Since conscrypt, okhttp and bouncycastle have the dex files actually stripped from their *-testdex.jar, they are unsuitable for compilation, adding another reason to not include them in the core image. For consistency, use the same jars for core image on host. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Test: Pixel 3 XL boots. Test: m test-art-target-gtest Test: testrunner.py --target --optimizing Bug: 119868597 Change-Id: Iccc152ea0d5b3bd9878aa214cc649762f8f4ea9c
* ART: Add boot/app image checksums.Vladimir Marko2018-11-211-3/+3
| | | | | | | | | | | | | | | | | | | And check app oat files against the boot image checksum instead of checking the oat checksum. The oat checksums are included in image checksum calculations and the primary image checksum calculation includes the checksums of the secondary images. Also remove the obsolete "patch delta" to keep the size of the ImageHeader 8-byte aligned, remove the key-value store from secondary oat files and move the oat checksum update code from oat.cc to the oat_writer.cc. Test: m test-art-host-gtest Test: testrunner.py --host Test: Pixel 2 XL boots. Test: m test-art-target-gtest Change-Id: If74f5f18479c44ede0503bf1911ddb9ff8f3c4f8
* Simplify hidden_api.h logicDavid Brazdil2018-11-141-1/+1
| | | | | | | | | | | | | Refactor GetMemberAction to return a boolean whether access to a class member should be denied. This also moves StrictMode consumer notification into hidden_api.cc and removes notifications for toasts. Tests are changed accordingly. Test: phone boots Test: m test-art Merged-In: I02902143de0ff91d402ba79c83f28226b1822a6f Change-Id: I02902143de0ff91d402ba79c83f28226b1822a6f (cherry picked from commit 51995f90adaa0e5047dee56d22f15e4225e70517)
* Refactor MemMap::MapAnonymous().Vladimir Marko2018-10-301-1/+3
| | | | | | | | | | | | | | | Remove the address argument from the shortcut overload and introduce one more shortcut overload. This makes it easier to find all uses where we pass non-null address hint. Remove `requested_begin` parameter from some constructors where we were always passing null. Rewrite some tests to use the reservation API. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Bug: 118408378 Change-Id: Ibbbb96667e7cc11cf7fea119892463d8dbc9a8b5
* ART: Refactor for bugprone-argument-commentAndreas Gampe2018-10-231-1/+1
| | | | | | | | Handles runtime. Bug: 116054210 Test: WITH_TIDY=1 mmma art Change-Id: Ibc0d5086809d647f0ce4df5452eb84442d27ecf0
* Remove oat_data_begin checks from OatFile.Vladimir Marko2018-10-171-7/+6
| | | | | | | | | | | | | | | Make it a CHECK() directly in the ImageSpace instead. This check was a rather weird way to prevent the use of dlopen() for boot image on host because it would load the oat file at the wrong address. This is now done by refusing to use dlopen() on host when we have a memory `reservation`. Also clean up affected files for bugprone-argument-comment. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Bug: 77856493 Change-Id: I6f0f9d5a0542574017d98acc2f4f30a585b483f4
* Remove patchoat.Vladimir Marko2018-10-021-30/+0
| | | | | | | | Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Test: Pixel 2 XL boots. Bug: 77856493 Change-Id: I6686ce9d23e02aa8b8ef4081b302dbd860d07718
* Remove PIC option from oat files.Vladimir Marko2018-09-041-68/+9
| | | | | | | | | | | | | | | dex2oat has been producing only PIC code for some time, so there's no need to record it in the oat file anymore. Also get rid of the now unnecessary relocation logic that was using the flag. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Test: Pixel 2 XL boots. Test: m test-art-target-gtest Test: testrunner.py --target --optimizing Bug: 77856493 Change-Id: I070071ca5a808371f67883f4ae93d633a76231d0
* Reserve boot image memory in one go.Vladimir Marko2018-08-311-4/+4
| | | | | | | | | | | | Load boot image components into the reserved memory. Test: m test-art-host-gtest Test: testrunner.py --host Test: Pixel 2 XL boots. Test: m test-art-target-gtest Test: testrunner.py --target --optimizing Bug: 77856493 Change-Id: I214f947979bc0bbfc6df4312527504e90b88a01d
* Revert "Revert "Remove OatFileAssistant::MakeUpToDate and friends.""Nicolas Geoffray2018-08-301-1/+44
| | | | | | | | | | This reverts commit baf3761013a30b8c5dc1d6179cddaeee0a764311. Also remove the now deprecated --{no-}dex2oat option. Change-Id: I502c7011877f43f315abffa9b7d482ef13857125 bug: 111174995 bug: 111342996
* Revert "Remove OatFileAssistant::MakeUpToDate and friends."Mathieu Chartier2018-08-291-44/+1
| | | | | | | | | | | | This reverts commit d6698e34246ea5d99167538b042a70ef203838e6. Reason for revert: 116-nodex2oat failing on no-prebuild Test: test/run-test --always-clean --dex2oat-jobs 4 --host --no-prebuild --compact-dex-level fast --interpreter --no-relocate --runtime-option -Xcheck:jni --pic-test --64 116-nodex2oat bug: 111174995 bug: 111342996 Change-Id: I05da1774e9274da35993ab301d1632022655583f
* Remove OatFileAssistant::MakeUpToDate and friends.Nicolas Geoffray2018-08-281-1/+44
| | | | | | | | | Remove dex2oat invocations for non boot-image compilation for ART. bug: 111174995 bug: 111342996 Test: test.py Change-Id: If7f92537898e326bfd9dfbd969018f4c08da98b7
* Add an overload for MemMap::MapAnonymous().Vladimir Marko2018-08-241-1/+0
| | | | | | | | | | Add an overload that does not take `reuse` or `use_ashmem` parameters but uses default values (`reuse = false` and `use_ashmem = true`) to simplify callers. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Change-Id: Iaa44f770dee7e043c3a1d6867dfb0416dec83b25
* Remove unnecessary indirection from MemMap.Vladimir Marko2018-08-211-7/+10
| | | | | | | | | | | | | | | | | | Avoid plain MemMap pointers being passed around by changing the MemMap to moveable and return MemMap objects by value. Previously we could have a valid zero-size MemMap but this is now forbidden. MemMap::RemapAtEnd() is changed to avoid the explicit call to munmap(); mmap() with MAP_FIXED automatically removes old mappings for overlapping regions. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Test: Pixel 2 XL boots. Test: m test-art-target-gtest Test: testrunner.py --target --optimizing Change-Id: I12bd453c26a396edc20eb141bfd4dad20923f170
* Pass the fd to OatFile::Setup to avoid selinux errors.Nicolas Geoffray2018-04-241-1/+2
| | | | | | bug: 77853712 Test: test.py Change-Id: I069cda5296b561284d71b067924e1bc4a8562710
* Move profile dependent modules to libartbaseDavid Sehr2018-04-131-1/+1
| | | | | | | | | | | Move mem_map and zip_archive to libartbase. This should be the last two remaining modules that profile_compilation_info is dependent upon. Bug: 22322814 Test: make -j 50 checkbuild make and boot a device Change-Id: I136ee23e426aa8ec7441e3d3f1978f1bebf4b562
* patchoat: take directories instead of filenamesChris Morin2018-02-201-3/+14
| | | | | | | | | | patchoat was already ignoring the basename part of the filename passed to it for both --output-image-file and --output-image-relocation-file. We can therefore just pass in the directories instead. Bug: 72828459 Test: make test-art-host-gtest-patchoat_test Change-Id: I1a699d1f6746f068078ae768d30690431578d84e
* Expose the optimization status of a dex fileCalin Juravle2018-02-131-3/+10
| | | | | | | | | | | | | | | | Add a method which exposes the optimization status of a dex file based on its expected runtime behaviour. The method returns the status in an array [compilation filter, compilation reason]. The method will try to mimic the runtime effect of loading the dex file. For example, if there is no usable oat file, the compiler filter will be set to "run-from-apk". This will enable more accurate performance monitoring of apks. Test: oat_file_assistant_test Bug: 73102540 Change-Id: Ida9abef502dcb3fd07e1b0988771fb60e9b2a423
* Update to track libbacktrace API changes.Christopher Ferris2018-01-181-2/+2
| | | | | | | Bug: 65682279 Test: Compiles. Ran art host unit tests. Change-Id: I2077e61cc89cdb93a04a70612b01596fcc273d8c
* Modify to use new BacktraceMap iterator.Christopher Ferris2017-12-051-3/+4
| | | | | | | Bug: 69871050 Test: Ran host unit tests. Change-Id: I3c8c9a49a2c1cf0017502a869d1af0cb2a895ebd
* Revert "Revert "Ensure dex file are extracted and verified at load time""Calin Juravle2017-05-041-6/+12
| | | | | | | | | | | | | | | | The issue was caused by running device-gtests as root (which will always have full write access everywhere). For now, disable the tests that rely on file permissions when running as root. Test: m test-art-target-gtest-oat_file_assistant_test Bug: 36605597 Bug: 36824842 This reverts commit 9bfc6bb1f44797aec19a151e47c0902ef2516095. Change-Id: I60e8c3d602ca40b1f1e12e8808055effcbb8dcc6
* Revert "Ensure dex file are extracted and verified at load time"Calin Juravle2017-05-041-12/+6
| | | | | | | | The art build bot fails for the oat location tests. I suspect that ScopedNonWritable is not working properly on the bot. This reverts commit d2510c92e7c1f571ab012fcb82e77d7e1806ae3b. Change-Id: Ica70862fd608ebdeb3c710f786ae21b99b69bc20
* Ensure dex file are extracted and verified at load timeCalin Juravle2017-05-031-6/+12
| | | | | | | | | | | | | | | | | | | | | | This change removes the ability to specify an explicit OAT location and ensures that the best oat file (either the oat or the odex) is compiled according to its special filter (kDefaultCompilerFilterForDexLoading). The oat files location can therefore be: - in dalvik-cache: referred as the OAT location. - in dex_parent_dir/oat/ISA/: referred as the ODEX location. The "best oat file" for a dex location is changed to prefer the ODEX location whenever the location is writable (see OatFileAssistant::GetBestInfo()). MakeUpTodate will now attempt to generate the "best oat file" instead of always defaulting to the oat location. Test: m test-art-host-getest-oat_file_assistant_test Bug: 36605597 Bug: 36824842 Change-Id: Ic54b3b94be06c8c47f211ce3d738b0db0a9c7bb3
* Rename and obsolete compiler filter names.Nicolas Geoffray2017-04-211-1/+1
| | | | | | | | ART side of the change. bug:34715556 test: test-art-host, jdwp, libcore Change-Id: I3a73ae4af2d602431150c8ecfceaddb9ba519cee
* Make image oat checksum depend on secondary images.Richard Uhler2017-03-131-1/+1
| | | | | | | | | | | | | | | | Rather than explicitly having to load and combine the checksums from secondary images in the case of multi-image, have the image oat checksum for the primary image depend on the contents of all the images. Bug: 35659889 Bug: 34385298 Bug: 35992406 Test: test-art-host Test: Manually add field to ZygoteInit, update boot image, verify image is properly relocated and used on device. Change-Id: I38bd957d165682edabd0fd1874e8ef7acf923deb
* Make dex2oat support profiles passed to non profile filtersMathieu Chartier2017-02-171-0/+5
| | | | | | | | | | | | | | | | | | | | | Using a non profile filter with an input profile should compile everything but generate an app image and optimize layout based on the profile. Change UseProfileGuidedCompilation to use the profile arguments. Using profile arguments instead of being based on the compiler filter lets us do full speed compile and layout based on profile. Fix ShouldCompileBasedOnProfile to use the compiler filter instead of the existence of a profile. Fixed gtests. Test: test-art-host Bug: 34927277 Change-Id: I325a10d2072ed427bb32f96e4efa54cf81e94ad3
* Add dexoptanalyzer toolCalin Juravle2017-01-241-0/+236
dexoptanalyzer is a command line tool which analyzes whether or not a given dex file needs to be dexopted. It is a wrapper around OatFileAssistant::GetDexOptNeeded and its results have a mapping to OatFileAssistant::DexOptNeeded. This is needed for the management of secondary dex file. We need a way to retrieve the DexOptNeeded status from installd outside system server. We can't simply use the system server path (as we do for the main apks) because system server can't access content writable by the apps. Bug: 32871170 Test: m test-art-(host|target) Change-Id: Ife1534560ca2658079d4a38a30bc8d94f35fe9c8