summaryrefslogtreecommitdiff
path: root/compiler/driver
AgeCommit message (Collapse)Author
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 DexToDexCompilerDavid 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 metadataEric 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 orderAlex 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 dex2oatAlex 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 optionsDavid 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
2020-02-07Fix ART code around JIT zygote.Nicolas Geoffray
- The right image location for it now ends with a profile - Add profile locations to image spaces, so the JIT knows what to compile - Remove now deprecated ApexImage related code. Bug:119800099 Test: boots, methods from framework gets compiled by zygote Change-Id: Ie31b62d0a25f1b50e266c1537c43307d7b29e138
2020-01-28Fix name-based detection of JIT-zygote boot image extension.Ulya Trafimovich
ART detects JIT-zygote boot image by the image name. This has been broken since boot image extension has been enabled for JIT-zygote config in CL I5493e575ebf90bad1d5ad2850004d54590bbc079. This CL replaces 'kApexBootImage' with 'kApexBootImageExtension', since the JIT-zygote image is always used with extension. Test: compare boot-framework.art and apex-framework.art, they were identical before this CL, and differ after this CL. Test: JIT-zygote config boots, steps 1-2: 1. Temporarily enable Jit zygote in the product device config (in this case device/google/muskie/aosp_walleye.mk): +# System server should not contain compiled code. +PRODUCT_SYSTEM_SERVER_COMPILER_FILTER := verify + +# Use the apex image for preopting. +DEXPREOPT_USE_APEX_IMAGE := true + +# Have the runtime pick up the apex image. +PRODUCT_PROPERTY_OVERRIDES += \ + dalvik.vm.boot-image=/apex/com.android.art/javalib/apex.art:/system/framework/apex-framework.art 2. Build and flash: $ lunch aosp_walleye-userdebug && m \ && adb reboot bootloader && fastboot flashall -w Change-Id: Ifd3d3c13107c2e4514eed7c4e2b1bbc5a5a12245
2019-07-30Compiler changes for boot image extension.Vladimir Marko
Test: m test-art-host-gtest Test: testrunnner.py --host --optimizing Test: aosp_taimen-userdebug boots. Test: run-gtest.sh Test: testrunner.py --target --optimizing Change-Id: I8e999c96ec908f26d8c529edc9d2a3be49a9379a
2019-07-17Add option for controling app image class initializationMathieu Chartier
The new option is --initialize-app-image-classes. This attempts to initialize app image classes by running the class initializers ahead of time. Will test this through test 660, but there are currently aborts when it's enabled. Test: test-art-host Bug: 70735003 Change-Id: Icc05683b23098a15531097f67aad17144f0badaf
2019-07-03Remove small and tiny method optionsMathieu Chartier
These are unused and nops. Test: test-art-host-gtest Change-Id: I6421387d53ec8692cf420be71ec47e1ef5e61f19
2019-05-23ARM/ARM64: Use trampolines for slow-path entrypoint calls.Vladimir Marko
This reduces the size of the generated code. We do this only for AOT compilation where we get the most benefit. Sizes of aosp_taimen-userdebug prebuilts: - before: arm/boot*.oat: 19624804 arm64/boot*.oat: 23265752 oat/arm64/services.odex: 22417968 - after: arm/boot*.oat: 19460500 (-160KiB) arm64/boot*.oat: 22957928 (-301KiB) oat/arm64/services.odex: 21957864 (-449KiB) Test: m test-art-host-gtest Test: aosp_taimen-userdebug boots. Test: run-gtests.sh Test: testrunner.py --target --optimizing Bug: 12607709 Change-Id: Ie9dbd1ba256173e4e439e8bbb8832a791965cbe6
2019-04-30Make compiling an apex image explicit.Nicolas Geoffray
And when compiling an apex image, discard dex files not present in an apex. Test: m Bug: 119800099 Change-Id: Ie91c5b8d271783f04e4c1501f315a3ec59137475
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
2019-03-05Refactor compiler tests around CompilerDriver.Vladimir Marko
Introduce CommonCompilerDriverTest and inherit that in tests that need to use CompilerDriver. This is in preparation for moving the CompilerDriver to dex2oat/. Test: m test-art-host-gtest Change-Id: I46cf0bc1df4327569eef5526eeab0781473173a1
2019-02-21Merge changes Ifd690cda,I7bcbe947David Brazdil
* changes: Fix vdex fast-verify performance regression Improve `verified`, add `redefined` class status in VerifierDeps
2019-02-20Fix vdex fast-verify performance regressionDavid Brazdil
Recent CL I0d06b82e31088c58d4493723a5435309740f1d0c generalized the fast-verify class redefinition check by checking that all vdex-verified classes resolve to dex files covered by the vdex and are not duplicates of classes in parent class loaders. This introduced a performance and allocated memory regression for dex2oat invoked with compiler-filter=verify(-profile). This patch removes the regression by acquiring a list of classpath dex files from the compiler driver and boot classpath dex files from the class linker, avoiding class resolution altogether. A small performance overhead remains as previously only boot classpath was being searched. Test: run `dex2oat filter=interpret-only; dex2oat filter=verify` compare time and allocated memory numbers before CL and after Change-Id: Ifd690cdafdc99d3eafb9847d67775fc11a5b5023
2019-02-20Improve `verified`, add `redefined` class status in VerifierDepsDavid Brazdil
Changes implementation of `unverified_classes_` in VerifierDeps from std::set<dex::TypeIndex> to `verified_classes_` of type std::vector<bool> indexed by class def indices. This cleans up the implementation and speeds up access during fast-verify. Encoding remains the same - a set of indices of unverified classes - only these are now class def indices. A second bit vector `redefined_classes_` is added, also indexed by class def indices. It records classes that were not verified because they were eclipsed by classes that took precedence during resolution. This allows VerifierDeps::VerifyInternalClasses to succeed when a class redefined now was also redefined when the deps were being created because the class was treated as external and dependencies on it were recorded. Test: m test-art-gtest-verifier_deps_test Change-Id: I7bcbe947c3c74535306e6dbb5b288076f320a7bc
2019-02-20ART: Reduce dependencies on CompilerDriver.Vladimir Marko
Preparation for moving CompilerDriver and other stuff from libart-compiler.so to dex2oat. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Change-Id: Ic221ebca4b8c79dd1549316921ace655f2e3f0fe
2019-02-11Merge changes Id4ffa9f9,I1bb5d05dVladimir Marko
* changes: Replace MergeSets() with std::set::merge(). Replace StringPiece with std::string_view.
2019-02-08Replace MergeSets() with std::set::merge().Vladimir Marko
And clear up ownership of the VerifierDeps being merged by using std::unique_ptr<>. Test: m test-art-host-gtest Test: testrunner.py --host Bug: 123750182 Change-Id: Id4ffa9f9fa1968fa762b9e825f25827240f6d45d
2019-02-07Merge "Generalize vdex class redefinition check"David Brazdil
2019-02-06Generalize vdex class redefinition checkDavid Brazdil
The check introduced in CL If0c56b1970d8ebe701d198ffccec52f586aea9e6 skips fast verification if an apk's class is overshadowed by a class in boot classpath because the vdex dependencies do not contain intra-apk dependencies. However, the change only checks for presence of a duplicate class in the boot classloader, while a duplicate class could be in any of the parent classloaders. Fix this and move the check into VerifierDeps to make it a proper part of the verification process. The CL also refactors VerifierDeps::ValidateDependencies to output an error string for better logging. Bug: 122968669 Test: test/testrunner/testrunner.py -t 719 Test: m test-art-gtest-verifier_deps_test Change-Id: I0d06b82e31088c58d4493723a5435309740f1d0c
2019-02-06Replace StringPiece with std::string_view in HashSet.Vladimir Marko
Update HashSet comment and related code. Also remove dead CompilerOptions declarations with StringPiece parameters. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Bug: 123750182 Change-Id: I4a39d0e8e0392a414129369c5b304ec4813e9ed5
2019-01-31Ensure the correctness of fast verifyCalin Juravle
We cannot guarantee that the resolution recorded in the vdex file is correct when the boot classes are redefined. For example we might be doing only sdk verification and not have the entire context available - as such, if an app redefines a class that is in the boot classpath but not the sdk we might record the wrong resolution. Another example is OTA time, when the boot classpath may change. The CL discards the vdex file when the app redefines classes from boot classpath. Test: test/testrunner/testrunner.py -t 719 Bug: 122968669 Change-Id: If0c56b1970d8ebe701d198ffccec52f586aea9e6
2019-01-17ART: Some more iwyuAndreas Gampe
Bug: 119869270 Test: mmma art Change-Id: Ie67b57c7173986009fdc7b4aa01563846d30f25f
2019-01-02ART: Move dex structs into own headerAndreas Gampe
Separating out the structs from DexFile allows them to be forward- declared, which reduces the need to include the dex_file header. Bug: 119869270 Test: m Change-Id: I32dde5a632884bca7435cd584b4a81883de2e7b4
2018-12-28Merge "ART: Refactor for bugprone-argument-comment"Treehugger Robot
2018-12-27Add dumping for number of classes initializedMathieu Chartier
For --dump-stats, dump how many classes are each status after attempting initialization. Test: <compile_apk> --instruction-set=arm64 --app-image-file=generated.art --dump-stats Sample output: dex2oat I 12-21 19:18:56 58439 58439 compiler_driver.cc:109] 100% of instance fields resolved for 1575 cases dex2oat I 12-21 19:18:56 58439 58439 compiler_driver.cc:109] 1.88679% of check-casts removed based on type information for 53 cases dex2oat I 12-21 19:18:56 58439 58439 compiler_driver.cc:109] 0% of classes with status NotReady for 32155 cases dex2oat I 12-21 19:18:56 58439 58439 compiler_driver.cc:109] 0% of classes with status Retired for 32155 cases dex2oat I 12-21 19:18:56 58439 58439 compiler_driver.cc:109] 0% of classes with status ErrorResolved for 32155 cases dex2oat I 12-21 19:18:56 58439 58439 compiler_driver.cc:109] 0% of classes with status ErrorUnresolved for 32155 cases dex2oat I 12-21 19:18:56 58439 58439 compiler_driver.cc:109] 0% of classes with status Idx for 32155 cases dex2oat I 12-21 19:18:56 58439 58439 compiler_driver.cc:109] 0% of classes with status Loaded for 32155 cases dex2oat I 12-21 19:18:56 58439 58439 compiler_driver.cc:109] 0% of classes with status Resolving for 32155 cases dex2oat I 12-21 19:18:56 58439 58439 compiler_driver.cc:109] 0% of classes with status Resolved for 32155 cases dex2oat I 12-21 19:18:56 58439 58439 compiler_driver.cc:109] 0% of classes with status Verifying for 32155 cases dex2oat I 12-21 19:18:56 58439 58439 compiler_driver.cc:109] 0.0186596% of classes with status RetryVerificationAtRuntime for 32155 cases dex2oat I 12-21 19:18:56 58439 58439 compiler_driver.cc:109] 0% of classes with status VerifyingAtRuntime for 32155 cases dex2oat I 12-21 19:18:56 58439 58439 compiler_driver.cc:109] 28.1916% of classes with status Verified for 32155 cases dex2oat I 12-21 19:18:56 58439 58439 compiler_driver.cc:109] 0% of classes with status SuperclassValidated for 32155 cases dex2oat I 12-21 19:18:56 58439 58439 compiler_driver.cc:109] 0% of classes with status Initializing for 32155 cases dex2oat I 12-21 19:18:56 58439 58439 compiler_driver.cc:109] 71.7898% of classes with status Initialized for 32155 cases Bug: 70735003 Test: test-art-host Change-Id: I57e8a977ee202c0ce85030208caa183344a5567a
2018-12-27ART: Refactor for bugprone-argument-commentAndreas Gampe
Handles compiler. Bug: 116054210 Test: WITH_TIDY=1 mmma art Change-Id: I5cdfe73c31ac39144838a2736146b71de037425e
2018-12-19Remove unresolved classes from image classes.Vladimir Marko
This allows compiling partial boot image, without conscrypt, while using the current image classes in preloaded-classes. Excluding the conscrypt makes the class android.security.net.config.TrustedCertificateStoreAdapter unresolved because it extends the class com.android.org.conscrypt.TrustedCertificateStore . Without pruning, we hit a DCHECK() in ImageWriter, checking that image classes are not erroneous. And we clearly do not want to put erroneous classes in the partial boot image. Test: Build partial boot image without conscrypt. Bug: 119868597 Change-Id: I6017462366a4b9e69abe1fb3d22461cab35f84c5
2018-12-13ART: Rewrite EnsureInitialized hit caseAndreas Gampe
When an initialized class is found during EnsureInitialized, do not check whether verification was attempted and fix up bits. Instead, ensure that all class-loading paths have that done when eventually getting here. Special runtime-constructed classes (primitives, arrays, proxies) need code to do this work. "Normal" classes have the work done during VerifyClass. Leave a DCHECK in as a state check. Protect state transfers with additional checks. This reduces the overhead of the interpreter which cannot elide initialization checks for static accesses. Bug: 115834172 Test: m test-art-host Change-Id: Iacd6652583364509c37eafe81fed1198abb1b71a
2018-12-06Refactor CompilerDriver::CompileAll().Vladimir Marko
Treat verification results and image classes as mutable only in CompilerDriver::PreCompile(), and treat them as immutable during compilation, accessed through the CompilerOptions. This severs the dependency of the inliner on the CompilerDriver. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Change-Id: I594a0213ca6a5003c19b4bd488af98db4358d51d
2018-12-03ART: ARM64: Pass ISA features to VIXL macroassembler.Artem Serov
VIXL macroassembler should be initialized properly to support Armv8.X features in order to emit corresponding instructions. Test: codegen_test.cc, relative_patcher_arm64_test. Test: test-art-host, test-art-target. Change-Id: I2f9e155c28b4d2252a3cfb19717f5d25824d5e11
2018-11-29Add image compressed blocksMathieu Chartier
Add support for splitting the image into a set of solid blocks. Added dex2oat option --max-image-block-size and correspodning image unit test. Motivation: Enable parallel image decompression in the future. Bug: 116052292 Test: test-art-host Change-Id: I37c6c6a43ef94c4a62bf38a0cf51f26ce06347ac
2018-11-21Merge "ART: Add profile-compile-check support"Andreas Gampe
2018-11-19Remove CompiledMethod dependency on CompilerDriver.Vladimir Marko
Test: m test-art-host-gtest Change-Id: Ibee78d5c54d3ff8162258963fde25065b579a000
2018-11-15Rewrite image type in CompilerOptions.Vladimir Marko
Prepare for introduction of boot image extension. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Test: Pixel 2 XL boots. Change-Id: Id007c4aeb4ada84fe65c1148fdf67e8a412e5b74
2018-11-14ART: Rewrite core image detection.Vladimir Marko
Remove unused compiler option `core_image_` and cache the IsCompilingWithCoreImage in the CompilerOptions instead. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Change-Id: Idcf3b6c96dab9a39f823a16778e7698589442cd8
2018-11-08Delete IsClassToCompileMathieu Chartier
Compiled classes filtering is no longer a thing. Bug: 26687569 Bug: 76145463 Test: test-art-host Change-Id: Iaf4b9dcea5d9fe1eae564fbd6d373af2fdc87b14