summaryrefslogtreecommitdiffstats
path: root/compiler
Commit message (Collapse)AuthorAgeFilesLines
* Revert "Revert "Make clang the default compiler on host.""Ian Rogers2014-03-084-8/+12
| | | | | | This reverts commit d54f3a6219bca6ae018f4395fa0f1254bd4459be. Change-Id: Id96bb52a0d599f8848010d1589bdf0f70fc7124b
* Revert "Make clang the default compiler on host."Ian Rogers2014-03-084-12/+8
| | | | | | This reverts commit 87f8b4cf0c1d6aab3eb5d1e99cc4e7cf175ef772. Change-Id: I91a513042f0f9cf66288a296ad4a3b5da7830c7b
* Make clang the default compiler on host.Ian Rogers2014-03-074-8/+12
| | | | | | | | | | | | | Motivation, GCC's compiler warnings are inferior to clang's. -Wthread-safety is not supported by GCC starting with version 4.7. As this change only effects the host, performance issues are an impact on host building and testing alone. Fix clang gtest building on host with BUILD_HOST_64bit. Fix clang build regressions caused by unused fields. Fix x86-64 regression caused by requirement to fire-up quick compiler even in an interpret-only environment. Long-term this code doesn't belong in the quick compiler. Change-Id: Ifc2b10177f40d0724cbbf8dab9653ac03cdd1cee
* Make use of profiling information for dex2oatDave Allison2014-03-077-11/+161
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the profile file exists, the compiler driver will read it and store the data in an internal map. Then, when we want to work out whether to compile a method or not, the map is consulted and if the method shows up with a high enough percentage of use we compile it. The profile file itself is created by installd and is writeable by the app. The file is in /data/dalvik-cache/profiles and is named by the package name. This also modifies the profiler itself to: 1. Only count runnable threads (not suspended threads) in the profile 2. Use system properties to allow tuning of the profile parameters 3. Merge profiles from multiple processes using file locking. Bug: 12877748 Change-Id: Iab2f3a327a2860db2a80d5724277d6c626227f2b Conflicts: compiler/dex/frontend.cc compiler/dex/mir_analysis.cc compiler/dex/verification_results.cc compiler/driver/compiler_driver.cc dex2oat/dex2oat.cc runtime/class_linker.cc runtime/runtime.cc runtime/runtime.h
* Merge "Add more VerifyObject calls."Mathieu Chartier2014-03-077-2/+7
|\
| * Add more VerifyObject calls.Mathieu Chartier2014-03-077-2/+7
| | | | | | | | | | | | | | | | | | | | | | Added verify object calls to SirtRef, IndirectReferenceTable, ReferenceTable. Removed un-needed verify object in ScopedObjectAccess / DecodeJObject since object sources are handled. Bug: 12934910 Change-Id: I55a46a8ea61fed2a77526eda27fd2cce97a9b125
* | Fix clang errors in ArenaAllocator.Vladimir Marko2014-03-072-3/+6
| | | | | | | | Change-Id: Ib0fa290fd46ff9288f86cda9be2d1c1faf99b964
* | Use ScopedArenaAllocator for CacheFieldLoweringInfo pass.Vladimir Marko2014-03-072-48/+19
|/ | | | Change-Id: Idcc2edeb865e29b1bc42b108fc58a1f964295317
* Merge "Create a scoped arena allocator and use that for LVN."Vladimir Marko2014-03-0733-188/+827
|\
| * Create a scoped arena allocator and use that for LVN.Vladimir Marko2014-03-0633-188/+827
| | | | | | | | | | | | | | | | | | | | | | | | This saves more than 0.5s of boot.oat compilation time on Nexus 5. TODO: Move other stuff to the scoped allocator. This CL alone increases the peak memory allocation. By reusing the memory for other parts of the compilation we should reduce this overhead. Change-Id: Ifbc00aab4f3afd0000da818dfe68b96713824a08
* | Enable annotalysis on clang ART builds.Ian Rogers2014-03-068-18/+17
| | | | | | | | | | | | | | | | | | | | | | 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
* | Merge "Make heap reference poisoning work with the interpreter."Hiroshi Yamauchi2014-03-063-0/+9
|\ \ | |/ |/|
| * Make heap reference poisoning work with the interpreter.Hiroshi Yamauchi2014-03-053-0/+9
| | | | | | | | | | | | | | It is disabled by default. Bug: 12687968 Change-Id: Iee0cad647f341a7b566f4cf74c2770d1c19312c9
* | Fix host architecture for 64bit.Ian Rogers2014-03-066-9/+49
| | | | | | | | | | | | | | | | Also, hack x86 assembler for use as a x86-64 trampoline compiler's assembler. Implement missing x86-64 quick resolution trampoline. Add x86-64 to the quick elf writer. Change-Id: I08216c67014a83492ada12898ab8000218ba7bb4
* | Generic JNI implementation for x86_64Andreas Gampe2014-03-053-20/+38
| | | | | | | | | | | | | | | | Starting implementation for generic JNI on x86_64. Frames are of large static size (>4K) right now, should be compacted later. Passes the whole of jni_compiler_test. Change-Id: I88ac3e13a534afe7568d62a1ef97cb766e8260e4
* | Merge "Revert "Revert "Avoid compiling monster methods in boot image"""Brian Carlstrom2014-03-061-5/+7
|\ \ | |/ |/|
| * Revert "Revert "Avoid compiling monster methods in boot image""Brian Carlstrom2014-03-051-5/+7
| | | | | | | | | | | | | | | | This reverts commit f679fab9be8905505d26a62bea257641f0bb0168. (cherry picked from commit 9d0bdfe63bec5a43d7668d9094a52caf77b6ed53) Change-Id: I72af1d44483edbd2a5f2e6b678e43f740d4613fd
* | Merge "Fix valgrind gtests and memory leaks."Mathieu Chartier2014-03-052-2/+3
|\ \
| * | Fix valgrind gtests and memory leaks.Mathieu Chartier2014-03-052-2/+3
| | | | | | | | | | | | | | | | | | | | | All tests pass other than image_test which passes if some bad reads are disabled (buzbee working on this). Change-Id: Ifd6b6e3aed0bc867703b6e818353a9f296609422
* | | Merge "Fix read of uninitialized memory in InlineIndexOf"buzbee2014-03-052-2/+3
|\ \ \
| * | | Fix read of uninitialized memory in InlineIndexOfbuzbee2014-03-052-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The are two flavors of IndexOf that we treat as an intrinsic: a zero-based verion with 2 args and a 3-arg version that also takes a start position. The same code is used for both, but Valgrind reminded us that we shouldn't try loading a RegLocation for the non-extent 3rd arg in the 2 argument version. We got lucky in that the bug was benign - the generated code would still be correct. Change-Id: I0bc7798c8034d35007ffe6d6d62f9ceb91fc44fd
* | | | AArch64: Add ARM64 AssemblerSerban Constantinescu2014-03-0510-5/+1904
| |/ / |/| | | | | | | | | | | | | | | | | | | | | | | This patch adds the ARM64 Assembler and ManagedRegister backend. The implementation of the Arm64Assembler class is based on VIXL (a programmatic A64 Assembler - see external/vixl ). Change-Id: I842fd574637a953c19631eedf26f6c70d9ed7f9e Signed-off-by: Serban Constantinescu <serban.constantinescu@arm.com>
* | | Merge "Fix portable build."Nicolas Geoffray2014-03-052-11/+11
|\ \ \
| * | | Fix portable build.Nicolas Geoffray2014-03-032-11/+11
| | | | | | | | | | | | | | | | Change-Id: I84f223c6629eaf567ef33cd616dbaf04af7ed0b3
* | | | Merge "Add codegen support to the optimizing compiler."Nicolas Geoffray2014-03-0512-8/+558
|\ \ \ \ | |_|_|/ |/| | |
| * | | Add codegen support to the optimizing compiler.Nicolas Geoffray2014-03-0412-8/+558
| | | | | | | | | | | | | | | | Change-Id: I9aae76908ff1d6e64fb71a6718fc1426b67a5c28
* | | | Reuse NoopCompilerCallbacks in oatdumpBrian Carlstrom2014-03-041-5/+5
| | | | | | | | | | | | | | | | Change-Id: Icb4d3941196c1a236f0184fe4d0b7f5838bc13bd
* | | | Support compiler filters for boot classpathBrian Carlstrom2014-03-042-16/+13
| |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | image_writer.cc Remove assumption that all methods in the boot classpath are compiled oat_writer.cc Don't skip writing ArtMethod::quick_code_offset_ for methods that need resolution, leave that to ImageWriter dex2oat.cc Allow dex2dex compilation of image dex files by making the in memory pages writable in all cases, not just app case. oatdump.cc dump new OatHeader fields use ImageSpace.GetImageFilename, not command line image filename, since location may be in dalvik-cache remove inaccurate check about non-null GC map quick_trampoline_entrypoints.cc add and improve some DCHECKS that were useful while debugging class_linker.cc image_space.cc fix double facepalm parsed_options.cc fix zygote logging to not skip values to two part options like -classpath <foo> runtime.cc wireup parsed compiler options to runtime Change-Id: Iad314df0b80623c0663d61713d5098297ab9ac87
* | | Merge "Remove oat file location in the image."Nicolas Geoffray2014-03-042-4/+4
|\ \ \
| * | | Remove oat file location in the image.Nicolas Geoffray2014-03-042-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The oat file is now always in the same directory, and has the same name as the image file. Only difference is the extension. This also removes the need for host-prefix. Change-Id: I16d1f7aeb1d58372d41921694664e9c321afc1ad
* | | | Rewrite kMirOpSelect for all IF_ccZ opcodes.Vladimir Marko2014-03-046-56/+84
|/ / / | | | | | | | | | | | | | | | Also improve special cases for ARM and add tests. Change-Id: I06f575b9c7b547dbc431dbfadf2b927151fe16b9
* | | Merge "Remove unreachable catch entries in GenSpecialCase()."Vladimir Marko2014-03-041-0/+5
|\ \ \
| * | | Remove unreachable catch entries in GenSpecialCase().Vladimir Marko2014-02-281-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix debug build CHECK failure when we generate special method implementation and drop unreachable catch handlers. Bug: 13164331 Change-Id: I00e9841a2db8acaf1e81e1d9702e155c5b7e72e2
* | | | Initial changes towards Generic JNI optionAndreas Gampe2014-03-0311-23/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some initial changes that lead to an UNIMPLEMENTED. Works by not compiling for JNI right now and tracking native methods which have neither quick nor portable code. Uses new trampoline. Change-Id: I5448654044eb2717752fd7359f4ef8bd5c17be6e
* | | | Revert "Revert "Rework Quick compiler's register handling""Bill Buzbee2014-03-0329-981/+1125
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 86ec520fc8b696ed6f164d7b756009ecd6e4aace. Ready. Fixed the original type, plus some mechanical changes for rebasing. Still needs additional testing, but the problem with the original CL appears to have been a typo in the definition of the x86 double return template RegLocation. Change-Id: I828c721f91d9b2546ef008c6ea81f40756305891
* | | | Merge "Incorrect result of the "mul-long by 1" operation"Bill Buzbee2014-03-032-1/+2
|\ \ \ \
| * | | | Incorrect result of the "mul-long by 1" operationAlexei Zavjalov2014-02-262-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ART handles "mul-long by 1" as a special case and try to alloc a new pair of regs through the EvalLocWide method and then put there the multiplicand through the StoreValueWide method. But in case when both multiplicand and multiplier are constants, it will not place correct values in a new reg pair and result of calculations will be incorrect. The new solution uses the only StoreValueWide method. Change-Id: I3d6947737c92c5a12f2840003b17a427e31d288f Signed-off-by: Alexei Zavjalov <alexei.zavjalov@intel.com>
* | | | | Fix 64-bit build DCHECK failure in mir_fieldinfo.cc .Vladimir Marko2014-03-031-1/+4
| | | | | | | | | | | | | | | | | | | | Change-Id: I6021862b42358d4d1bfb8059470da08117a34336
* | | | | Cache field lowering info in mir_graph.Vladimir Marko2014-03-0319-279/+983
| |_|_|/ |/| | | | | | | | | | | Change-Id: I9f9d76e3ae6c31e88bdf3f59820d31a625da020f
* | | | Merge "Remove non-existent ARM insn kThumb2SubsRRI12."Vladimir Marko2014-03-035-14/+13
|\ \ \ \
| * | | | Remove non-existent ARM insn kThumb2SubsRRI12.Vladimir Marko2014-02-285-14/+13
| | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | For kOpSub/kOpAdd, prefer modified immediate encodings because they set flags. Change-Id: I41dcd2d43ba1e62120c99eaf9106edc61c41e157
* | | | Tell GDB about Quick ART generated codeMark Mendell2014-03-0216-18/+659
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is actually a lot of work. To do this, we need: .debug_info .debug_abbrev .debug_frame .debug_str These are generated into the OAT file by OatWriter and ElfWriterQuick. Since the Quick ART runtime doesn't use dlopen to load the OAT files, GDB can't find this information. Use the alternate GDB JIT interface, which can be invoked at runtime. To use this interface, an ELF image needs to be built in memory. Read the information from the OAT file, fixup the addresses to point to the real locations, add a symbol table to hold the .text symbol, and then let GDB know about the information, which will be read from the runtime address space. This is quite primitive now, and could be cleaned up considerably. It probably needs symbol table entries for the methods, and descriptions of parameters and return types. Currently only supported for X86. This defaults to enabled for debug builds. Added dexoat --gen-gdb-info and --no-gen-gdb-info flags to override. Change-Id: I4d18b2370f6dfaa00c8cc1925f10717be3bd1a62 Signed-off-by: Mark Mendell <mark.p.mendell@intel.com>
* | | | Make out arguments non-reference types.Ian Rogers2014-03-0121-264/+262
| | | | | | | | | | | | | | | | | | | | | | | | Also, tidy some portable related code. Change-Id: I67c8aa52eef8b556ca117ecda1b1e75465ba06a5
* | | | Fix clang to compile and run host tests.Ian Rogers2014-02-2814-53/+32
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Don't use the computed goto interpreter with clang 3.4 as it causes compilation to hang. Avoid inclusion of LLVM_(HOST|DEVICE)_BUILD_MK except for with portable as it sets clang incompatible cflags. Most fixes are self-evident, for the quick dex file method inliner the enums were being used with ostreams, so fix the enums and operator out python script to allow this. Note this change effects portable but this is untestable as portable was broken by ELF file and mc linker changes. Change-Id: Ia54348f6b1bd3f76d3b71c6e8c5f97626386b903
* | | Workaround for range ops spanning vreg gapbuzbee2014-02-273-1/+27
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Dalvik runtime model includes two stacks: an interpreted stack holding the Dalvik virtual registers, and a native stack used by the runtime system itself. The interpreted stack closely follows the Dalvik byte-code frame layout and invoke model, in which a callee's incoming argument are physically located in the out region of the caller's frame. Further, the non-argument vregs of a method are contiguous with its in argument region. The Art runtime model retains the notion of a callee's incoming arguments being physically located in the out region of a caller's frame. However, because Art uses a single-stack model, a method's incoming argument region is not contiguous with its non-argument virtual register storage. There is a gap between them that is used to store the native return PC of the caller, as well as the callee save register spill region. The Dalvik's bytecode instruction set includes several "range" format instructions (invoke-static-range, fill-array-data-range, etc.). These instructions define a contiguous range of virtual registers as arguments. Given the current Dalvik bytecode definition, there is no rule preventing an operand range from spanning the incoming argument and normal vregs. In Dalvik, this would not have been an issue. In Art, it adds complexity to correctly copy a range of arguments with a potential gap somewhere in the middle. We don't believe this is a common situation. This workaround CL ensures correct behavior by detecting the spanning case and falling back to the interpreter. If it turns out this is a more common case than expected, compiler support can be added. More likely, though, is that we will disallow spanning ranges in a future revision of the bytecode (going forward, existing range-spanning bytecode will continue to be supported). Fix for internal tracking bug 13216301 Fix for external bug https://code.google.com/p/android/issues/detail?id=66371 Change-Id: I9562aa5ab0aae8ebf333c8b72caac8a1be33ab3c
* | Merge "Move arena_bit_vector.h/cc to compiler/utils."Nicolas Geoffray2014-02-2710-75/+125
|\ \
| * | Move arena_bit_vector.h/cc to compiler/utils.Nicolas Geoffray2014-02-2610-75/+125
| | | | | | | | | | | | | | | | | | | | | Also move MIR's BasicBlock related code from arena_bit_vector.h to bit_vector_block_iterator.cc. Change-Id: I85c224b387d31cf57a1ef1f1a36eaadf22f1c85d
* | | art: Fix build errors for x86_64 targetDmitry Petrochenko2014-02-271-1/+1
| | | | | | | | | | | | | | | | | | | | | Fixes build issues introduced by multilib, CompilerOptions and ElfFile patches. Change-Id: Ic05d149e3c7a1e644d0cb50cc7c3599025c90bdf Signed-off-by: Dmitry Petrochenko <dmitry.petrochenko@intel.com>
* | | Split up CommonTest into CommonRuntimeTest and CommonCompilerTestBrian Carlstrom2014-02-2614-436/+451
| | | | | | | | | | | | Change-Id: I8dcf6b29a5aecd445f1a3ddb06386cf81dbc9c70
* | | Merge "(Experimental) Add Brooks pointers."Hiroshi Yamauchi2014-02-261-0/+6
|\ \ \