summaryrefslogtreecommitdiff
path: root/compiler/dex/quick_compiler_callbacks.h
AgeCommit message (Collapse)Author
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
2018-09-28Revert^2 "Load boot image at a random address." Vladimir Marko
This reverts commit f3d077373536c54824e4449759dff2f18369eab3. Fixed Heap constructor to reserve extra space for GSS. Change-Id: I6a65be35f4aa183304db5491da4a4810d8e3b266 Test: m test-art-host-gtest Test: testrunner.py --host --optimizing --relocate --no-relocate Test: Pixel 2 XL boots. Test: m test-art-target-gtest Test: testrunner.py --target --optimizing --relocate --no-relocate Test: art/test/testrunner/run_build_test_target.py -j48 art-gtest-gss-gc-tlab Bug: 77856493
2018-09-27Revert "Load boot image at a random address." Vladimir Marko
This reverts commit 5ad79d85d77a42456728897ac3e2e7d4530e618e. Reason for revert: Breaks GSS garbage collection config. Bug: 77856493 Change-Id: Ifa39966ac2470154f8ba093de4804689d545219b
2018-09-26Load boot image at a random address. Vladimir Marko
And perform in-place fixup of references and pointers. This dirties all the boot image memory loaded by zygote, so there shall be no "shared clean" boot image pages anymore, these shall change to "shared dirty". However, as we're using a profile-based boot image, these pages are presumably used often enough and unlikely to be paged out anyway. The in-place fixup takes around 60-120ms when starting the zygote on aosp_taimen-userdebug. However, an experiment with MAP_POPULATE pushes the raw fixup down to around 12-15ms. If we used compressed images, this would be the actual time for fixup as the data would be already present in memory. If we keep using uncompressed images, we shall need to tune the loading with MAP_POPULATE or MADV_WILLNEED. The -Xrelocate/-Xno-relocate option is re-interpreted from "use patchoat if needed" to "relocate the boot image in memory if possible". We do not allow relocation for the AOT compilation to speed up dex2oat execution and help producing deterministic output. The patchoat tool shall be removed in a follow-up CL. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing --relocate --no-relocate Test: Pixel 2 XL boots. Test: m test-art-target-gtest Test: testrunner.py --target --optimizing --relocate --no-relocate Bug: 77856493 Change-Id: I2db1fabefb5d4b85c798cd51e04c78cb232bff4a
2018-08-28Use 'final' and 'override' specifiers directly in ART. Roland Levillain
Remove all uses of macros 'FINAL' and 'OVERRIDE' and replace them with 'final' and 'override' specifiers. Remove all definitions of these macros as well, which were located in these files: - libartbase/base/macros.h - test/913-heaps/heaps.cc - test/ti-agent/ti_macros.h ART is now using C++14; the 'final' and 'override' specifiers have been introduced in C++11. Test: mmma art Change-Id: I256c7758155a71a2940ef2574925a44076feeebf
2018-01-19ART: Allow oatstatus verification for app dependencies Andreas Gampe
Allow taking verification state from the oat file durin compilation if the class is a dependency (thus not being compiled itself). This is necessary in case the dependency itself has been quickened and stripped, as quickened bytecodes are not supported during compile- time verification. Expose this through the CompilerCallbacks. Bug: 72237763 Test: m test-art-host Change-Id: I9b7d3a353d81a6422c3b145fd5c5b71f36c6f257
2017-09-15Add support for registering classpath classes status. Nicolas Geoffray
By doing class unloading after each dex file compilation, we are loosing away verification done on classpath classes. This change introduces a new table for keeping around class status of classpath classes. Multidex quickening compilation improved by ~5% by not re-verifying classpath classes. Bug: 63467744 test: test.py test: golem successfully compiles FB Change-Id: I629c0a7d86519bbc516f5e59f7cd92ca6ca842eb
2017-09-05ART: Change CanAssumeVerified to GetPreviousClassState Andreas Gampe
Return any stored class state instead of a bool to allow more recognized states in the future. Bug: 63467744 Bug: 65318848 Test: m test-art-host Change-Id: Id097273a41e09ee77c8d53377ad9beb09104a944
2017-08-09Revert "Revert "Support class unloading in dex2oat for quicken multidex"" Mathieu Chartier
Bug: 63467744 Test: test-art-host This reverts commit 6921d90a241f0307ac25120f8f976744d4a57706. Change-Id: If70e31d3a15579dc75fd40bfef186e0124568c87
2017-08-09Revert "Support class unloading in dex2oat for quicken multidex" Richard Uhler
This reverts commit 0b1c341d2d89a483142cd14bdeb4650ab00184f1. New test Dex2oatDeterminism.UnloadCompile fails on bots gtest-debug-gc and friends. Change-Id: Ib101fc4390d90f88fe017d8482775d5e975f2ccb
2017-08-08Support class unloading in dex2oat for quicken multidex Mathieu Chartier
Support class unloading for the quicken compilation filter. This will be enabled in a follow up CL. Added a test that compares with and without unloading. The way that it tests this is by adding an output app image. Having an app image disables the unloading. This test also covers that app images don't change the odex (currently). Added a test for the assumed verified logic. Bug: 63467744 Test: test-art-host Test: test/testrunner/testrunner.py --interpreter --host -j40 Change-Id: I1e8a862c6f089c06c58aa0c846797e4c24bd072c
2017-07-20Move IsVeryLarge check before we create verification results Mathieu Chartier
Otherwise we can end up creating verification results when they are not actually needed (if the compiler filter was >= quicken). Bug: 63467744 Test: test-art-host Change-Id: Ied2a12e0e4c2010f3f660e278c3a5111545ba251
2017-07-17Avoid creating verification_results_ unnecessarily Mathieu Chartier
For compiler filters that don't quicken or compile, avoid creating the verification results. This avoids creating some arrays that were using a few MB of RAM in some cases. For a large app verify compile: Maximum resident set size (kbytes): 258948 -> 254300 Bug: 63467744 Test: test-art-host Change-Id: I1d0536b2a6a5c301396641371915394cf4c0e5f3
2016-11-03Integrate VerifierDeps in compiler driver. Nicolas Geoffray
If a VerifierDeps is given, try fast verify. Otherwise create a new VerifierDeps and do the full verification. test: test-art-host, verifier_deps_test bug: 30937355 Change-Id: Ifb030d7b5232c95872164f601057a56ab96038e1
2016-09-30Simplify our intrinsic recognizer. Nicolas Geoffray
- Use the modifiers for storing the intrinsic kind. - Delete dex_file_method_inliner and its associated map. This work was also motivated by the fact that the inline method analyzer leaks intrinsic tables, and even worse, might re-use a table from one dex file to another unrelated dex file in the presence of class unloading and the unlikely event of the dex files getting the same address. test: m test-art-host m test-art-target Change-Id: Ia653d2c72df13889dc85dd8c84997582c034ea4b
2016-09-16Collect verifier dependencies David Brazdil
MethodVerifier tests whether a DEX method is valid w.r.t. the classes in class path. Since the APK does not change across OTA updates, it is not necessary to analyze the bytecode again with MethodVerifier, as long as its dependencies on the class path (which may have changed) are satisfied. This patch introduces VerifierDeps, a class path dependency collector, and adds hooks into MethodVerifier where classes/methods/fields are resolved and where assignability of types is tested. Test: m test-art-host-gtest-verifier_deps_test Bug: 30937355 Change-Id: Iee0b321d772a5c7d1cb471aaa6e13918310b7e2f
2016-08-30ART: SHARED_REQUIRES to REQUIRES_SHARED Andreas Gampe
This coincides with the actual attribute name and upstream usage. Preparation for deferring to libbase. Test: m Test: m test-art-host Change-Id: Ia8986b5dfd926ba772bf00b0a35eaf83596d8518
2015-12-09ART: Refactor verifier callbacks Andreas Gampe
Change the return type of MethodVerified to void. It was never used anyways. Remove the callbacks calls from the core of the verifier (Verify()). Instead, make the convenience functions do the work, and add a parameter to supply the callback so that the verifier becomes independent of the Runtime-stored one. Fix up calls that now need to provide a callback, but leave places that only run the verifier to get metadata (e.g., register type data, lock state) without callback. This avoids callback calls when in JIT mode. Bug: 26075442 Change-Id: I2c270f01e4de088771d4d4b19dae4f07d77640f0
2015-07-22Move to newer clang annotations Mathieu Chartier
Also enable -Wthread-safety-negative. Changes: Switch to capabilities and negative capabilities. Future work: Use capabilities to implement uninterruptible annotations to work with AssertNoThreadSuspension. Bug: 20072211 Change-Id: I42fcbe0300d98a831c89d1eff3ecd5a7e99ebf33
2015-03-27ART: Some runtime cleanup Andreas Gampe
Use an enum for the compiler-callback mode. Refactor and remove some unnecessary includes in runtime.h. Change-Id: If2245fa470171311b8e05b677cf6bb28f209585a
2015-03-27ART: PathClassLoader for compiler Andreas Gampe
Use an actual PathClassLoader when compiling apps, instead of a side structure and cutout. This CL sets up a minimal object 'cluster' that recreates the Java side of a regular ClassLoader such that the Class-Linker will recognize it and use the internal native fast-path. This CL removes the now unnecessary compile-time-classpath and replaces it with a single 'compiling-the-boot-image' flag in the compiler callbacks. Note: This functionality is *only* intended for the compiler, as the objects have not been completely initialized. Bug: 19781184 Change-Id: I7f36af12dd7852d21281110a25c119e8c0669c1d
2014-07-22Runtime can now be set to require relocation Alex Light
Add a pair of runtime flags -Xrelocate and -Xnorelocate that can force the runtime to require that all files that are run are relocated, to prevent attacks based on the known art base address. Add support for running patchoat on oat files compiled without an image. Change run-test to have new --prebuild and --relocate flags. Bug: 15358152 Change-Id: I91166c62dd1ab80e5cbcb7883a2cd0d56afca32d
2014-07-15Break apart header files. Ian Rogers
Create libart-gtest for common runtime and compiler gtest routines. Rename CompilerCallbacksImpl that is quick compiler specific. Rename trace clock source constants to not use the overloaded profiler term. Change-Id: I4aac4bdc7e7850c68335f81e59a390133b54e933