summaryrefslogtreecommitdiff
path: root/compiler/driver
AgeCommit message (Collapse)Author
2025-02-19[Sim] Add a restricted mode setup Chris Jones
This CL introduces a special ART setup for all modes (host, target), which is going to be a base for VIXL Simulator Stage 1 setup. This setup can be enabled by exporting ART_USE_RESTRICTED_MODE=true to the environment before building ART. The setup limits ART by doing the following: - Limits the GC to only non-concurent Mark&Sweep. - Turns off the Nterp (so only switch C++ intepreter to be used). - Turns off the JNI compiler (GenericJNITrampoline to be used). - Rejects the compilation of all method (except for the allow list). - Turns off compilation and support of intrinsics. - Turns off implicit null checks. - Turns off implicit suspend checks. - Turns off introspection entrypoints. - Turns off special behavior for critical native methods. - Turns off compiler CHECKER tool. With these limitations it will be easier to start off an initial Simulator Stage 1 setup. As the limitations are set for all the modes, it will be easy to compare/debug the workflow for the simulator mode and to compare it to host and target runs. The CL also adds sections in knownfailures.json for tests that fail in this special setup. Also cleanup some read barrier entrypoint declarations in entrypoints_init_arm64.cc to match the definitions in quick_entrypoints_arm64.S and slightly refactor Runtime::Init to stay below the 500 line limit. Author: Artem Serov <artem.serov@linaro.org> Artem Serov <artem.serov@arm.com> Chris Jones <christopher.jones@arm.com> Test: export ART_USE_RESTRICTED_MODE=true test.py --host --target Change-Id: I87319cf339646dc13b9086b00af08882b01603c8
2025-01-16Merge sFields and iFields. Nicolas Geoffray
Test: test.py Change-Id: Ib97fca637a8866a41a4389b150c6000d9fb6d99b
2024-06-13Use C++20 `string{,_view}::{starts,ends}_with()`, part 1. Vladimir Marko
Remove the header file `string_view_cpp20.h` and update all source files that previously used this header file. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Change-Id: Iafcdfc838a97deed7fb3a37cc8afe1f7ee78306b
2024-05-23Fix class status check in `InitializeClassVisitor`. Vladimir Marko
And address other late comments on https://android-review.googlesource.com/2163021 . Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Test: run-gtests.sh Test: testrunner.py --target --optimizing Bug: 162110941 Change-Id: I9eb49179633f94044b2060231babd156787bbd14
2024-05-13Conditionally increase suspend timeout Hans Boehm
This does two things: 1. Respect ro.hw_timeout_multiplier when computing the default suspend timeout. 2. Increase the timeout by a factor of 2 when the thread initiating the suspension has low priority (positive nice value or Java priority < 5). Case 2 should not normally apply for threads with a 5 second ANR timeout. For suspension initiated from low priority threads, this should get us back to close to the original 10 second timeout. It should also give slow device the option of avoiding suspension timeouts by setting ro.hw_timeout_multiplier. Also includes some minor macro cleanups. Test: Treehugger Test: Some manual checking of suspend timeout values Bug: 339660702 Bug: 337585993 Bug: 327315839 Bug: 199683153 Bug: 297125507 (and others) Change-Id: I18638667a8d46d117b06ecedca13df9a6a7f8530 Change-Id: I12d2d7c047194775e1789b02603d3c1d96cc3191
2024-04-04Remove RegisterAllocator::Strategy Santiago Aboy Solanes
It has been obsolete since graph color was removed. Bug: 281793697 Test: art/test/testrunner/testrunner.py --host --64 --optimizing -b Test: m test-art-host-gtest Change-Id: I8b42b0fe39a8601da7aa1288a8581ab8b4742614
2024-02-14Increase inlining threshold for baseline. Nicolas Geoffray
Gives better results when scrolling. Reduces jank on compose view scrolling for 4 iterations: - For Go Mokey: - Before: ~937 frames drawn / ~5.52% janky frames - After: ~1014 frames drawn / ~4.54% janky frames - For Pixel 8 pro: - Before: ~2446 frames drawn / ~0.67% janky frames - After: ~2449 frames drawn / ~0.51% janky frames Test: test.py Bug: 313040662 Change-Id: I21492e103a9dc4658aa89dfb12b86eb30680564f
2024-02-06CompilerOptions refactor after aosp/2808063 Santiago Aboy Solanes
* Updated comments * Made constants constexpr * Renamed kBaselineMaxCodeUnits to include "Inline" Test: art/test/testrunner/testrunner.py --host --64 --optimizing -b Change-Id: I37569b3d9e5eecfd65a505a79945bbe5b290fbbf
2024-01-30Reland^2 "Run optimizations with baseline compilation." Nicolas Geoffray
This reverts commit 3dccb13f4e92db37a13359e126c5ddc12cb674b5. Also includes the fix for incrementing hotness that got reverted: aosp/2906378 Bug: 313040662 Reduces jank on compose view scrolling for 4 iterations: - For Go Mokey: - Before: ~698 frames drawn / ~13.87% janky frames - After: ~937 frames drawn / ~5.52% janky frames - For Pixel 8 pro: - Before: ~2440 frames drawn / ~0.90% janky frames - After: ~2450 frames drawn / ~0.55% janky frames Reason for revert: Reduce inlining threshold for baseline. Change-Id: Iee5cd4c3ceb7715caf9299b56551aae6f0259769
2024-01-30Allow compilation of large methods with no branches Santiago Aboy Solanes
Popular apps include such methods in their profiles. Having the extra heuristic of skipping compilation for large methods with no branches can be unintuitive for developers who created those profiles. Some apps see startup improvements with this heuristic removed. Bug: 316617683 Test: art/test/testrunner/testrunner.py --host --64 --optimizing -b Change-Id: I21a8da93e89399dac0e45c3ab43a8bbedc925a44
2023-12-04Put branch profiling under a flag. Nicolas Geoffray
Until we evaluate its usefulness and reduce its overhead. Bug: 306638020 Test: test.py Change-Id: Ibb01c70a7ea19b03802dcc1b0792d3d2ff4f4d67
2023-11-14Remove regalloc_gc flag from our test infra Santiago Aboy Solanes
Since we removed the graph color (aosp/2584792), the regalloc_gc flag is equivalent to optimizing. Test: Presubmit Bug: 281793697 Change-Id: Ifc08c7e32205c6d650acfa2d4ea6b9dc0a13b057
2023-11-06Deprecate num-dex-methods and top-k-profile-threshold flags Santiago Aboy Solanes
They were unused and did nothing. Test: Presubmit Change-Id: Id651d5834afcdf293939b79d330b198aef0c954c
2023-10-30Replace `gUseReadBarrier` with compiler option in compiler. Vladimir Marko
Leave a few `gUseReadBarrier` uses in JNI macro assemblers. We shall deaal with these later. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Test: run-gtests.sh Test: testrunner.py --target --optimizing Bug: 289805127 Change-Id: I9d2aa245cee4c650129f169a82beda7dc0dd6a35
2023-09-08riscv64: [codegen] Add VisitNullCheck Vladimir Marko
Also enable codegen for NullCheck and fix related entrypoint issues. For now, this is using explicit null checks. Change the default value of the implicit null checks flag in the `CompilerOptions`. In `dex2oat` we expect the default value to be false and override it to true when needed by the selected architecture. This aligns with the behaviour in `Runtime` which is the source of this information for JIT. We do not change the default value for implicit stack overflow checks flag yet because it requires additional adjustments to avoid breaking certain gtests. Test: m test-art-host-gtest Test: aosp_cf_riscv64_phone-userdebug boots. Test: run-gtests.sh # Ignore pre-existing timeout in `TestImageLayout`. Test: testrunner.py --target --64 --optimizing # Ignore 49 pre-existing failures. Bug: 283082089 Change-Id: If663d3279da5e6c53669860cefa7185c53e7e146
2023-09-07Don't inline AddCompilerOptionsArgumentParserOptions Ryan Prichard
This function generates a large stack frame, but that's OK, so the stack frame limit is ignored for it. However, if the function is inlined into its callers, then the pragma suppressing the stack frame limit doesn't work. Bug: b/175635923 Test: treehugger Change-Id: Ie24409ba5691f2734cfedb6506e9fb341718b86b
2023-06-29riscv64: Enable JNI compiler. Vladimir Marko
Implement the required `WriteCIE()`, fix a bug in the `art_jni_dlsym_lookup_critical_stub`, fix reference loads to be zero-extended and enable the JNI compiler for riscv64. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Test: run-gtests.sh Test: testrunner.py --target --64 --ndebug --prebuild --no-prebuild -t 178 Test: # Edit `run-test` to disable checker, then testrunner.py --target --64 --ndebug --cdex-none --optimizing # 7 tests fail (pre-existing failures): 004-StackWalk, 137-cfi, # 2042-reference-processing, 597-deopt-busy-loop, 629-vdex-speed, # 638-checker-inline-cache-intrinsic and 661-oat-writer-layout. Test: aosp_cf_riscv64_phone-userdebug boots without crashes. Bug: 283082089 Change-Id: Ifd47098b7428919b601dd22a130ad1bd51ae516d
2023-05-10ART: Remove graph coloring register allocator. Vladimir Marko
Test: m test-art-host-gtest Bug: 281793697 Change-Id: Ic73a8a06e08437847db943bc3df148ca65b5f9a9
2023-03-31riscv64: Let dex2oat run in verification mode (disable compilation). Ulya Trafimovich
There is no compiler support for RISC-V yet, but dex2oat can perform verification and compile boot images and app images as though it was running with compiler filter "verify". This allows us to re-enable dexpreopt and speed up the first boot, as there is no need to verify all the apps on device. The change is done purely in ART by adding a workaround to turn off compilation completely on RISC-V, as opposed to setting compiler filter "verify" in the build system (e.g, we still keep compiler filter "speed-profile" for boot images in RISC-V). This approach is chosen so that fewer modifications are needed when adding compiler support. Bug: b/271573990 Test: `lunch aosp_riscv64-userdebug && m` (with cherry-picked https://r.android.com/2511036) Change-Id: If5dd798d043edc0c0ed321ad2ef5b841e68efe0f
2023-03-17Deprecate the extract compiler filter. Nicolas Geoffray
For now make it an alias to verify. Test: test.py Bug: 237380287 Change-Id: Ib6cb2037d24bb895b77a870e8aebe76764b53e3d
2022-11-23Add clang-format preupload check. Martin Stjernholm
This will check that new and changed lines conform to the style defined in .clang-format. Specific code sections can be excluded if it gets in the way (some examples included). Also fix the java style to not line break in "/// CHECK" comments, and use the AOSP style import order. Java files in art/tools/ahat and art/tools/dexfuzz use indentation width 2, so they get an override .clang-format with that style. Java files in test/ have a mix of different indentation widths, so that directory is excluded for the time being. openjdkjvmti/include/jvmti.h is an imported file that should be ignored altogether. However, it is not straightforward to configure a whole file exclude. Upload it with --no-verify if it needs to be updated. Test: clang-format -i art/dex2oat/dex2oat_options.cc \ art/benchmark/const-class/src/ConstClassBenchmark.java \ art/tools/ahat/src/main/com/android/ahat/heapdump/Parser.java \ art/tools/dexfuzz/src/dexfuzz/program/IdCreator.java Check that reformatted files look reasonable Test: Create a local commit with changes in both art/libartservice and art/test, run tools/repohooks/pre-upload.py, and verify that only the changes in art/libartservice get checked. Bug: 181877164 Change-Id: I991ff032694bf5063e8516fdf71a95d0b047ffea
2022-11-18Make remaining compiler/ symbols hidden. Vladimir Marko
And mark required symbols with EXPORT. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing --jit Change-Id: I1b4e3c1ef9006924456dc36ec906bf74b62adab4
2022-10-10ART: Move `CompiledMethod{,-Storage}` to dex2oat/. Vladimir Marko
Introduce a `CompiledCodeStorage` interface for callbacks to `dex2oat` for storing code produced by `libart-compiler`. Using this new interface, move `CompiledMethodStorage` (this is a misnomer as it's also storing non-method thunk code), `CompiledMethod` and `SwapSpace` to dex2oat/. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing --jit Test: run-gtests.sh Test: testrunner.py --target --optimizing Change-Id: Icb7ffc134d00e53c25bd665d044dd1c98bd49a64
2022-09-30Move `VerificationResults` to dex2oat/. Vladimir Marko
Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Change-Id: Iff62c9b8c6e553113cbd12765bf0f691bbe24227
2022-08-11Reland "Add clinit checks at entry for some boot image methods." Nicolas Geoffray
This reverts commit 0ae89052f7213701b8b3a782266e84b3d3600dbf. Bug: 162110941 Bug: 238472973 Reason for revert: Remove code that forced using clinit entrypoints in debug mode. Change-Id: Ibc04e91b09deaa1ac23d32b9e45281f3299d2981
2022-07-12Revert "Add clinit checks at entry for some boot image methods." Nicolas Geoffray
This reverts commit c37e3a0a532fb89b62753d0478c1ba3c9fc87bb3. Bug: 162110941 Bug: 238472973 Reason for revert: b/238472973 Change-Id: Ie684612c4e660ff121108ecc5e7455811c93353b
2022-07-08Add clinit checks at entry for some boot image methods. Nicolas Geoffray
Look at the list of preloaded classes to know whether the class will be initialized. If it's not in the list, add explicit clinit checks at entry. Update FixupStaticTrampolines to only update the entrypoint if it is the resolution stub. This adds two pages to current on-device boot classpath oat files. Test: imgdiag Bug: 162110941 Change-Id: Ic7b0b01a772444bc615b62cdb9305a1ef555c780
2022-04-06Touch up changes related to cross-dex compiling Santiago Aboy Solanes
* Added exaplanatory comments * Used IsBootStrapClassLoaded to avoid a read barrier * Use the new multi-image from CompilerOptions Bug: 154012332 Test: art/test/testrunner/testrunner.py --host --64 --optimizing -b Change-Id: I10a4ed0f9d5b2e796102846564a54dc90f297068
2022-04-04Preallocate `CodeInfoTableDeduper::dedupe_set_`. Vladimir Marko
Preallocate large buffer except for multi-image compilation which requires multiple dedupe sets, so we let them grow as needed without wasting too much memory. We do not expect to use multi-image compilation on user devices. Also remove the hash from the dedupe set entry. With the large pre-allocated buffer, we have very few hash conflicts and comparing the hash just slows down finding identical entries. If we exceed the pre-allocated buffer, this shall trade some performance for lower memory use. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Bug: 181943478 Change-Id: Ibbb98b6d3ebbc35ffa75165baad54f4df7c62ad9
2022-03-25Remove obsolete code related to quickening. Vladimir Marko
Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Change-Id: I5e3b819d5dcee20f3cf8ae8175769115f88af027
2022-01-17Revert "Expand sharpening's ComputeLoadClassKind to cover cross-dex cases" Nicolas Geoffray
This reverts commit 32b8c8f33ad68982357c1fa3d0f132d06b070ab5. Bug: 154012332 Bug: 214850438 Reason for revert: b/214850438 Change-Id: I479c0910ce5da593e170bc5e4f6fa10dfe5d67b2
2022-01-13Expand sharpening's ComputeLoadClassKind to cover cross-dex cases Santiago Aboy Solanes
We can handle some extra cross-dex cases in order to expand the support. Bug: 154012332 Test: ART tests Change-Id: Ic3220d809086b4b3007bf5b6d63789ffb1b91fb9
2021-11-11Add .bss support for inlining across dexfiles within Oat Santiago Aboy Solanes
We can safely reference other dexfiles within the same oat file for cross-dex inlining. This CL makes the OptStat#NotInlinedBss drop to less than 1% of the not-inlining cases. Test: ART tests Change-Id: I676d48d973abf7a6f8412cf3b7bb73afd7747f31
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-04-30Enable mini-debug-info by default. David Srbecky
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
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
2021-02-09[metrics] Report some ART metadata Eric Holk
Adds reporting for some metadata associated with ART metrics, including timestamp relative to ART startup, the session id, and the process's user id. It additionally outputs placeholders for the compilation reason and compiler filter, but these need some additional plumbing from the Runtime and OatFileManager to fill in, so those will come in a followup CL. This CL also includes a fair amount of refactoring around metrics reporting and handling the session data. Example output: *** ART internal metrics *** Metadata: timestamp_since_start_ms: 768 session_id: 5026277321588503825 uid: 123456 compilation_reason: Unknown compiler_filter: (unspecified) Metrics: ClassVerificationTotalTime: count = 4167 JitMethodCompileTime: range = 0...1000000, buckets: 7,0,0,0,0,0 *** Done dumping ART internal metrics *** Test: ./test/run-test --host --jit 2232-write-metrics-to-log Change-Id: Ic74b503b135d71099d9e26bf660b60e4cc3a46bc
2020-12-10Make RTP::Visit robust against input order Alex Light
ReferenceTypePropogation::Visit(ArrayRef) relied on the input having a particular order with known values at the front then topological. This could cause issues if the list was not properly sorted, causing the RTP to silently fail. This makes RTP robust against the ordering of inputs for this function. Test: ./test.py --host Bug: 67037140 Change-Id: I03c522ea745f271ce438c82f7c6f3ab476c8249a
2020-09-02Use help-text generator for dex2oat Alex Light
The use of a static text blob makes keeping the dex2oat help text up to date difficult. Change to use the new cmdline help-text generator code. Test: dex2oat --help Change-Id: I1139cba2c773242e15f863d7efd2c7050c05ab4f
2020-05-20Add compiler type to CompilerOptions. Vladimir Marko
Let CompilerOptions hold the information whether it is AOT or JIT compilation, or Zygote JIT for shared code. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing --jit Test: aosp_taimen-userdebug boots. Change-Id: Id9200572406f8e43d99b8b61ef0e3edf43b52fff
2020-04-01Add explicit compiler option to enable test-specific features. David Srbecky
We can no longer rely on checking the "core.art" image name, since we plan to remove it and use the shipped boot image. This option enables test-specific features, such as $noinline$. Test: ./art/test.py -r --optimizing --64 Bug: 147817558 Change-Id: Iadac6e1b0f46e83efd0551fb8462a6b268ad33d8
2020-03-27Revert^4 "Add "linkage" test options"" David Sehr
This reverts commit 16c08ca97486f535698f1a1b17f0332bfe78e95a. Reason for revert: Disabled on device testing Change-Id: I8d5442e0ebb6383ebfbce98f1857b5e844e0d5e1 Bug: none Test: make test-art-host-gtest-dex2oat_test
2020-03-27Revert "Revert "Revert "Add "linkage" test options""" Nicolas Geoffray
This reverts commit 80c0c50de048da458c707adde5b0499d75f8253a. Reason for revert: Test fails on device: https://ci.chromium.org/p/art/builders/ci/angler-armv8-ndebug/1306? Change-Id: I19e9b9e24023b2d7b6b86114c7a9e4018f65b2b8
2020-03-26Revert "Revert "Add "linkage" test options"" David Sehr
This reverts commit 91a8e6f60c508c6e010b6ef8e4056e3a6f04c447. Reason for revert: Moved tests to gtest and under compilation only. Change-Id: I60899694946353bfcd334473c20bb17c84f095e0 Bug: none Test: make test-art-host-gtest-dex2oat_test
2020-03-23Revert "Add "linkage" test options" Nicolas Geoffray
This reverts commit 873bb64b8815b3f6a350ce109eb54ec770369d22. Reason for revert: Test in CL fails on device, see: https://ci.chromium.org/p/art/builders/ci/angler-armv7-ndebug/1302? Change-Id: I18d8204f40bbc0f89eb230656e14966035b0b1c3
2020-03-20Add "linkage" test options David Sehr
Add options to control "linkage" model. This involves checking for redefinitions and subclassing classloaders. Bug: none Test: 1964-redefinition Change-Id: I0cb3c725b7d62f7c6c0958dc6d5f9b55d6258fd5
2020-02-28Revert "Revert "If generating an image, run initialization and other ↵ Nicolas Geoffray
optimizations."" This reverts commit bbec8a6fc720ee5ce572d3fb63617fb0af6addc7. Reason for revert: Fix vdex compilation with app images. Test: 628-vdex Bug: 150193586 Change-Id: Ic4d0445f277caf9405c18938c1f39ee08b9bf2fd
2020-02-26Revert "If generating an image, run initialization and other optimizations." Eric Holk
This reverts commit ada8536c19e57cbfe55dcb3c72aa95e79365ed21. Reason for revert: test failures Change-Id: I8640fe842d7f2255b5749403c798094f9e365fda
2020-02-25If generating an image, run initialization and other optimizations. Nicolas Geoffray
The biggest reason for this CL is to ensure a boot image and a boot image extension always have their conflict tables filled. Test: test.py Bug: 149894949 Change-Id: I7bada1b3697322ce78b4f352dec854651c0e995c
2020-02-20Do not verify dex files for --compiler-filter=assume-verified. Vladimir Marko
Reduces the compilation time for the boot image extension with said filter by over 0.5s (comparing the best observed timing "before" to the worst observed timing "after"). Test: aosp_taimen-userdebug boots; adb root && \ adb shell stop && \ adb shell setprop dalvik.vm.boot-image \ 'boot.art:/nonx/boot-framework.art!/system/etc/boot-image.prof' && \ adb shell 'setprop dalvik.vm.extra-opts \ "-Ximage-compiler-option --compiler-filter=assume-verified"' && \ adb shell start # Starts correctly # Check dex2oat timing in logcat Bug: 119800099 Change-Id: I3fc82c9485385ff5e0ccc5031e1141a685ee6c19