summaryrefslogtreecommitdiffstats
path: root/compiler/jit
Commit message (Collapse)AuthorAgeFilesLines
* Parse runtime compiler options for JITMathieu Chartier2015-10-151-1/+32
| | | | | | | | | | | | | | | For the case where the CppDefines do not match the device the JIT is running on. Sample logcat output to prove it works: JIT instruction set variant krait JIT instruction set features default Bug: 24982714 (cherry picked from commit 085fc87e7ea42989a4a00cacb0c9c3a6d2590af6) Change-Id: I1f4991a5d7cdc6101d1b0ecbcb39fb26dd20180a
* Allow for fine tuning the inliner.Calin Juravle2015-07-301-0/+2
| | | | | | | | | | Bug: 21868508 (cherry picked and squashed from commits ec74835a7e4f2660250a2f3f9508cbbe5269e49a and 0941b9d48a9a8c6d80a1af7a0d0fc9f80fe2b9a1) Change-Id: I1750e6bea20321d04680132281a6c2924531c5ae
* ART stack unwinding fixes for libunwind/gdb/lldb.David Srbecky2015-06-191-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | dex2oat can already generate unwinding and symbol information which allows tools to create backtrace of mixed native and Java code. This is a cherry pick from aosp/master which fixes several issues. Most notably: * It enables generation of ELF-64 on 64-bit systems (in dex2oat, C compilers already produce ELF-64). Libunwind requires ELF-64 on 64-bit systems for backtraces to work. * It enables loading of ELF files with dlopen. This is required for libunwind to be able to generate backtrace of current process (i.e. the process requesting backtrace of itself). * It adds unit test to test the above (32 vs 64 bit, in-proces vs out-of-process, application code vs framework code). * Some other fixes or clean-ups which should not be of much significance but which are easier to include to make the important CLs cherry-pick cleanly. This is squash of the following commits from aosp/master: 7381010 ART: CFI Test e1bbed2 ART: Blacklist CFI test for non-compiled run-tests aab9f73 ART: Blacklist CFI test for JIT 4437219 ART: Blacklist CFI test for Heap Poisoning a3a49fe Switch to using ELF-64 for 64-bit architectures. 297ed22 Write 64-bit address in DWARF if we are on 64-bit architecture. 24981a1 Set correct size of PT_PHDR ELF segment. 1a146bf Link .dynamic to .dynstr 67a0653 Make some parts of ELF more (pointer) aligned. f50fa82 Enable 64-bit CFI tests. 49e1fab Use dlopen to load oat files. 5dedb80 Add more logging output for dlopen. aa03870 Find the dlopened file using address rather than file path. 82e73dc Release dummy MemMaps corresponding to dlopen. 5c40961 Test that we can unwind framework code. 020c543 Add more log output to the CFI test. 88da3b0 ART: Fix CFI test wrt/ PIC a70e5b9 CFI test: kill the other process in native code. ad5fa8c Support generation of CFI in .debug_frame format. 90688ae Fix build - large frame size of ElfWriterQuick<ElfTypes>::Write. 97dabb7 Fix build breakage in dwarf_test. 388d286 Generate just single ARM mapping symbol. f898087 Split .oat_patches to multiple sections. 491a7fe Fix build - large frame size of ElfWriterQuick<ElfTypes>::Write (again). 8363c77 Add --generate-debug-info flag and remove the other two flags. 461d72a Generate debug info for core.oat files. Bug: 21924613 Change-Id: I3f944a08dd2ed1df4d8a807da4fee423fdd35eb7
* Add clear cache for JITMathieu Chartier2015-06-021-0/+3
| | | | | | | | (cherry picked from commit 5783a74163878095475596fabc0b9cb04bec467b) Bug: 21572270 Change-Id: I711a9ee2d9688a8e4b59380c401f10f42c6c068e
* Move mirror::ArtMethod to nativeMathieu Chartier2015-06-022-23/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 (cherry picked from commit e401d146407d61eeb99f8d6176b2ac13c4df1e33) Change-Id: I622469a0cfa0e7082a2119f3d6a9491eb61e3f3d Fix some ArtMethod related bugs Added root visiting for runtime methods, not currently required since the GcRoots in these methods are null. Added missing GetInterfaceMethodIfProxy in GetMethodLine, fixes --trace run-tests 005, 044. Fixed optimizing compiler bug where we used a normal stack location instead of double on ARM64, this fixes the debuggable tests. TODO: Fix JDWP tests. Bug: 19264997 Change-Id: I7c55f69c61d1b45351fd0dc7185ffe5efad82bd3 ART: Fix casts for 64-bit pointers on 32-bit compiler. Bug: 19264997 Change-Id: Ief45cdd4bae5a43fc8bfdfa7cf744e2c57529457 Fix JDWP tests after ArtMethod change Fixes Throwable::GetStackDepth for exception event detection after internal stack trace representation change. Adds missing ArtMethod::GetInterfaceMethodIfProxy call in case of proxy method. Bug: 19264997 Change-Id: I363e293796848c3ec491c963813f62d868da44d2 Fix accidental IMT and root marking regression Was always using the conflict trampoline. Also included fix for regression in GC time caused by extra roots. Most of the regression was IMT. Fixed bug in DumpGcPerformanceInfo where we would get SIGABRT due to detached thread. EvaluateAndApplyChanges: From ~2500 -> ~1980 GC time: 8.2s -> 7.2s due to 1s less of MarkConcurrentRoots Bug: 19264997 Change-Id: I4333e80a8268c2ed1284f87f25b9f113d4f2c7e0 Fix bogus image test assert Previously we were comparing the size of the non moving space to size of the image file. Now we properly compare the size of the image space against the size of the image file. Bug: 19264997 Change-Id: I7359f1f73ae3df60c5147245935a24431c04808a [MIPS64] Fix art_quick_invoke_stub argument offsets. ArtMethod reference's size got bigger, so we need to move other args and leave enough space for ArtMethod* and 'this' pointer. This fixes mips64 boot. Bug: 19264997 Change-Id: I47198d5f39a4caab30b3b77479d5eedaad5006ab
* ART: Clean up arm64 kNumberOfXRegisters usage.Vladimir Marko2015-05-261-0/+1
| | | | | | | | | | | | | | | | | | | | | Avoid undefined behavior for arm64 stemming from 1u << 32 in loops with upper bound kNumberOfXRegisters. Create iterators for enumerating bits in an integer either from high to low or from low to high and use them for <arch>Context::FillCalleeSaves() on all architectures. Refactor runtime/utils.{h,cc} by moving all bit-fiddling functions to runtime/base/bit_utils.{h,cc} (together with the new bit iterators) and all time-related functions to runtime/base/time_utils.{h,cc}. Improve test coverage and fix some corner cases for the bit-fiddling functions. Bug: 13925192 (cherry picked from commit 80afd02024d20e60b197d3adfbb43cc303cf29e0) Change-Id: I905257a21de90b5860ebe1e39563758f721eab82
* Add some more DISALLOW_COPY_AND_ASSIGNMathieu Chartier2015-05-041-1/+2
| | | | | | | | May help prevent bugs maybe. (cherry picked from commit 3130cdf29eb203be0c38d1107a65d920ec39c106) Change-Id: Ie73d469dfcd078492ecb3aa28682b42707221202
* Move Class.newInstance to nativeMathieu Chartier2015-04-251-1/+1
| | | | | | | | | | | | | | Avoids 1 allocation and several JNI transitions. Before: Class_classNewInstance: 4462.39 ns; σ=39.42 ns @ 3 trials After: Class_classNewInstance: 1073.39 ns; σ=24.14 ns @ 10 trials Bug: 20269715 Bug: 20566996 Change-Id: Icd52155ce79a978a4d869855bfdfd7735abd8187
* ART: Add compiled-methodsAndreas Gampe2015-04-211-1/+1
| | | | | | | | | | | Add a dex2oat option for compiled-methods, a more granular filter than compiled-classes. Add compiler-driver support for it. Refactor dex2oat to reuse file reading. Add a test to oat_test. Change-Id: I78d0d040bce7738b4bb7aabe7768b5788d2587ac
* ART: Fix wrong parameter in JITAndreas Gampe2015-04-201-1/+1
| | | | | | Do not use an empty set for compiled-classes. Change-Id: I5062a7886c1a4f5dc8dc9630ce490c71bc607b72
* Add --include-cfi compiler option.David Srbecky2015-04-131-0/+1
| | | | | | | | | | | | Decouple generation of CFI from the rest of debug symbols. This makes it possible to generate oat with CFI but without the rest of debug symbols. This is in line with intention of the .eh_frame section. The section does not have the .debug_ prefix because it is considered somewhat different to the rest of debug symbols. Change-Id: I32816ecd4f30ac4e0dc69d69a4993e349c737f96
* Remove the --gen-gdb-info compiler option.David Srbecky2015-04-121-1/+0
| | | | | | It is never used. We generally use --include-debug-symbols instead. Change-Id: I933495cd85ab4f7dfcf3ef3cd2d943d4b870ffeb
* ART: Some runtime cleanupAndreas Gampe2015-03-271-1/+1
| | | | | | | | Use an enum for the compiler-callback mode. Refactor and remove some unnecessary includes in runtime.h. Change-Id: If2245fa470171311b8e05b677cf6bb28f209585a
* ART: PathClassLoader for compilerAndreas Gampe2015-03-271-1/+2
| | | | | | | | | | | | | | | | | | | | 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
* Fix a bug in AddToCodeCacheMathieu Chartier2015-03-231-3/+4
| | | | | | | Was comparing wrong variable to null. Bug: 17950037 Change-Id: I32eb209d378c4818c977c4d1cf63603f7269bd9b
* Add way to print JIT related info at shutdownMathieu Chartier2015-03-091-6/+21
| | | | | | | | | | | | | | | | | | | Added a runtime option called -XX:DumpJITInfoOnShutdown with prints various interesting JIT statistics during the shutdown of the runtime if enabled. Example of running EvaluateAndApplyChanges with the option: I art : Code cache size=427KB data cache size=84KB num methods=1598 I art : Start Dumping histograms for 1598 iterations for JIT timings I art : Compiling: Sum: 727.850ms 99% C.I. 135us-4402us Avg: 455.475us Max: 15567us I art : Verifying: Sum: 191.074ms 99% C.I. 19us-1450.500us Avg: 119.570us Max: 5142us I art : TrimMaps: Sum: 62.053ms 99% C.I. 13us-199.374us Avg: 38.831us Max: 10058us I art : MakeExecutable: Sum: 11.153ms 99% C.I. 4us-47us Avg: 6.979us Max: 47us I art : Initializing: Sum: 7.991ms 99% C.I. 1us-49.781us Avg: 5us Max: 4852us I art : Done Dumping histograms Bug: 17950037 Change-Id: I23538b24f947e5f6934f55579b8baa9d806eb3d5
* Trim arenas for JITMathieu Chartier2015-03-091-2/+4
| | | | | | | | | | | | | | | | | | | | | | | Moved arena pool into the runtime. Added arena trimming to arena pool. When called, this madvises the used memory. Changed the JIT compiler to trim arenas after compilation. Changed the arena mmap name to dalvik-LinearAlloc. Native PSS before: 80353 kB: Native 80775 kB: Native 78116 kB: Native After: 73357 kB: Native 70181 kB: Native 70306 kB: Native Bug: 17950037 Bug: 17643507 Bug: 19264997 Change-Id: I63e7a898fd6e909c2c677fa57b5917a7b1398930
* ART: Add option to abort dex2oat on hard failureAndreas Gampe2015-03-051-1/+2
| | | | | | | Add an option that aborts dex2oat when a hard verifier failure occurs. Bug: 19606409 Change-Id: I53195284e22fe6207274101e85745af763c06271
* ART: Add debuggable compiler flagAndreas Gampe2015-03-041-0/+1
| | | | | | Add a flag to compiler options that shows debuggability. Change-Id: Id17ec72babe2ee88713a0d274eff86508de30666
* Change JIT to not use PICMathieu Chartier2015-02-271-1/+1
| | | | | | | | | | | | | Motivation: PIC is currenly slower and disables a lot of JIT friendly optimizations. EvaluateAndApplyChanges N5 eng interpreter + jit: Before: 2540ms After: 2350ms Bug: 17950037 Change-Id: I3de3e7bcccfc53e49cb78370443c514248ec78d7
* Fix JIT for vmdebug test 99Mathieu Chartier2015-02-251-1/+14
| | | | | | | | Test was flaky due to JIT re-compiliation after deoptimization resulting in some invalid PC offsets. Bug: 17950037 Change-Id: I276c84c918579259ce47ef873892c3c5dcf0c977
* Revert "Revert "Add JIT""Mathieu Chartier2015-02-242-0/+320
| | | | | | | | Added missing EntryPointToCodePointer. This reverts commit a5ca888d715cd0c6c421313211caa1928be3e399. Change-Id: Ia74df0ef3a7babbdcb0466fd24da28e304e3f5af
* Revert "Add JIT"Nicolas Geoffray2015-02-242-320/+0
| | | | | | | | | | | | | | | 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
* Add JITMathieu Chartier2015-02-232-0/+320
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