summaryrefslogtreecommitdiffstats
path: root/compiler/driver/compiler_driver.h
Commit message (Collapse)AuthorAgeFilesLines
* ART: extensionWei Wang2015-10-061-0/+10
| | | | | | | 1. add hooks for further extension 2. minor code change Change-Id: I2615013b899f5f9b3495546e6001863fb054861a
* ART: Fix reporting initialized classes by CompilerDriver.Vladimir Marko2015-06-181-0/+10
| | | | | | | | | | | | | | | | | Fix a bug where the CompilerDriver was erroneously reporting classes as initialized during AOT compilation when they were not guaranteed to be initialized at runtime. This fix prevents the Quick compiler from inlining calls to static methods in classes that are not guaranteed to be initialized, so that the runtime performs the initialization required for correctness. Bug: 21847756 (cherry picked from commit 07785bb98dc8bbe192970e0f4c2cafd338a8dc68) Change-Id: I60c7361cb6e8f51be20a3cbfcae19f3240bdfbed
* Move mirror::ArtMethod to nativeMathieu Chartier2015-06-021-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-1/+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
* Replace String CharArray with internal uint16_t array.Jeff Hao2015-04-271-0/+3
| | | | | | | | | | | | Summary of high level changes: - Adds compiler inliner support to identify string init methods - Adds compiler support (quick & optimizing) with new invoke code path that calls method off the thread pointer - Adds thread entrypoints for all string init methods - Adds map to verifier to log when receiver of string init has been copied to other registers. used by compiler and interpreter Change-Id: I797b992a8feb566f9ad73060011ab6f51eb7ce01
* Merge "Ensure inlined static calls perform clinit checks in Optimizing."Roland Levillain2015-04-241-0/+39
|\
| * Ensure inlined static calls perform clinit checks in Optimizing.Roland Levillain2015-04-241-0/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Calls to static methods have implicit class initialization (clinit) checks of the method's declaring class in Optimizing. However, when such a static call is inlined, the implicit clinit check vanishes, possibly leading to an incorrect behavior. To ensure that inlining static methods does not change the behavior of a program, add explicit class initialization checks (art::HClinitCheck) as well as load class instructions (art::HLoadClass) as last input of static calls (art::HInvokeStaticOrDirect) in Optimizing' control flow graphs, when the declaring class is reachable and not known to be already initialized. Then when considering the inlining of a static method call, proceed only if the method has no implicit clinit check requirement. The added explicit clinit checks are already removed by the art::PrepareForRegisterAllocation visitor. This CL also extends this visitor to turn explicit clinit checks from static invokes into implicit ones after the inlining step, by removing the added art::HLoadClass nodes mentioned hereinbefore. Change-Id: I9ba452b8bd09ae1fdd9a3797ef556e3e7e19c651
* | Replace NULL with nullptrMathieu Chartier2015-04-221-7/+7
| | | | | | | | | | | | | | Also fixed some lines that were too long, and a few other minor details. Change-Id: I6efba5fb6e03eb5d0a300fddb2a75bf8e2f175cb
* | ART: Add compiled-methodsAndreas Gampe2015-04-211-0/+9
|/ | | | | | | | | | | 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
* Merge "Use --dump-stats to dump optimizing compiler stats."Calin Juravle2015-04-211-0/+4
|\
| * Use --dump-stats to dump optimizing compiler stats.Calin Juravle2015-04-211-0/+4
| | | | | | | | | | | | | | VLOG(compiler) produces too much output and it takes a long time if you only need to see how an analysis performs. Change-Id: Ic17c2b2b5fec431d356cecd37289fb96985d4d7f
* | ART: Change image_classes and compiled_classes to unordered setAndreas Gampe2015-04-201-9/+10
|/ | | | | | | | These lists can be large, and the soon-to-follow compiled_methods will be potentially even larger. Use a hash set instead of a tree set. Change-Id: I7d25c075540f47771354c6f49928b4fd0c76eb2e
* [optimizing] Add memory barriers in constructors when neededCalin Juravle2015-04-201-1/+2
| | | | | | | | | If a class has final fields we must add a memory barrier before returning from constructor. This makes sure the fields are visible to other threads. Bug: 19851497 Change-Id: If8c485092fc512efb9636cd568cb0543fb27688e
* Fallback to quick in case of soft verification errorsCalin Juravle2015-04-161-0/+6
| | | | | | | | | | Add a regression test: using uninitialized values triggers a soft verification error and optimizing should not crash. Thanks to Stephen Kyle (stephenckyle@googlemail.com) for the bug report. Bug: 19988704 Change-Id: I67174538eed853baff735694b3ae8eb34afe2a39
* Merge "Revert "Fallback to quick in case of soft verification errors""Calin Juravle2015-04-131-4/+0
|\
| * Revert "Fallback to quick in case of soft verification errors"Calin Juravle2015-04-131-4/+0
| | | | | | | | | | | | This reverts commit c751d37e692d89b360f3c09421401f581b5c6d06. Change-Id: I2183df8e856410989bc019f6a1f58af37d5d7eab
* | Merge "Fallback to quick in case of soft verification errors"Calin Juravle2015-04-131-0/+4
|\ \ | |/
| * Fallback to quick in case of soft verification errorsCalin Juravle2015-04-101-0/+4
| | | | | | | | | | | | | | | | | | | | | | Add a regression test: using uninitialized values triggers a soft verification error and optimizing should not crash. Thanks to Stephen Kyle (stephenckyle@googlemail.com) for the bug report. Bug: 19988704 Change-Id: I2493f737efd3fad72f6b41fb60eff1d3731613fb
* | Move ArtField to nativeMathieu Chartier2015-04-101-11/+11
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add linear alloc. Moved ArtField to be native object. Changed image writer to put ArtFields after the mirror section. Savings: 2MB on low ram devices 4MB on normal devices Total PSS measurements before (normal N5, 95s after shell start): Image size: 7729152 bytes 23112 kB: .NonMoving 23212 kB: .NonMoving 22868 kB: .NonMoving 23072 kB: .NonMoving 22836 kB: .NonMoving 19618 kB: .Zygote 19850 kB: .Zygote 19623 kB: .Zygote 19924 kB: .Zygote 19612 kB: .Zygote Avg: 42745.4 kB After: Image size: 7462912 bytes 17440 kB: .NonMoving 16776 kB: .NonMoving 16804 kB: .NonMoving 17812 kB: .NonMoving 16820 kB: .NonMoving 18788 kB: .Zygote 18856 kB: .Zygote 19064 kB: .Zygote 18841 kB: .Zygote 18629 kB: .Zygote 3499 kB: .LinearAlloc 3408 kB: .LinearAlloc 3424 kB: .LinearAlloc 3600 kB: .LinearAlloc 3436 kB: .LinearAlloc Avg: 39439.4 kB No reflection performance changes. Bug: 19264997 Bug: 17643507 Change-Id: I10c73a37913332080aeb978c7c94713bdfe4fe1c
* ART: Remove LLVM cruftAndreas Gampe2015-04-071-6/+0
| | | | Change-Id: I133ebed6101bf12a0642ed71e13f332c0c4f14e7
* Prevent verified method from being deleted by compiler driver.Jeff Hao2015-04-061-0/+1
| | | | | | The results of it will be needed by future optimizing compiler changes. Change-Id: Ifbdf47e7564906b74193f80a4ba0459eed87c0f7
* Fixed layout for dex caches in boot image.Vladimir Marko2015-03-311-3/+10
| | | | | | | | | | | | | | | | | | | | | | | | | Define a fixed layout for dex cache arrays (type, method, string and field arrays) for dex caches in the boot image. This gives those arrays fixed offsets from the boot image code and allows PC-relative addressing of their elements. Use the PC-relative load on arm64 for relevant instructions, i.e. invoke-static, invoke-direct, const-string, const-class, check-cast and instance-of. This reduces the arm64 boot.oat on Nexus 9 by 1.1MiB. This CL provides the infrastructure and shows on the arm64 the gains that we can achieve by having fixed dex cache arrays' layout. To fully use this for the boot images, we need to implement the PC-relative addressing for other architectures. To achieve similar gains for apps, we need to move the dex cache arrays to a .bss section of the oat file. These changes will be implemented in subsequent CLs. (Also remove some compiler_driver.h dependencies to reduce incremental build times.) Change-Id: Ib1859fa4452d01d983fd92ae22b611f45a85d69b
* Revert "Revert "Inline across dex files.""Nicolas Geoffray2015-03-251-0/+6
| | | | | | This reverts commit 6a816cf624ba56bf2872916d7b65b18fd9a411ef. Change-Id: I36cb524108786dd7996f2aea0443675be1f1b859
* Add verify-at-runtime compiler filterMathieu Chartier2015-03-201-0/+4
| | | | | | | | | | | | | Verifies at runtime only, instead of at compilation time. AOSP HH boot time after clean-oat: ~30s instead of ~35s if enabled. Also helps install time if enabled there. TODO: See if there is any possible deadlocks that can result from this. Bug: 19762303 Change-Id: Ibfba77148da9039e8d7d7497c05486bc044eefe7
* Trim arenas for JITMathieu Chartier2015-03-091-9/+0
| | | | | | | | | | | | | | | | | | | | | | | 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-0/+6
| | | | | | | Add an option that aborts dex2oat when a hard verifier failure occurs. Bug: 19606409 Change-Id: I53195284e22fe6207274101e85745af763c06271
* Revert "Revert "Add JIT""Mathieu Chartier2015-02-241-3/+39
| | | | | | | | Added missing EntryPointToCodePointer. This reverts commit a5ca888d715cd0c6c421313211caa1928be3e399. Change-Id: Ia74df0ef3a7babbdcb0466fd24da28e304e3f5af
* Revert "Add JIT"Nicolas Geoffray2015-02-241-39/+3
| | | | | | | | | | | | | | | 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-231-3/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Move arenas into runtimeMathieu Chartier2015-02-191-1/+1
| | | | | | | | | | Moved arena pool into the runtime. Motivation: Allow GC to use arena allocators, recycle arena pool for linear alloc. Bug: 19264997 Change-Id: I8ddbb6d55ee923a980b28fb656c758c5d7697c2f
* ART: Some Quick cleanupAndreas Gampe2015-01-261-1/+1
| | | | | | | | | | Make several fields const in CompilationUnit. May benefit some Mir2Lir code that repeats tests, and in general immutability is good. Remove compiler_internals.h and refactor some other headers to reduce overly broad imports (and thus forced recompiles on changes). Change-Id: I898405907c68923581373b5981d8a85d2e5d185a
* ART: Curb dex2oat verbosityAndreas Gampe2015-01-201-1/+1
| | | | | | Only print dedupe collisions in a debug build or on verbose logging. Change-Id: I08bd04a453d95b6dba6cf6955b5741cd97daf480
* ART: dex2oat flag for HGraphVisualizer dump fileDavid Brazdil2015-01-131-0/+6
| | | | | | | | | | This patch adds a new '--dump-cfg=<file>' flag to dex2oat which specifies the file that HGraphVisualizer will store its output into. Until now the graph was dumped to 'art.cfg' in the current working directory. To make Checker work with run-test, the output directory needs to be customizable. Change-Id: I4a940f7708b88deea5a0e51d13aed13e52199349
* Revert "ART: dex2oat flag for HGraphVisualizer dump file"Andreas Gampe2015-01-131-6/+0
| | | | | | | | Breaks compilation of tests. This reverts commit 54953dfdcb3bb8896d8af2d20adef84fb740ce77. Change-Id: I868b876c3130be61f1169c5fccdffc0368bee11e
* ART: dex2oat flag for HGraphVisualizer dump fileDavid Brazdil2015-01-131-0/+6
| | | | | | | | | | This patch adds a new flag to dex2oat which allows to specify the name of the file that HGraphVisualizer will store its output into. Until now the graph was dumped to "art.cfg" in the current working directory. To make Checker work with run-test, the output directory needs to be customizable. Change-Id: I395c518b987e594e89e5e80f202a96befa41ac20
* ART: Swap-space in the compilerAndreas Gampe2014-12-221-42/+100
| | | | | | | | | | | Introduce a swap-space and corresponding allocator to transparently switch native allocations to memory backed by a file. Bug: 18596910 (cherry picked from commit 62746d8d9c4400e4764f162b22bfb1a32be287a9) Change-Id: I131448f3907115054a592af73db86d2b9257ea33
* Remove portable.Elliott Hughes2014-12-121-12/+0
| | | | Change-Id: I3bf3250fa866fd2265f1b115d52fa5dedc48a7fc
* Remove method verification results right after compiling a methodMathieu Chartier2014-12-031-0/+4
| | | | | | | | | | | | | | This saves memory since it allows the code arrays from methods compiled in future methods to use the ram we just freed from the verification results. GmsCore.apk: Before: dex2oat took 77.383s (threads: 2) arena alloc=6MB java alloc=30MB native alloc=77MB free=13KB After: dex2oat took 72.180s (threads: 2) arena alloc=6MB java alloc=30MB native alloc=60MB free=13KB Bug: 18596910 Change-Id: I5d6df380e4fe58751a2b304202083f4d30b33b7c (cherry picked from commit 25fda92083d5b93b38cc1f6b12ac6a44d992d6a4)
* Print memory usage in dex2oat shutdownMathieu Chartier2014-12-021-0/+3
| | | | | | | | | | | Example on mako: I/dex2oat (31071): dex2oat took 31.195s (threads: 2) arena alloc=1013KB java alloc=13MB native alloc=32MB free=1490KB Bug: 18069309 Change-Id: I08eac00842be35d4e659bddc8513f2062be725c9 (cherry picked from commit 3029df6d212894647ba0e5c23443c40912c6ecc8)
* Instruction set features for ARM64, MIPS and X86.Ian Rogers2014-11-131-1/+2
| | | | | | | | | | | | | Also, refactor how feature strings are handled so they are additive or subtractive. Make MIPS have features for FPU 32-bit and MIPS v2. Use in the quick compiler rather than #ifdefs that wouldn't have worked in cross-compilation. Add SIMD features for x86/x86-64 proposed in: https://android-review.googlesource.com/#/c/112370/ Bug: 18056890 Change-Id: Ic88ff84a714926bd277beb74a430c5c7d5ed7666
* ART: Compiled-classes list for compiler-driverAndreas Gampe2014-11-131-1/+11
| | | | | | | | | | | | Similar to the image-classes list, introduce a list of class names that are to be compiled when creating a boot image. This defaults to all classes. Bug: 18336591 (cherry picked from commit 26318f722958ac1cba6a812026a1377f37c54941) Change-Id: I95f69afdb500a9defb6795803d4040bbe67c5a01
* Remove -Wno-unused-parameter and -Wno-sign-promo from base cflags.Ian Rogers2014-11-031-0/+1
| | | | | | | | | | | Fix associated errors about unused paramenters and implict sign conversions. For sign conversion this was largely in the area of enums, so add ostream operators for the effected enums and fix tools/generate-operator-out.py. Tidy arena allocation code and arena allocated data types, rather than fixing new and delete operators. Remove dead code. Change-Id: I5b433e722d2f75baacfacae4d32aef4a828bfe1b
* Add support for static fields in optimizing compiler.Nicolas Geoffray2014-10-291-1/+2
| | | | Change-Id: Id2f010589e2bd6faf42c05bb33abf6816ebe9fa9
* Rewrite class initialization check elimination.Vladimir Marko2014-10-271-7/+17
| | | | | | | | Split the notion of type being in dex cache away from the class being initialized. Include static invokes in the class initialization elimination pass. Change-Id: Ie3760d8fd55b987f9507f32ef51456a57d79e3fb
* C++11 related clean-up of DISALLOW_..Ian Rogers2014-10-221-10/+0
| | | | | | | | | | | | | | | | | | Move DISALLOW_COPY_AND_ASSIGN to delete functions. By no having declarations with no definitions this prompts better warning messages so deal with these by correcting the code. Add a DISALLOW_ALLOCATION and use for ValueObject and mirror::Object. Make X86 assembly operand types ValueObjects to fix compilation errors. Tidy the use of iostream and ostream. Avoid making cutils a dependency via mutex-inl.h for tests that link against libart. Push tracing dependencies into appropriate files and mutex.cc. x86 32-bit host symbols size is increased for libarttest, avoid copying this in run-test 115 by using symlinks and remove this test's higher than normal ulimit. Fix the RunningOnValgrind test in RosAllocSpace to not use GetHeap as it returns NULL when the heap is under construction by Runtime. Change-Id: Ia246f7ac0c11f73072b30d70566a196e9b78472b
* Merge "Some code clean-up."Ian Rogers2014-10-171-1/+1
|\
| * Some code clean-up.Ian Rogers2014-10-161-1/+1
| | | | | | | | Change-Id: I4b745fd5298cd61c793e3b57514b48347bd66c0e
* | Merge "dex2oat: Add a --compile-pic option"Igor Murashkin2014-10-171-3/+4
|\ \ | |/ |/|
| * dex2oat: Add a --compile-pic optionIgor Murashkin2014-10-161-3/+4
| | | | | | | | Change-Id: I80e03613e3b6ac079bcbc7e068bbaae760c364c9
* | Make ART compile with GCC -O0 again.Ian Rogers2014-10-161-3/+3
|/ | | | | | | | | | | | | Tidy up InstructionSetFeatures so that it has a type hierarchy dependent on architecture. Add to instruction_set_test to warn when InstructionSetFeatures don't agree with ones from system properties, AT_HWCAP and /proc/cpuinfo. Clean-up class linker entry point logic to not return entry points but to test whether the passed code is the particular entrypoint. This works around image trampolines that replicate entrypoints. Bug: 17993736 Change-Id: I5f4b49e88c3b02a79f9bee04f83395146ed7be23