summaryrefslogtreecommitdiff
path: root/compiler/jit/jit_compiler.h
AgeCommit message (Collapse)Author
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-15Revert "Reland "Run optimizations with baseline compilation."" Nicolas Geoffray
This reverts commit 1a6b5b318aa69903a74dd10312a77bd8ee7c4cf6. Reason for revert: asan failure Change-Id: Ie9da0b04c899d6cb37148e7a3542190e65737787
2024-01-05Reland "Run optimizations with baseline compilation." Nicolas Geoffray
This reverts commit c8309515d099992b7cab8f2b8c6db3ed77671ff4. Bug: 313040662 Reason for revert: remove call to slow path on back edges. Change-Id: I3fe52295afcb0be4b4062f8d9060adb4abb64375
2024-01-04Revert "Run optimizations with baseline compilation." Almaz Mingaleev
This reverts commit 41c5dde40d1c75d36a7f984c8d72ec65fbff3111. Reason for revert: breaks test.java.util.Arrays.Sorting Change-Id: I03385c9f1efff4b8e8bd315827dde6ed774bbb52
2024-01-03Run optimizations with baseline compilation. Nicolas Geoffray
And introduce inlined inline caches, which customize an inline cache for the top-level method being compiled. Reduces jank on compose view scrolling for 20 seconds: - For Go Mokey: - Before: ~525 frames drawn / ~14.64% janky frames - After: ~891 frames drawn / ~4.74% janky frames - For Pixel 8 pro: - Before: ~2443 frames drawn / ~0.91% janky frames - After: ~2447 frames drawn / ~0.65% janky frames Bug: 313040662 Test: test.py Change-Id: Ibaa746c6bd3c665b18ec9cd29cb477cf21023467
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-11Reland^2 "Update instrumentation support for non-java debuggable runtimes" Mythri Alle
This reverts commit 778800e334a3fd0f29dbeabad114032bc849a9d1. Reason for revert: Reland after fixes. Fixes: 1. Update Trace::Start and Trace::Stop to turn on JavaDebuggable, so that necessary support exists for method tracing. Earlier we used to just use interpreter in non-debuggable runtimes. Now we are adding the ability to switch the runtime to debuggable when required. Earlier CL missed updating tracing. 2. Allow installing JITed code with instrumentation support when instrumentation support is required. We disallowed any JITed code for native methods if instrumentation support is needed. 3. Allow loading app images in debuggable runtimes, since we may want to use the AOT code after turning off debuggable. 4. Mark a few tests related to cha (616-cha*) and a test related to dead references (1339-dead-reference-safe) as expected to fail in trace configuration since certain optimizations are disabled in debuggable runtimes. 5. Also temporarily mark 667-jit-jni-stub as expected failure since Jit GC is turned off with tracing. Change-Id: I853113781f1a8c367b01529b8f7337cd2604d4a3 Bug: 206029744
2022-09-14Revert "Reland "Update instrumentation support for non-java debuggable ↵ Mythri Alle
runtimes"" This reverts commit 322ef183e602f304e3d093c083490dd2e766b254. Reason for revert: Failures on art-tracing: https://android-build.googleplex.com/builds/submitted/9062353/art-tracing/latest/view/logs/build_error.log Change-Id: I59f39e2833b63be15e7507a53ddb5ff6a30d55f3
2022-09-07Reland "Update instrumentation support for non-java debuggable runtimes" Mythri Alle
This reverts commit 7cc22bb96e4e05cf63661eed7fd3dda5304bdacc. Reason for revert: Relanding after a fix for jit-on-first-use failures. The fix: 1. When shutting down jvmti agent, pause Jit threads and discard all JITed code. 2. Update the jit compiler options when transitioning the runtime debug state. Change-Id: I076098459cc5639f9e87dae620a9297460e729e2
2021-11-29Handle baseline/optimized compilation kind in the runtime. Nicolas Geoffray
It used to be adjusted in the compiler, but that does not work anymore as the compiler now always requests a baseline compilation to have a profiling info. Test: 457-regs Bug: 146423102 Change-Id: I522bc515ef1c6f8737ada311265a6f8e0f4db3fd
2020-06-18Introduce an enum for the compilation kind. Nicolas Geoffray
Test: test.py Change-Id: I5329e50a6b4521933b6b171c8c0fbc618c3f67cd
2019-08-28JIT mini-debug-info: Support JIT data dual mapping. David Srbecky
Ensure that we can add/remove mini-debug-info if the JIT data is read-only and we need to use the other mapping for writes. Pointers into the read-only memory are marked as "const". Test: "test.py -b --host --jit" with data dual mapping Test: device boots with data dual mapping Bug: 119800099 Change-Id: I9399cffbe5ae13f08f698ab1598c30f13545a767
2019-08-16JIT mini-debug-info: Remove global maps. David Srbecky
Keep the extra bookkeeping information in JITCodeEntry. Also do the compression eagerly during GC rather then lazily. Test: test.py -b --host --jit Bug: 119800099 Change-Id: Ie6cc682033a32c01d4c2cac242d8a4201116f940
2019-08-06Simplify JIT compiler interface usage from the runtime. David Srbecky
Avoid the excessive use of externs and reinterpret_casts. Test: test.py -b --host --64 --jit Change-Id: I179656a3a7c4e59d12c8f6d189c937ce07e0f122
2019-06-10Pass the memory region to allocate into to the compiler / allocation. Nicolas Geoffray
Test: test.py Bug: 119800099 Change-Id: Ie3cba5abe3dd4f8756af5ecfd6c26320de314fe8
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
2018-12-14Revert "Revert "Add a baseline flag to JIT compile."" Nicolas Geoffray
This reverts commit 344b0d18eb9f9f2f2ef704acadc510a6dd56a282. Reason for revert: Not the CL that broke the tests. Change-Id: I38221d1ac723e5ea71cb398401e2fda8dd2d7db9
2018-12-13Revert "Add a baseline flag to JIT compile." Andreas Gampe
This reverts commit e734fe8d4aa5f70a5798363774a4ed63357ebe20. Reason for revert: May be breaking tests. Change-Id: I6c0c04a60c1b4f329c472d28a3c2666526bd6383
2018-12-12Add a baseline flag to JIT compile. Nicolas Geoffray
bug: 111397239 bug: 119800099 Test: m Change-Id: Id831b641e18a8497435839e2fbcfee1f6d60a56d
2018-11-27Revert^2 "Refactor code around JIT creation." Nicolas Geoffray
This reverts commit 763cd98161424cf19af2f113a6802f04860dcd6e. Bug: 119800099 Reason for revert: Updated the DCHECKo take into account current state of zygote not having a thread pool. Change-Id: I1181ff85e7aebd062ee892548b80ab3de06a5ac7
2018-11-26Revert "Refactor code around JIT creation." Andreas Gampe
This reverts commit 7a2c7c2f7062d9fef21b72ff9c10ca8ef863eb8b. Reason for revert: Breaks boot in debug mode Bug: 119800099 Change-Id: I6d015b04c480f76824ead936238cbf49b164b7e3 Test: N/A
2018-11-21Refactor code around JIT creation. Nicolas Geoffray
- Create the JIT early on. - Have dedicated zygote spaces, that get assign after the fork. - Re-parse compiler options after fork to take into account customization of debug flags by the child. Currently, we only create the thread pool in the child, so the zygote isn't jitting yet. Bug: 119800099 Test: test.py, device boots Change-Id: I591ce933ebf54a67937ab1d05206534f55ef2f65
2018-06-25Move instruction_set_ to CompilerOptions. Vladimir Marko
Removes CompilerDriver dependency from ImageWriter and several other classes. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Test: Pixel 2 XL boots. Test: m test-art-target-gtest Test: testrunner.py --target --optimizing Change-Id: I3c5b8ff73732128b9c4fad9405231a216ea72465
2017-11-28Clean some dex2oat options. Nicolas Geoffray
Remove dump-passes inherited from Quick days, and move dump-timings and dump-stats to CompilerStats. Test: test.py Change-Id: Ie79be858a141e59dc0b2a87d8cb5a5248a5bc7af
2017-07-24ART: Include cleanup Andreas Gampe
Let clang-format reorder the header includes. Derived with: * .clang-format: BasedOnStyle: Google IncludeIsMainRegex: '(_test|-inl)?$' * Steps: find . -name '*.cc' -o -name '*.h' | xargs sed -i.bak -e 's/^#include/ #include/' ; git commit -a -m 'ART: Include cleanup' git-clang-format -style=file HEAD^ manual inspection git commit -a --amend Test: mmma art Change-Id: Ia963a8ce3ce5f96b5e78acd587e26908c7a70d02
2016-10-27ART jitted code profiling support. xueliang.zhong
- Generate perf map for method level profiling. - Generate jit dump for instruction level profiling. Command line example of perf map approach: $ perf record dalvikvm -Xcompiler-option -g -cp <classpath> MyClass $ perf report Command line example of perf jit dump approach: $ perf record -k mono dalvikvm -Xcompiler-option -g -cp <classpath> MyClass $ perf inject -i perf.data -o perf.data.jitted $ perf report -i perf.data.jitted $ perf annotate -i perf.data.jitted NOTE: 4.1 or newer kernel is needed for this jit dump analysis. Test: Compile. Test: Verified that perf-PID.map and jit-PID.dump files are only generated when running ART JIT with -g option. Tested on aosp_angler-userdebug and hikey-userdebug devices. The file formats are correct. Change-Id: I1bd3ce280f953811d3dfcc27dc8e59b3e1f481aa
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-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
2016-03-08Propagate InstructionSetFeatures to ElfBuilder. David Srbecky
This is subset of CL171665 and it separates it into two. It will be needed to generate .MIPS.abiflags ELF section. Change-Id: I5557e7cb98d0fa1dc57c85cf6161e119c6d50a1a
2016-03-03Refine statistics around the JIT. Nicolas Geoffray
- Better namings. - Now also time the code cache collection time. - Random cleanups. bug:23128949 bug:27445008 bug:27442890 Change-Id: I1dd52544bea678af868e7c47907f7a0fc9a146c3
2016-02-05Revert "Revert "Implement on-stack replacement for arm/arm64/x86/x86_64."" Nicolas Geoffray
This reverts commit bd89a5c556324062b7d841843b039392e84cfaf4. Change-Id: I08d190431520baa7fcec8fbdb444519f25ac8d44
2016-01-13Support --perf with jitted code. Nicolas Geoffray
Change-Id: I76f29d815234e9506efc59d4865780e52b2381a1
2015-10-26Support garbage collection of JITted code. Nicolas Geoffray
Change-Id: I9afc544460ae4fb31149644b6196ac7f5182c784
2015-10-21Use DlMallocSpace for the JIT code cache. Nicolas Geoffray
- Also tidy up some code in the JIT compiler. - And mprotect code space to be writable only when allocating. Change-Id: I46ea5c029aec489f2af63452de31db3736aebc20
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-05-29Move mirror::ArtMethod to native Mathieu Chartier
Optimizing + quick tests are passing, devices boot. TODO: Test and fix bugs in mips64. Saves 16 bytes per most ArtMethod, 7.5MB reduction in system PSS. Some of the savings are from removal of virtual methods and direct methods object arrays. Bug: 19264997 Change-Id: I622469a0cfa0e7082a2119f3d6a9491eb61e3f3d
2015-05-03Add some more DISALLOW_COPY_AND_ASSIGN Mathieu Chartier
May help prevent bugs maybe. Change-Id: Ie73d469dfcd078492ecb3aa28682b42707221202
2015-02-24Revert "Revert "Add JIT"" Mathieu Chartier
Added missing EntryPointToCodePointer. This reverts commit a5ca888d715cd0c6c421313211caa1928be3e399. Change-Id: Ia74df0ef3a7babbdcb0466fd24da28e304e3f5af
2015-02-24Revert "Add JIT" Nicolas Geoffray
Sorry, run-test crashes on target: 0-05 12:15:51.633 I/DEBUG (27995): Abort message: 'art/runtime/mirror/art_method.cc:349] Check failed: PcIsWithinQuickCode(reinterpret_cast<uintptr_t>(code), pc) java.lang.Throwable java.lang.Throwable.fillInStackTrace() pc=71e3366b code=0x71e3362d size=ad000000' 10-05 12:15:51.633 I/DEBUG (27995): r0 00000000 r1 0000542b r2 00000006 r3 00000000 10-05 12:15:51.633 I/DEBUG (27995): r4 00000006 r5 b6f9addc r6 00000002 r7 0000010c 10-05 12:15:51.633 I/DEBUG (27995): r8 b63fe1e8 r9 be8e1418 sl b6427400 fp b63fcce0 10-05 12:15:51.633 I/DEBUG (27995): ip 0000542b sp be8e1358 lr b6e9a27b pc b6e9c280 cpsr 40070010 10-05 12:15:51.633 I/DEBUG (27995): Bug: 17950037 This reverts commit 2535abe7d1fcdd0e6aca782b1f1932a703ed50a4. Change-Id: I6f88849bc6f2befed0c0aaa0b7b2a08c967a83c3
2015-02-23Add JIT Mathieu Chartier
Currently disabled by default unless -Xjit is passed in. The proposed JIT is a method JIT which works by utilizing interpreter instrumentation to request compilation of hot methods async during runtime. JIT options: -Xjit / -Xnojit -Xjitcodecachesize:N -Xjitthreshold:integervalue The JIT has a shared copy of a compiler driver which is accessed by worker threads to compile individual methods. Added JIT code cache and data cache, currently sized at 2 MB capacity by default. Most apps will only fill a small fraction of this cache however. Added support to the compiler for compiling interpreter quickened byte codes. Added test target ART_TEST_JIT=TRUE and --jit for run-test. TODO: Clean up code cache. Delete compiled methods after they are added to code cache. Add more optimizations related to runtime checks e.g. direct pointers for invokes. Add method recompilation. Move instrumentation to DexFile to improve performance and reduce memory usage. Bug: 17950037 Change-Id: Ifa5b2684a2d5059ec5a5210733900aafa3c51bca