summaryrefslogtreecommitdiff
path: root/runtime/compiler_callbacks.h
AgeCommit message (Collapse)Author
2018-12-06ART: Move to using locks.h instead of mutex.hAndreas Gampe
When only annotating lock requirements, use locks.h. Bug: 119869270 Test: mmma art Change-Id: I1608b03254712feff0072ebad012c3af0cc3dda4
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-03-19Move some remaining dex utilitiesDavid Sehr
There were several utilities related to building/walking/testing dex files that were not in libdexfile. This change consolidates these. Bug: 22322814 Test: make -j 50 test-art-host Change-Id: Id76e9179d03b8ec7d67f7e0f267121f54f0ec2e0
2018-01-19ART: Allow oatstatus verification for app dependenciesAndreas 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
2018-01-05Change ClassStatus to fit into 4 bits.Vladimir Marko
In preparation for extending the type check bit string from 24 to 28 bits, rewrite ClassStatus to fit into 4 bits. Also perform a proper cleanup of the ClassStatus, i.e. change it to an enum class, remove the "Status" word from enumerator names, replace "Max" with "Last" in line with other enumerations and remove aliases from mirror::Class. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Test: Pixel 2 XL boots. Test: testrunner.py --target --optimizing Bug: 64692057 Bug: 65318848 Change-Id: Iec1610ba5dac2c527b36c12819f132e1a77f2d45
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 GetPreviousClassStateAndreas 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 multidexMathieu 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
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-16Collect verifier dependenciesDavid 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_SHAREDAndreas 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 callbacksAndreas 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 annotationsMathieu 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 cleanupAndreas 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 compilerAndreas 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 relocationAlex 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-03-06Enable annotalysis on clang ART builds.Ian Rogers
Fix clang build errors aswell as restructure locking/mutex code for correct thread safety analysis support. Reorder make dependencies so that host builds build first as they should provide better compilation errors than target. Remove host's use of -fno-omit-frame-pointer as it has no value with correct use of CFI, which we should have. Change-Id: I72cea8da9a3757b1a0b3acb4081feccb7c6cef90
2014-03-04Include what is usedKenny Root
If you use it, you should put an #include in it. Change-Id: I8919fe2e48adb7cc19173cc44838547a2015288f
2013-12-17Move compiler code out of method verifier.Vladimir Marko
We want to detect small methods for inlining at the end of the method verification. Instead of adding more compiler code to the runtime, we create a callback from the runtime into the compiler, so that we can keep the code there. Additionally, we move the compiler-related code that was already in the method verifier to the compiler since it doesn't really belong to the runtime in the first place. Change-Id: I708ca13227c809e07917ff3879a89722017e83a9