summaryrefslogtreecommitdiff
path: root/dex2oat/common_compiler_driver_test.cc
AgeCommit message (Collapse)Author
2025-02-18Do not inline a method that was marked as un-compilable. Nicolas Geoffray
The compiler may have internally mark a method as not compilable. Do not clear the verification results from the compiler callbacks, we still need them during compilation. Test: 860-vdex-failure Bug: 395243275 Change-Id: I79ba61eb8a7ba6729b22c4c27fa83d8373fce03a
2024-03-11Revert^2 "Remove Compiler::Kind" Santiago Aboy Solanes
This reverts commit f66031b556c386f582eab39b5c616104d77fc375. Reason for revert: The original CL got reverted due to a conflict with aosp/2919307. That other CL got reverted so we can reland as-is. Bug: 289199192 Change-Id: Ibe75708b00eac32210ac37655fc16e6ee6880368 Test: art/test/testrunner/testrunner.py --host --64 --optimizing -b
2024-03-07Revert "Remove Compiler::Kind" Vaibhav Devmurari
This reverts commit 3370f9fc477f0b25c4c6b10321b3f8e46903ad4f. Reason for revert: Build failure: b/328584377 Change-Id: I078c00e2df24950a156cd0c3ac6d78778f6ac2ba
2024-03-07Remove Compiler::Kind Santiago Aboy Solanes
It only has one true value (Optimizing) since Quick is obsolete. Bug: 289199192 Test: art/test/testrunner/testrunner.py --host --64 --optimizing -b Change-Id: Ib7394d4e54cf3e22ea7fc09b9a951081d71f0365
2023-12-27Optimize access to gPageSize Ruben Ayrapetyan
This change refactors the global constants dependent on gPageSize in a way that gPageSize and dependent constants are now internal to the runtime. Also it removes static initialization dependency on gPageSize and disallows accessing gPageSize during the static initialization phase. Consequently, this removes a need in the condition check when accessing gPageSize and allows compiler to recognise the value as a constant that can be cached where used repeatedly. From this point, gPageSize should only be used within libart. For most of the other cases MemMap::GetPageSize() should be used. Where MemMap is unavailable e.g. during static initialization or another stage when MemMap isn't yet initialized, or in a component which might operate without MemMap being initialized, the GetPageSizeSlow() would be generally suitable. For performance-sensitive code, GetPageSizeSlow() shouldn't be used without caching the value to remove repeated calls of the function. - The gPageSize constant is now local to libart. Access to the variable is disallowed until Runtime is initialized, so removing the chance of static initialization order issue related to this value. The initializers for the other constants with initialization that used to depend on the gPageSize value are now referring to GetPageSizeSlow instead, so removing the static initialization dependency, and consequently, possible order issues. This removes the condition check upon each load of the gPageSize. Also as the variable is defined with "hidden" visibility, it isn't exported and so is unavailable to other DSOs. This also removes one indirection level in accessing it as GOT lookup is not required anymore. - Remove gPMDSize and gPUDSize from libartbase Move the constants to gc::Heap in form of functions computing their values. Also move the BestPageTableAlignment function dependent on the values, as it is only used within the GC. Direct accesses to gPMDSize are only performed for assertions and so replacing that with a function call shouldn't matter for performance. gPUDSize isn't accessed directly. The rest the values accesses are done via BestPageTableAlignment, which is called from: - MarkCompact constructor - MarkCompact::AddLinearAllocSpaceData - GcVisitedArenaPool::AddMap In all cases, it's performed in conjunction with MapAnonymousAligned, which involves an mmap system call. The potential slight slowdown in BestPageTableAlignment - due to the dynamic computation of the gPMDSize and gPUDSize values - is expected to be negligible in comparison to the performance cost of mmap system call. - Move gPageSize declaration and definition to the runtime / component Replace the removed uses of gPageSize outside libart with MemMap::GetPageSize() / GetPageSizeSlow(). There is one exception to the above statement in this change - in FdFile, where the page size appears to be used arbitrarily to compute the maximum buffer size: in that case replace the maximum buffer size with a constant which would have matched the value when the page size is 4K. - Make gNumLrtSlots a member variable The gNumLrtSlots global is only used within the SmallLrtAllocator class. Move it inside the class as a member variable. - Remove gStackOverflowProtectedSize global Value of the gStackOverflowProtectedSize is computed as a page size multiplied by a constant dependent on whether the address sanitizer is enabled. If address sanitizer is disabled, the constant is 1, in which case gStackOverflowProtectedSize is equal to the page size. Replace the global with an always-inlined function which is expected to expand into a simple reference to the gPageSize at each call site if the address sanitizer is not enabled. - Remove ART_PAGE_SIZE_AGNOSTIC_DECLARE_* macros The macros aren't used anymore. Remove them and GlobalConst. The tests were run for legacy 4K, page size agnostic 4K and 16K. Co-authored-by: Ruben Ayrapetyan <ruben.ayrapetyan@arm.com> Co-authored-by: Richard Neill <richard.neill@arm.com> Test: art/tools/run-gtests.sh Test: art/test/testrunner/testrunner.py --target --64 Test: art/tools/run-libcore-tests.sh --mode=device --variant=X64 Test: art/tools/run-libjdwp-tests.sh --mode=device --variant=X64 Test: cd art && mma Change-Id: I07fd85cd35dd443dee5cff0f7435ab47ba727c6f
2023-11-30Use globals naming scheme for kPageSize etc. Ruben Ayrapetyan
This patch is part of the chain preparing for making kPageSize non-constexpr in a future patch. The following values aren't always constexpr anymore - in some configurations these are global dynamically initialized constants. Rename them accordingly: - kPageSize to gPageSize; - kPMDSize to gPMDSize; - kPUDSize to gPUDSize; - kNumLrtSlots to gNumLrtSlots; - kStackOverflowProtectedSize to gStackOverflowProtectedSize. Also fix the typo in the kMininumMapSize identifier. Test: Same as for I5430741a8494b340ed7fd2d8692c41a59ad9c530. The whole patches chain was tested as a whole. Change-Id: Ic8502aa66d75d2bbba698282a1eaf1a029b02d3a
2022-09-30Move `VerificationResults` to dex2oat/. Vladimir Marko
Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Change-Id: Iff62c9b8c6e553113cbd12765bf0f691bbe24227
2021-11-11Fix potential lint errors Orion Hodson
Bug: 200914293 Test: m cpplint-art (using tools/repo-hooks/tools/cpplint.py) Test: treehugger Change-Id: I8ec57527ad7ce94b26c4f65727f536a5ebbbd6aa
2021-10-21Revert "Revert^4 "Use cpplint.py from repohooks"" Orion Hodson
This reverts commit 0a12631fd5364d5908d59ea476bea075019ebecd. Reason for revert: breaks on git_sc-dev-plus-aosp Bug: 200914293 Bug: 203764182 Change-Id: I66c00e1c77ea339182d3b457dbf18afd0c70dfe8
2021-10-21Revert^4 "Use cpplint.py from repohooks" Orion Hodson
This reverts commit dc26639f11ef2a97bc9aa9d9f4a8b8cbf9791481. Reason for revert: repohooks now in sync across branches (thanks to tavila@). Bug: 200914293 Test: Treehugger Test: m cpplint-art Change-Id: I55cf52db799e7d99dde488ff0bfbc7b3dc158a59
2021-09-22Revert "Revert^2 "Use cpplint.py from repohooks"" Yuri Lin
This reverts commit c178495c22b0ea5541e173dd2f319ccbf8b05dd5. Reason for revert: DroidMonitor-triggered revert due to breakage https://android-build.googleplex.com/builds/quarterdeck?branch=git_sc-dev-plus-aosp&target=aosp_crosshatch-userdebug&lkgb=7755813&lkbb=7756178&fkbb=7755871 (one of a few branches breaking), bug b/200807714. Change-Id: If41be2cd7ea9440351fa78c50da2358f49ab2e93
2021-09-22Revert^2 "Use cpplint.py from repohooks" Orion Hodson
Issue leading to revert was fixed in commit b1d903587248775b526adf379478575f0713ac76 (https://r.android.com/1833355). Test: m cpplint-art Test: m Bug: 200771958 This reverts commit af5fc456b0d6f4ab587dbc3f57e55488eb5912ea. Change-Id: Iff07960fd1503031418183f747f8d42b4c1d132f
2021-09-22Revert "Use cpplint.py from repohooks" Paul Hadfield
This reverts commit 145f96954680bd24f2c8bbc63b9e199343ba0401. Reason for revert: DroidMonitor-triggered revert due to breakage https://android-build.googleplex.com/builds/quarterdeck?branch=aosp-master&target=aosp_x86_64-userdebug&lkgb=7754422&lkbb=7754941&fkbb=7754782, bug b/200771958 BUG: 200771958 Change-Id: Ie8ca21d5f14d6e1dcda4d0a2f730f4590f7ce108
2021-09-22Use cpplint.py from repohooks Colin Cross
The cpplint.py in external/google-styleguide is out of date and doesn't support python 3. Switch to the one in tools/repohooks/tools to match the preupload configuration. Also fix some lint issues caught by the new version. Test: m cpplint-art Change-Id: Ie8c307388362c03c6f33cda6d4ec95c244481adf
2021-07-14Remove the need of VerifiedMethod in the compiler. Nicolas Geoffray
The compiler only needs to know if a method is compilable or not. So just record a set of uncompilable methods (in some cases, we cannot have an ArtMethod, but the method can still be compiled). Test: test.py Bug: 28313047 Change-Id: Ic4235bc8160ec91daa5ebf6504741089b43e99cb
2021-03-18Remove DexToDexCompiler David Srbecky
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
2019-03-11Move CompilerDriver to dex2oat/. Vladimir Marko
Also DexToDexCompiler, QuickCompilerCallbacks and tests. aosp_taimen-userdebug: - before: lib64/libart-compiler.so: 3112344 lib/libart-compiler.so: 2312908 bin/dex2oat: 563176 - after: lib64/libart-compiler.so: 2986720 (-123KiB) lib/libart-compiler.so: 2219852 (-91KiB) bin/dex2oat: 635832 (+71KiB) Test: m test-art-host-gtest Test: testrunner.py --host --optimizing --jit Change-Id: I36e63b83dff1d5c731d05de27d3663cfc81de6ad