summaryrefslogtreecommitdiff
path: root/compiler
Commit message (Collapse)AuthorAgeFilesLines
* Better isolate standalone ART gtests on device.Roland Levillain2021-09-271-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | Standalone ART gtests used to be installed in the same directory on device (`/data/local/tmp/nativetest`), which could be a race condition. In particular, some ART gtests are run as root (e.g. `art_standalone_dexoptanalyzer_tests`) and create the `/data/local/tmp/nativetest` directory with `root` ownership/permissions, preventing any subsequent ART gtest not run as root (e.g. `art_standalone_cmdline_tests`) from installing its artifacts in that directory. To prevent these issues, use a different directory on device (under `/data/local/tmp`) per standalone ART gtest. (cherry picked from commit d8c0ac264f606bf0c69781388ca6048eb0a4b55f) (cherry picked from commit 58a79873e94dbe4a168221fc95b641dbf8cd3e3e) Test: atest art_standalone_dexoptanalyzer_tests \ && atest art_standalone_cmdline_tests Test: atest art_standalone_\*_tests Bug: 194403904 Bug: 162834439 Change-Id: I141c1676382b078c1441e5782b3dc77affafa3fc Merged-In: I141c1676382b078c1441e5782b3dc77affafa3fc
* Temporarily disable partial LSE.Nicolas Geoffray2021-09-141-1/+1
| | | | | | | | | | | | | Due to a bug in it. Add a regression test. Bug: 197818595 Test: 828-partial-lse (cherry picked from commit 18074d2b59ae56dcfccea770ceb515215c8eb53f) (cherry picked from commit a38b7355a603772424a8212840849094ce0ddeb3) Merged-In: I65da4f7ef09cd2a1f6c4b21799ecd7a42c1adac2 Change-Id: I3eb52dc091264e617bb711260fb4950d15c7f50b
* Partial LSE: handle all kinds of infinite loops.Nicolas Geoffray2021-09-131-8/+5
| | | | | | | | | | | A subgraph could also have an infinite loop. Test: 826-inifinite-loop Bug: 196246395 Merged-In: Ifd1e1ae0f42dfe2cc156386fc166101c20748fc9 (cherry picked from commit 96dadefd24331f6808cb287048269ba772423c33) Change-Id: I410ec26aefbc42629ba7dbe5a19a87399cefe396 (cherry picked from commit 1c7eeae26429bf76c47a1eaf6eddf514c000ba71)
* Add `Sdk31ModuleController` support to ART run-tests and gtests.Roland Levillain2021-08-131-0/+3
| | | | | | | | | | | | This in order to run these tests only if the device under test is SDK version 31 (Android 12) or above. Test: m mts && mts-tradefed run commandAndExit mts-art Bug: 195178963 Bug: 184696655 Bug: 181724969 Ignore-AOSP-First: API level 31 not in AOSP yet Change-Id: I4bb6405281809863562e5bbbfc1189f227f2508d
* Add support for standalone ART gtests to MTS.Roland Levillain2021-07-131-0/+9
| | | | | | | | | | | | | | | | | | This change: - adds standalone ART gtests to test suite `mts-art`; - adds `MainlineTestModuleController` support to standalone ART gtests. This in order to have these tests run in a Mainline context only when the ART Module (either `com.google.android.art` or `com.android.art`) is installed on the test device. (cherry picked from commit 6a2e6893290eac83f59dac4ec5bc10abf985ae10) Test: m mts && mts-tradefed run commandAndExit mts-art Test: m mts && mts-tradefed run commandAndExit mts-art-shard-00 Bug: 193218514 Bug: 167385698 Change-Id: I97d9c00b7c10debff8c63e4ae75f90da02be271c Merged-In: I97d9c00b7c10debff8c63e4ae75f90da02be271c
* Uncouple ART gtests from the ART APEX.Roland Levillain2021-07-123-20/+111
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce standalone versions of ART gtests on target, not bundled with the ART APEX. So far ART gtests have always been built as debug artifacts (and linked against ART debug libraries). Make some adjustments in some of these tests so that they can also work as non-debug artifacts and be used with the Release ART APEX (which contains only non-debug artifacts). Newly added tests: * `art_standalone_cmdline_tests` * `art_standalone_compiler_tests` * `art_standalone_dex2oat_tests` * `art_standalone_dexdump_tests` * `art_standalone_dexlist_tests` * `art_standalone_dexoptanalyzer_tests` * Note: Requires root access to the device. * `art_standalone_libartbase_tests` * `art_standalone_libartpalette_tests` * `art_standalone_libdexfile_support_tests` * `art_standalone_libdexfile_tests` * `art_standalone_libprofile_tests` * `art_standalone_oatdump_tests` * `art_standalone_odrefresh_tests` * `art_standalone_profman_tests` * Note: Requires root access to the device. * Note: Some tests (2 out of 37) are failing in multi-ABI contexts and have been temporarily disabled. * `art_standalone_runtime_compiler_tests` * `art_standalone_runtime_tests` * Note: Some tests (16 out of 686) are failing and have been temporarily disabled. * Note: Some tests (4 out of 686) are failing in multi-ABI contexts and have been temporarily disabled. * `art_standalone_sigchain_tests` Tests not added: * `art_standalone_dexanalyze_tests` * Reason: ART binary `dexanalyze` is not part of the Release ART APEX. * `art_standalone_dexdiag_tests` * Reason: ART binary `dexdiag` is not part of the Release ART APEX. * `art_standalone_dexlayout_tests` * Reason: ART binary `dexlayout` is not part of the Release ART APEX. * `art_standalone_imgdiag_tests` * Reason: ART binary `imgdiag` is not part of the Release ART APEX. Tests not added (but present in AOSP): * `art_standalone_libartservice_tests` * Reason: Test `art_libartservice_tests` does not exist in this branch. * `art_standalone_libarttools_tests` * Reason: Test `art_libarttools_tests` does not exist in this branch. (cherry picked from commit f040914a122be86e280efe5e31af1168f2b7c72e) Test: atest -a art_standalone_cmdline_tests Test: atest -a art_standalone_compiler_tests Test: atest -a art_standalone_dex2oat_tests Test: atest -a art_standalone_dexdump_tests Test: atest -a art_standalone_dexlist_tests Test: atest -a art_standalone_dexoptanalyzer_tests Test: atest -a art_standalone_libartbase_tests Test: atest -a art_standalone_libartpalette_tests Test: atest -a art_standalone_libdexfile_support_tests Test: atest -a art_standalone_libdexfile_tests Test: atest -a art_standalone_libprofile_tests Test: atest -a art_standalone_oatdump_tests Test: atest -a art_standalone_odrefresh_tests Test: atest -a art_standalone_profman_tests Test: atest -a art_standalone_runtime_compiler_tests Test: atest -a art_standalone_runtime_tests Test: atest -a art_standalone_sigchain_tests Test: atest -a art_standalone_\*_tests Test: m art_chroot && atest ArtGtestsTargetChroot Bug: 193218514 Bug: 162834439 Bug: 162734417 Change-Id: I8beda9159d48c4ca495698357dc3bd95e3ff84d5 Merged-In: I8beda9159d48c4ca495698357dc3bd95e3ff84d5
* Rename some ART gtest related Soong modules.Roland Levillain2021-07-121-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ART gtests currently link with the debug ("d") versions of ART libraries. The gtests themselves and their libraries are compiled as debug artifacts. For the sake of consistency, perform the following renaming of ART gtest related Soong modules: * `libart-compiler-gtest` -> `libartd-compiler-gtest` * `libart-dex2oat-gtest` -> `libartd-dex2oat-gtest` * `libart-gtest-defaults` -> `libartd-gtest-defaults` * `libart-gtest` -> `libartd-gtest` * `libart-runtime-gtest` -> `libartd-runtime-gtest` * `libartbase-art-gtest` -> `libartbased-art-gtest` As we plan to introduce non-debug ("non-d"), standalone versions of ART gtests in the context of uncoupling ART (target) gtests from the ART APEX (b/162834439), this renaming will help us, as we'll be able to use the old names of a "d" module for the corresponding "non-d" version. (cherry picked from commit 55ffe7fa9ead8b501a756bb53f2571e3e7602f5e) Test: mmma art Test: Run ART gtests on host and target Test: env OVERRIDE_TARGET_FLATTEN_APEX=false art/build/apex/runtests.sh Test: env OVERRIDE_TARGET_FLATTEN_APEX=true art/build/apex/runtests.sh Bug: b/193218514 Bug: b/162834439 Change-Id: I4ca27a7f445a760398f41a9e60a7008d77294505 Merged-In: I4ca27a7f445a760398f41a9e60a7008d77294505
* Replace JIT total time histogram with total time counterCalin Juravle2021-07-011-1/+1
| | | | | | | | | | | We don't report histograms, so let's get the total time as a proxy to measure JIT activity. Test: gtest Bug: 170149255 Merged-In: I76911f5e7f93f00dc9f133e7f89a1045b31dedc7 Change-Id: I76911f5e7f93f00dc9f133e7f89a1045b31dedc7 (cherry picked from commit 9b996ce378e58f4699145721a1708732d5399a95)
* Reduce Partial LSE memory usage.Vladimir Marko2021-06-037-108/+85
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Instantiate ExecutionSubgraph only for partial singleton candidates (currently NewInstance, possibly NewArray in the future). This reduces "LSA" allocations. Reserve memory for PartialLoadStoreEliminationHelper members based on the number of partial singletons instead of the number of reference infos. This reduces "LSE" allocations. The peak scoped arena allocation for one compiled method is reduced from MEM: used: 97424004, allocated: 99006568, lost: 1115968 LSA 46015104 LSE 51408900 down to MEM: used: 17000744, allocated: 26713880, lost: 3332496 GVN 17000744 where the LSA+LSE memory use is lower than GVN use. (cherry picked from commit 5c824937bb82adbde857bc99cb03c769c9f68f7b) Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Bug: 33650849 Merged-In: I323b9f144b258f0fab034794770971547ce94b59 Change-Id: If3fc9787fc0dc4a1a33dd5ca0f2dc972998c4da7
* Rewrite profile file format.Vladimir Marko2021-06-021-48/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The new format contains one mandatory section and several optional sections. This allows extending the profile with new sections that shall be ignored by old versions of ART. We add an "extra descriptors" section to support class references without a `dex::TypeId` in the referencing dex file. Type indexes between the dex file's `NumTypeIds()` and `DexFile::kDexNoIndex16` are used to index these extra descriptors. This prepares for collecting array classes which shall be tied to the element type's dex file even when the array type is not needed by that dex file and has been used only from another dex file. It also allows inline caches to be self-contained, so we can remove the profile index from data structures and serialized data. The creation of the the binary profile from text files is updated to correctly allow array types to be stored as the profiled classes using the "extra descriptors". However, the interface for filling in inline caches remains unchanged for now, so we require a `TypeId` in one of the processed dex files. The data collection by JIT has not been updated. (cherry picked from commit c63d9672264e894d8d409e8d582b4e086b26abca) Test: m test-art-host-gtest Test: testrunner.py --host --optimizing --speed-profile Test: boots. Test: atest BootImageProfileTest Bug: 148067697 Merged-In: Idd5f709bdc0ab4a3c7480d69d1dfac72d6e818fc Change-Id: I99b314c3de4e4bc0c515b86336ecbb283107ee38
* Avoid race on Thread::tlsPtr_::top_handle_scope.Vladimir Marko2021-06-023-64/+128
| | | | | | | | | | | | | | | | Require mutator lock for that field and update tests to hold the mutator lock when needed. This prevents GC thread that executes a thread roots flip on behalf of suspended threads from racing against construction or destruction of handle scopes by those threads and possibly seeing invalid values. (cherry picked from commit 1d326f94a3fdd6292ccdf0022cedfb2a2b8acfee) Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Bug: 189439174 Merged-In: I268a0ef6e5aa838347956febca0d3b6e02fe3ae5 Change-Id: If4cdcf4a488e77cb5aa7748de7c77c49f04388b0
* dex2oat: Abort app compilation without boot image.Vladimir Marko2021-05-262-1/+7
| | | | | | | | | | | | | | | | Also avoid crash in GraphChecker for bad instructions that throw into catch block but do not have an environment. And DCHECK() that java_lang_Double_doubleToRawLongBits and java_lang_Float_floatToRawIntBits are intrinsics. (cherry picked from commit d42902692d1fbb101a3c60ba314df69005da9c83) Test: New test Dex2oatTest.MissingBootImageTest. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Bug: 188684102 Merged-In: I13ec2ee8a7968c0a5652aa67ec6291d07a986c80 Change-Id: I531b87c25e937f8c5f7d471cb7878e086e9662b5
* Compile libart.so and libart-compiler.so with 2MB section alignment.Collin Fijalkovich2021-05-261-0/+1
| | | | | | | | | | | | Adds the appropriate linker flags for libart and libart-compiler to have 2MB section alignment. This allows the executable segment of these libraries to be backed by transparent hugepages on supporting systems. Bug: 158135888 Test: Verified ELF format Change-Id: Ia6455418cf1fdd3a1a98d662bf381db4b58b8536 Merged-In: I5cf4483cd19677d13c7495b25a70b4bf11df04fe
* Fix scheduler's `FieldAccessHeapLocation()`.Vladimir Marko2021-05-242-4/+5
| | | | | | | | | | | | | | Use the correct target for predicated get. Also remove an always-false condition from LSE. (cherry picked from commit 642c8f6e69929f46a1a52583cb55b68d83828a02) Test: m Bug: 188188275 Bug: 188847019 Merged-In: I731e181c8c0d812120dc4fad0c011158053fa7a8 Change-Id: I39152f60d58039077068fc4a085dc2bbc4579fb7
* Fix ReplacementOrValue() for Partial LSE.Vladimir Marko2021-05-243-8/+405
| | | | | | | | | | | | | | | Also fix a bad DCHECK() in `FindSubstiute()` and fix the HeapLocationCollector::VisitPredicatedInstanceFieldGet() to use the correct input. (cherry picked from commit 06fb7fa55cca3210f38c92ac7cc7ad525ff30c83) Test: New tests in load_store_elimination_test. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Bug: 188188275 Merged-In: Ifdace5ddbe1777af2109189013c0557f226d9cc9 Change-Id: If95e67fa0d4e54e6b61f37208986a83bffb9d750
* Reland "Devirtualize to HInvokeStaticOrDirect."Nicolas Geoffray2021-05-141-24/+35
| | | | | | | | | | This reverts commit 39d4df62d4e2606073d05cc363370db825ad7b9f. Reason for revert: fix JIT-zygote issue. Test: JIT zygote boots. Change-Id: I895ad8e59e472fb662ca9bc5394c2fd9c6babc74
* Fix array location aliasing checks in LSE.Vladimir Marko2021-05-136-48/+284
| | | | | | | | | Test: New tests in load_store_elimination_test. Test: New test in 539-checker-lse. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Bug: 187487955 Change-Id: Iff66d5406cf1b36c3bebbce1d48117f83bb50553
* Link libvixl statically.Vladimir Marko2021-05-101-57/+25
| | | | | | | | | | | | | | | | | | | | | | | | | Instead of including shared library libvixl.so in the ART Module, link libvixl statically to all binaries that use it, namely libart-compiler.so and libart-disassembler.so which shall increase in size with the additional libvixl code. The ART Module size with default libvixl symbol visibility: - before: 88460730B - after: 86973943B (-1.42MiB) With hidden libvixl symbol visibility: - before: 88337851B - after: 84962808B (-3.22MiB) (This is with master-art where we do not have a boot profile and therefore compile more code in boot image.) The change from default to hidden visibility is done in https://android-review.googlesource.com/1697237 . Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Test: run-gtests.sh Test: testrunner.py --target --optimizing Bug: 186902856 Change-Id: I040b0115b94b8690ee7be53e3ded8610d9f13e99
* Revert "Devirtualize to HInvokeStaticOrDirect."Nicolas Geoffray2021-05-071-27/+24
| | | | | | | | | | This reverts commit 5024ddfd125b5c3b59d7f359ae33cf7f0255b048. Bug: 187408838 Reason for revert: b/187408838 Change-Id: If74f5ddbacc73296f66c55762e2a8d1ec2cd1f19
* Fix .debug_frame_hdr generation.David Srbecky2021-05-061-7/+10
| | | | | | | | Minor fixes (keep the generation still disabled/unused). Bug: 110133331 Test: art/test.py -b --host Change-Id: I82a104d36afd68ef3133f345991ab3888bdcdc8e
* Devirtualize to HInvokeStaticOrDirect.Nicolas Geoffray2021-05-061-24/+27
| | | | | | | | | When we statically know the target method, devirtualize an HInvokeInterface or an HInvokeVirtual to a HInvokeStaticOrDirect. Test: test.py Bug: 182538502 Change-Id: Ie3a58603cde300fca9ca4972d4dfbbd20918f5ba
* Fix partial LSE using removed load as Phi input.Vladimir Marko2021-05-042-1/+197
| | | | | | | | Test: New test in load_store_elimination_test.cc . Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Bug: 183897743 Change-Id: I4ddf1657b5b9240c229016a3671a74b0582ac30d
* Enable mini-debug-info by default.David Srbecky2021-04-301-1/+1
| | | | | | | | | All paths explicitly enable or disable the command line option. However, if we missed some or developers use stand-alone tools, default to working backtraces, which is the common intention. Change-Id: I1d308f2be881522ecfb945d5f679065e726d32aa
* Fix gtests with mini-debug-info enabled by default.David Srbecky2021-04-302-4/+4
| | | | | | | | Ensure we can generate mini-debug-info if it is enabled by default. The tests don't explicitly generate the info on background thread. Test: test.py -g Change-Id: If3cf9a067ce683f728d553394e1407beeadae670
* Improve simplifier slightlyAlex Light2021-04-301-30/+31
| | | | | | | | | | It's possible thanks to the dead-code-elimination and other passes to end up with a PredicatedInstanceFieldGet that either has a null or a 'never-null' target value. We can simplify this down to either the default value or a normal ifield-get respectively. Test: ./test.py --host Change-Id: I92d9ff159a7b30294d29dbf4349d201dc654f0e1
* Create magic symbol to mark .symtab as sorted.David Srbecky2021-04-291-2/+11
| | | | | | | | | | ELF symbols don't have to be sorted, but ART always sorts them. This is very useful property if libunwindstack can rely on it. (that is, it can binary search the table instead of linear) Bug: 110133331 Test: art/test.py -b --host Change-Id: I4d491096a5bd4ea738a45bbc64fc9dea91c45575
* Reland "Refactor code in inliner."Nicolas Geoffray2021-04-293-145/+160
| | | | | | | | This reverts commit aa1b711a40bfe92785f52bff9700dc516eba1d09. Reason for revert: Fix wrong method being recorded as CHA dependency. Change-Id: Ic8ed84979b4cd67e49b96166792729b3b586cc25
* Revert "Refactor code in inliner."Winson Chung2021-04-293-160/+145
| | | | | | | | This reverts commit 921525030301fd4b8f6bb83aa6b20160d802e689. Reason for revert: Potential cause of b/186637642, b/186637642 Change-Id: Ia6f5cb742a068f148e290071cb0675648b22ec86
* Refactor code in inliner.Nicolas Geoffray2021-04-283-145/+160
| | | | | | | | | | | - Code refactoring to dissociate CHA attempts and devirtualization attemps - Only devirtualize (currently invoke-interface -> invoke-virtual) when the target can be statically resolved. The benefits for CHA and inline caches are less clear. Test: test.py Change-Id: I2d41cef8143ab1ce66b2c2e149674eaf228d15a3
* Remove RETURN_VOID_NO_BARRIER byte-code.David Srbecky2021-04-282-3/+1
| | | | | | | | Unused and obsolete quickened byte-code. Bug: 170086509 Test: test.py -b --host --64 Change-Id: I1e917c189da7bf64418412522676dc6b081d5c0b
* Fix issue with Partial LSE and casts/instanceofAlex Light2021-04-265-29/+476
| | | | | | | | | | | | | | | If PartialLSE encounters an instanceof or check-cast before the escapes it could not correctly handle it. Due to how java language code is typically developed and compiled this is generally not a problem but could lead to incorrect codegen on release builds or DCHECK failures on debug builds. This fixes the issues by (1) causing partial LSE to consider check-cast and instance-ofs to be escaping. This also updates the instruction simplifier to be much more aggressive in removing instance-of and check-casts. Test: ./test.py --host Bug: 186041085 Change-Id: Ia513c4210a87a0dfa92f10adc530e17ee631d006
* Clean up Handle<> comparison with null.Vladimir Marko2021-04-231-2/+2
| | | | | | | These operators do not need the mutator lock. Test: buildbot-build.sh Change-Id: I48f51853f1b3c2e56463140f23777ad26d8122f2
* Move intrinsic recognition logic in inliner.Nicolas Geoffray2021-04-201-56/+41
| | | | | | | | | | The previous place `TryInlineAndReplace` did not cover all cases we try inlining. Because we always want to intrinsify, move the code to `TryBuildAndInline`, which is always called. Test: test.py Test: 638-checker-inline-cache-intrinsic Change-Id: Id74b664f6139c00224473af6c72cb6fd858aec4c
* Fix inliner instruction/register limitsTim Murray2021-04-131-3/+3
| | | | | | | | | | | Because instruction/register usage was compared with >=, the limits were actually one lower than the constants. This prevented trivial getters/setters from being inlined because they were 3 SSA instructions. Test: build + boot + presubmit Bug: 185143864 Change-Id: Ie27c9163efe79bb7392c881c0165ab1164323a2c
* Merge libdexfile_external into libdexfile (reland 2).Martin Stjernholm2021-04-121-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | To reduce the number of DSO's. libdexfile_external only adds a few small functions on top of libdexfile, and it's still only those functions that are available in the APEX stubs. Also rename libdexfile_external_static to libdexfile_static, for consistency. Since libdexfile now has stubs, we need to add test_for properties to avoid linking against the stubs in tests. This relands https://r.android.com/1666119 that got submitted out of order from https://r.android.com/1664026 - prerequisite changes now submitted with https://r.android.com/1671709. Test: Flash and boot with userdebug and eng to try both release and debug modules. Test: art/tools/buildbot-build.sh {--target,--host} Test: art/build/apex/runtests.sh Test: mmm art Bug: 143978909 Change-Id: I6de99052d6d8a9d01d748baabbbcecfe1f4509dc
* Add a test and CHECKs around the combination of CHA and default methods.Nicolas Geoffray2021-04-121-18/+19
| | | | | | Test: 823-cha-inlining Bug: 182538502 Change-Id: Ie3e0014804216802af0addf13751a8f89adbfdfa
* Revert "Merge libdexfile_external into libdexfile (reland)."Ulyana Trafimovich2021-04-091-4/+0
| | | | | | | | | | | | | | | | | | | Revert "Rename libdexfile_external_static to libdexfile_static (..." Revert "Rename libdexfile_external_static to libdexfile_static (..." Revert submission 1666119-libdexfile-noext-2 Reason for revert: broken build 7270939 on aosp-master on full-eng Reverted Changes: I582e49ae7:Merge libdexfile_external into libdexfile (reland)... Iaa6a90f41:Rename libdexfile_external_static to libdexfile_st... I4315189b2:libdexfile_external is replaced by libdexfile (rel... Ia065119c2:Rename libdexfile_external_static to libdexfile_st... Bug: 184929782 Change-Id: Ie69a73f4f0f745ab988e627c568f4ccb83fd1c71 Test: forrest build for aosp-master on full-eng
* Merge libdexfile_external into libdexfile (reland).Martin Stjernholm2021-04-091-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | To reduce the number of DSO's. libdexfile_external only adds a few small functions on top of libdexfile, and it's still only those functions that are available in the APEX stubs. Also rename libdexfile_external_static to libdexfile_static, for consistency. Since libdexfile now has stubs, we need to add test_for properties to avoid linking against the stubs in tests. This relands https://r.android.com/1643424 with leaving out dex_file_ext.cc on Windows (cf. build issue b/184239856): mapped_file.h brings in windows.h in Windows builds, which has several defines that are incompatible with dex internals (e.g. CONST). Test: Flash and boot with userdebug and eng to try both release and debug modules. Test: art/tools/buildbot-build.sh {--target,--host} Test: art/build/apex/runtests.sh Test: mmm art Test: m TARGET_PRODUCT=full TARGET_BUILD_VARIANT=eng checkbuild Bug: 143978909 Change-Id: I582e49ae797744837849db056cef2fbeacc0681e
* Fix issue with propagating partial valuesAlex Light2021-04-082-5/+338
| | | | | | | | | | | | We would incorrectly not propagate or calculate partial read values sometimes in the presence of loops. This fixes that issue by correctly interpreting merged-unknowns as being phis when before escapes and propagating uses of removed reads when needed. Test: ./test.py --host Test: ./art/tools/compile-jar.py --dex2oat `which dex2oatd64` --profile-line 'HSLcom/android/textclassifier/common/statsd/GenerateLinksLogger;->logGenerateLinks(Ljava/lang/CharSequence;Landroid/view/textclassifier/TextLinks;Ljava/lang/String;JLcom/google/common/base/Optional;Lcom/google/common/base/Optional;)V' --arch arm64 ~/GoogleExtServices.apk -j1 --runtime-arg -verbose:compiler --dump-stats Bug: 183554067 Change-Id: I7f6e99934237174922ef2da2b77092e74cfb6a77
* Handle predicated-gets with default valuesAlex Light2021-03-312-1/+88
| | | | | | | | | | Due to an oversight the default-value of a PredicatedGet did not support being a Default value. This fixes that oversight. Test: ./art/tools/compile-jar.py --profile-line 'HSLe/k/a/g/i;->i(Le/k/a/g/d;Ljava/io/OutputStream;)V' --arch arm64 ~/no.nrk.mobil.radio_10922_base_split.apk --compiler-filter=speed-profile --dump-stats -j1 --force-allow-oj-inlines Test: LoadStoreEliminationTest.PredicatedLoadDefaultValue Bug: 183898383 Change-Id: I11bccddb0b5a5c2e958690864ff2d4449a9f2fad
* [metrics] Add JitMethodCompileCountEric Holk2021-03-311-0/+1
| | | | | | | | This tracks how many methods have been compiled by the JIT. Bug: 170149255 Test: manual Change-Id: Id7943818318dae26afdac7f9903cd32b7e2c4e89
* Fix simplifier issue with predicated ifield getAlex Light2021-03-306-383/+722
| | | | | | | | | | | | | | | | | | | | In cases where all targets of a HPredicatedInstanceFieldGet instruction are known to not be null the simplifier would attempt to replace the default value with a null instruction. This would cause a null-pointer dereference. Correct the simplifier to handle this case correctly. Moved some LSE test helper functions to CommonCompilerTestHelper to avoid duplicating code. Fixed an incorrect (though until now unused) constructor for HPredicatatedInstanceFieldGet (the default value and target we swapped). Test: ./test.py --host Test: ./art/tools/compile_jars.py --profile-file bad-compile.txt ~/imgur.apk Bug: 183942773 Change-Id: I66f4ce37d768d5e457047a3f80bd4cb9aa4546a3
* Remove QUICK bytecodes.David Srbecky2021-03-271-29/+2
| | | | | | | | | | Remove the deprecated unofficial (not part of the spec) bytecodes. This frees the 16 bytecodes for future use. Bug: 170086509 Test: m test-art-host-gtest Test: test.py -r -b --host Change-Id: I9f6d8a2c21b88f883c8fdc1eb67b24620f313d56
* Fix IC resolution DCHECKAlex Light2021-03-231-1/+5
| | | | | | | | | | | | | | We were incorrectly asserting that all inline-cache entries referring to valid classes are resolvable. This is only true as long as the profiles stay perfectly in sync with the framework code, which is not likely to always be the case since we update profiles rather infrequently. This simply loosens the dcheck to return null on unresolvable methods when run in AOT mode. Test: m droid Bug: 168941430 Bug: 183514504 Change-Id: Id863b65ccead1a40643c4538df4f5215a18e39ad
* Remove Vdex::GetQuickenedInfoOf and all its users.Nicolas Geoffray2021-03-236-111/+35
| | | | | | Test: test.py Bug: 170086509 Change-Id: I1e1a4abf71245c0fd37f951c9af85f62feba18ca
* JNI: Use callee-save register for IRT cookie.Vladimir Marko2021-03-2311-49/+72
| | | | | | | | | Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Test: run-gtests.sh Test: testrunner.py --target --optimizing Bug: 172332525 Change-Id: I6a91d86fd31ff33882b41646aae9fcccc157d638
* Remove DexToDexCompilerDavid Srbecky2021-03-181-4/+0
| | | | | | | | | | | Since quickening is deprecated, it is no longer used. This CL only removes compile-time dead code. Bug: 170086509 Test: test-art-host-gtest Test: test.py -r -b --host Change-Id: I46c02fb7a9304f8361cecfafb9507c906a93592f
* Allocate LSEVisitor on the arena stack.Vladimir Marko2021-03-181-4/+23
| | | | | | | | | | | | | | Use a simple wrapper to allocate the LSEVisitor on the arena stack. This allows adding additional members to the class without running into stack frame size errors with clang. Make the pre-allocated buffer for `store_records_` a member of LSEVisitor as originally intended. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Bug: 181943478 Change-Id: I88b8ca5f9c765cc26e884e9f29cb2c870c799e13
* Store inline caches in StackHandleScope<> in HInliner.Vladimir Marko2021-03-152-99/+58
| | | | | | | | | Avoid a managed heap allocation. Test: m test-art-host-gtest Test: testrunner.py --host Bug: 181943478 Change-Id: I7ce65c93ad2f59490dbfa2aaccba98b6ca1fd585
* Rewrite hot method info retrieval.Vladimir Marko2021-03-152-48/+35
| | | | | | | | | | | | | | | Remove the `ProfileCompilationInfo::GetHotMethodInfo()` API and provide another API to tie profile indexes to dex files for inline caches that avoids unnecessary heap allocations. And look up only dex caches for the referenced dex files when getting AOT inline caches in HInliner. Test: m test-art-host-gtest Test: testrunner.py --host --optimzing Test: boots. Bug: 181943478 Change-Id: I124ac4870b0f483c1f0422c841c4ff69fc95b7e0