summaryrefslogtreecommitdiffstats
path: root/compiler/optimizing
Commit message (Collapse)AuthorAgeFilesLines
* Run a simplification pass before code generation.Nicolas Geoffray2015-06-221-0/+5
| | | | | | | | | | | | The code generators assume things that only the instruction simplier ensures. So it has to be run last in case previous optimiziations broke those assumptions. bug:21865464 (cherry picked from commit b2bdfce7f805b00668a2521b1c939a0aafb2be49) Change-Id: Ibf4384a911e400eb7586bbf6b4edd6351034cbd8
* Merge "Bailout from compilation if an invoke is malformed." into mnc-devNicolas Geoffray2015-06-222-10/+35
|\
| * Bailout from compilation if an invoke is malformed.Nicolas Geoffray2015-06-222-10/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | Because the verifier does not check trivially dead instructions, the compilers must prepare for bogus instructions. This change fixes the case the arguments for an invoke do not match the formal parameters. bug:21865459 (cherry picked from commit 2e33525bd4eb892246b4c244c6d4ebf6c6d07501) Change-Id: I392f86eafefde28263fe35a31f17b398ff8dfc24
* | Merge "Fix wrong DCHECK in bounds check elimination." into mnc-devNicolas Geoffray2015-06-221-1/+3
|\ \
| * | Fix wrong DCHECK in bounds check elimination.Nicolas Geoffray2015-06-221-1/+3
| |/ | | | | | | | | | | | | | | | | | | | | | | The lower range of an array length instruction can be changed by other instructions than HBoundsCheck, like HNewArray. bug:21862741 (cherry picked from commit 8d82a0c2b2b12f259ccb357d3b1e699c68ad0400) Change-Id: I1bb1a4f4c6673509dd3fb5184c32992bed876250
* / Fix a bug in optimizing when the null constant has been DCE.Nicolas Geoffray2015-06-222-2/+5
|/ | | | | | | | | | | | | | If it has been DCE, we should create a new one, instead of using the old one. Also move the first DCE to a place where it could actually be useful. bug:21870788 (cherry picked from commit 18e6873c469b48aaed22148451523479eece98e3) Change-Id: I3b3ab2dafe8ce5fb60868fd1a6ef0eeefe666e0c
* Fix String Change baseline compiler errors.Nicolas Geoffray2015-06-221-2/+3
| | | | | | | | | | | | | The String Change adds multiple move results if the uninitialized string is in multiple registers. This adds StoreLocals on the same instruction, which isn't allowed. Now, a LoadLocal is added for each extra move needed. bug:21902634 (cherry picked from commit aa919207d2fb63af11d72d3b7cdbc435769565af) Change-Id: I057d14cdac437d06eec20caaddd430c304e58196
* ART: Fix BCE lint issueAndreas Gampe2015-06-191-2/+2
| | | | | | | | Bug: 21034044 (cherry picked from commit 45d68f138a31a3ff9b45cda313f0ba27f1431f26) Change-Id: I7f382a3124955eff5c0b96ca39ec67fb658fa3d0
* Remove bogus DCHECK in BCE.Nicolas Geoffray2015-06-191-5/+5
| | | | | | | | | | | | When creating a phi for the array length when we add HDeoptimization nodes, we might update accesses in inner loops to use that phi instead of the array length. The BCE phase was not expecting this case. Bug: 21034044 (cherry picked from commit 3cde6227678cf62e06bca264671d1e957456ac3d) Change-Id: I639f4ea6f5889726142041a42736183f162c7437
* Fix premature deoptimization if the loop body isn't entered.Mingyao Yang2015-06-194-165/+598
| | | | | | | | | | | | | | Add a test between initial_ and end_ to see if the loop body is entered. If the loop body isn't entered at all, we jump to the loop header. Loop header is still executed and is going to test the condition again and loop body won't be entered. This makes sure no deoptimization is triggered if the loop body isn't even entered. Bug: 21034044 (cherry picked from commit 3584bce5b1f45e5741d3a6ca24884a36320ecb6b) Change-Id: I2b6de1f22fbc4568ca419f76382ebd87806d9694
* Merge "ART stack unwinding fixes for libunwind/gdb/lldb." into mnc-devDavid Srbecky2015-06-191-3/+3
|\
| * ART stack unwinding fixes for libunwind/gdb/lldb.David Srbecky2015-06-191-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | ART: Remove old DCHECK that trips BaselineDavid Brazdil2015-06-191-1/+0
| | | | | | | | | | | | | | | | | | | | Codegen verified that the entry block always falls through to the next block. While this is the case with Optimizing, it doesn't hold for Baseline but it doesn't need to since codegen handles it fine. Bug:21913514 Change-Id: I751ef227e6cf103af3e7fc35fca4b01c663385a1 (cherry picked from commit 015c7e63604c038e866d7af3850c557403cddc8b)
* | Fix StringChange for optimizing compiler.Jeff Hao2015-06-182-2/+2
| | | | | | | | | | | | | | Uses optimizing compiler more and fixes x86_64 invoke codegen. Bug: 21902634 Change-Id: Ia2a87d013c4746b107014a04a22a0a37269cfdb2
* | ART: Allow PackedSwitch instructions with zero targetsDavid Brazdil2015-06-181-2/+12
| | | | | | | | | | | | | | | | | | | | | | | | Optimizing and the interpreter wrongly assumed that a PackedSwitch always has at least one target. This patch removes the corresponding DCHECKs and adds a regression test case. This is a resubmission of CL I32b7033ed38de6f1d1a6ee5d5bf12f3a47c9b37e Bug: 21863783 Change-Id: I04e6e124bdd16591ba27c79490e6ce183c36b691 (cherry picked from commit 2ef645ba50544b879a82ea30e606f18c9af98917)
* | Merge "Add support for inlining already sharpened interface calls. DO NOT ↵Nicolas Geoffray2015-06-182-12/+8
|\ \ | | | | | | | | | MERGE ANYWHERE" into mnc-dev
| * | Add support for inlining already sharpened interface calls. DO NOT MERGE ↵Nicolas Geoffray2015-06-182-12/+8
| |/ | | | | | | | | | | | | | | | | | | | | | | | | ANYWHERE bug:21867144 Test had to change a bit because it was using some features from aosp not present in mnc-dev. (cherry picked from commit 3507105caea0d209c66a95d5ec5d739949105c5d) Change-Id: If12ea9a5c64e86b5bd3a5fd4a943bff60fe49762
* / Fix reference comparison after redundant phi elimination.Nicolas Geoffray2015-06-181-17/+23
|/ | | | | | | | | | Otherwise, the graph could remain mistyped. bug:21776173 (cherry picked from commit 51d400d4ebd41b9fb4d67ac3179f8fb66a090fdd) Change-Id: Iff36dfa4e79b14a9dd85c37e0fbb9e1080dd0364
* Merge "Move mirror::ArtMethod to native" into mnc-devMathieu Chartier2015-06-0224-159/+184
|\
| * Move mirror::ArtMethod to nativeMathieu Chartier2015-06-0224-159/+184
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Fix another source of undeterministic inlining.Nicolas Geoffray2015-06-021-2/+0
|/ | | | | | | | | | | | Needing an environment and throwing might depend in which caller first tries to inline. HLoadClass has such logic. Therefore, do not cache the non-inlineable flag for those cases. Does not apply to aosp, as this code has been removed. bug:20037935 Change-Id: I5e3d36ffb832fb3c3f3c604c79cdbf4f37c749e1
* Fix another source of undeterministic inlining.Nicolas Geoffray2015-06-011-1/+3
| | | | | | | | bug:20037935 (cherry picked from commit 5ae1325048f3d2143f62735ed41acebf28ee6742) Change-Id: I4bbec76988cfd3061084055c16d2d9ef46845f0a
* Merge "Make inlining deterministic." into mnc-devNicolas Geoffray2015-06-011-1/+8
|\
| * Make inlining deterministic.Nicolas Geoffray2015-05-261-1/+8
| | | | | | | | | | | | | | | | | | | | | | Only the case where two methods are not in the same dex file could lead to undeterministic behavior. bug:20037935 (cherry picked from commit ff199d84b02efe6cd7162a3c414db99240592454) Change-Id: If1b0bff3a228be4caec9a068210b1d4d2a7bae1f
* | ART: Clean up arm64 kNumberOfXRegisters usage.Vladimir Marko2015-05-265-5/+4
|/ | | | | | | | | | | | | | | | | | | | | 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
* ART: Rediscover loops after deleting blocks in DCEDavid Brazdil2015-05-136-32/+70
| | | | | | | | | The way DCE currently updates loop information does not cover all cases. This patch removes the logic, resets loop information of live blocks to pre-SSA state and reanalyzes the affected loops. Change-Id: I0b996a70235b95a8db0de9a23a03f71db57a21b8 (cherry picked from commit a4b8c21dae70ae34aee13628632c39a675c06022)
* ART: arm indexOf intrinsics for the optimizing compilerAndreas Gampe2015-05-122-4/+173
| | | | | | | | | | | Add intrinsics implementations for indexOf in the optimizing compiler. These are mostly ported from Quick. Bug: 20889065 (cherry picked from commit ba6fdbcb764d5a8972f5ff2d7147e4d78226b347) Change-Id: I18ee849d41187a381f99529669e6f97040aaacf6
* Merge "ART: x86 indexOf intrinsics for the optimizing compiler"Andreas Gampe2015-05-112-25/+313
|\
| * ART: x86 indexOf intrinsics for the optimizing compilerAndreas Gampe2015-05-112-25/+313
| | | | | | | | | | | | | | | | Add intrinsics implementations for indexOf in the optimizing compiler. These are mostly ported from Quick. Add instruction support to assemblers where necessary. Change-Id: Ife90ed0245532a5c436a26fe84715dc357f353c8
* | Merge "[optimizing] Improve 32 bit long shift by 1."Roland Levillain2015-05-112-8/+24
|\ \
| * | [optimizing] Improve 32 bit long shift by 1.Mark Mendell2015-05-112-8/+24
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | Also change FOO << 1 to FOO+FOO in the instruction simplifier. This is an architecture independent simplification, which helps 'long << 1' for 32 bit architectures. Generate an add/adc for long << 1 in x86, in case something is generated after the simplifier. Add test cases for the simplification. Change-Id: I0d512331ef13cc4ccf10c80f11c370a10ed02294 Signed-off-by: Mark Mendell <mark.p.mendell@intel.com>
* | Add a parent environment to HEnvironment.Nicolas Geoffray2015-05-1131-138/+309
| | | | | | | | | | | | | | This code has no functionality change. It adds a placeholder for chaining inlined frames. Change-Id: I5ec57335af76ee406052345b947aad98a6a4423a
* | Merge "[optimizing] Tune some x86_64 moves"Nicolas Geoffray2015-05-093-29/+40
|\ \ | |/ |/|
| * [optimizing] Tune some x86_64 movesMark Mendell2015-05-073-29/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Generate Moves of constant FP values by loading from the constant table. Use 'movl' to load a 64 bit register for positive 32-bit values, saving a byte in the generated code by taking advantage of the implicit zero extension. Change a couple of xorq(reg, reg) to xorl to (potentially) save a byte of code per xor. Change-Id: I5b2a807f0d3b29294fd4e7b8ef6d654491fa0b01 Signed-off-by: Mark Mendell <mark.p.mendell@intel.com>
* | Merge "Skip compilation when falling-through out of method code."Calin Juravle2015-05-083-26/+47
|\ \
| * | Skip compilation when falling-through out of method code.Calin Juravle2015-05-013-26/+47
| | | | | | | | | | | | | | | Bug: 19988134 Change-Id: I68638ce9551848a67af587595f264b51f976df11
* | | Use a growable array instead of an environment during SSA.Nicolas Geoffray2015-05-074-15/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | Using an environment was convenient because it contains a growable array. But there's no need for the environment abstraction when being used as a temporary holder for values of locals. Change-Id: Idf2883fe4b8f97a31ee70b3627c1bdd23ebfff0e
* | | Relax the only one back-edge restriction.Nicolas Geoffray2015-05-0713-154/+226
| |/ |/| | | | | | | | | | | The rule is in the way for better register allocation, as it creates an artificial join point between multiple paths. Change-Id: Ia4392890f95bcea56d143138f28ddce6c572ad58
* | Merge "Revert "Revert "Revert "Revert "[optimizing] Improve x86 shifts"""""Roland Levillain2015-05-052-17/+104
|\ \
| * | Revert "Revert "Revert "Revert "[optimizing] Improve x86 shifts""""Mark P Mendell2015-05-042-17/+104
| | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 2a7a1d7808f003bea908023ebd11eb442d2fca39. Fix the problem that a long long >> 63 got the wrong answer. The problem was that a shr was used instead of a sar. Change-Id: I0327f79c718016ddec9272a605fc50ec15ec4566
* | | Find better split positions in the register allocator.Nicolas Geoffray2015-05-053-7/+68
|/ / | | | | | | | | | | | | | | | | | | | | In a standard if/else control flow graph, this avoids doing a move in one branch if the other branch decided to move an interval. This also needs a new register hint kind, which is what was the location of the interval at the predecessor block. Change-Id: I18b78264587b4d693540fbb5e014d12df2add3e2
* / Update the remaining input index of phis after deleting an input.Nicolas Geoffray2015-05-013-4/+34
|/ | | | | | | bug:20715803 bug:20690906 Change-Id: Iaf08f0c30d629e766be2b04815dc3e38b6e7ff35
* Merge "Revert "GVN final fields even with side effects.""Nicolas Geoffray2015-04-304-35/+24
|\
| * Revert "GVN final fields even with side effects."Nicolas Geoffray2015-04-304-35/+24
| | | | | | | | | | | | This reverts commit 781733632637db98d79dfffad72bf063be3259be. Change-Id: Id7c4591f6b8190921852044b278d11627457c570
* | Merge "GVN final fields even with side effects."Nicolas Geoffray2015-04-304-24/+35
|\|
| * GVN final fields even with side effects.Nicolas Geoffray2015-04-304-24/+35
| | | | | | | | | | | | | | Two accesses of a final field can be GVN'ed even if there are side effects between them. Change-Id: I04495ae83c7858f4216b083ad1c29851954320ad
* | Merge "Add synthesize uses at back edge."Nicolas Geoffray2015-04-294-51/+161
|\ \
| * | Add synthesize uses at back edge.Nicolas Geoffray2015-04-294-51/+161
| | | | | | | | | | | | | | | | | | | | | | | | | | | This reduces the cost of linearizing the graph (hence removing the notion of back edge). Since linear scan allocates/spills registers based on next use, adding a use at a back edge ensures we do count for loop uses. Change-Id: Idaa882cb120edbdd08ca6bff142d326a8245bd14
* | | Merge "ART: Fix loop information after dead code elimination"David Brazdil2015-04-293-7/+28
|\ \ \
| * | | ART: Fix loop information after dead code eliminationDavid Brazdil2015-04-293-7/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Compilation failed when only some blocks of a loop were removed during dead code elimination. Bug: 20680703 Change-Id: If31025169ca493f0d7f7f2788576e98d05f03394