summaryrefslogtreecommitdiffstats
path: root/compiler/optimizing/builder.h
Commit message (Collapse)AuthorAgeFilesLines
* MIPS: Initial version of optimizing compiler for MIPS64R6.Roland Levillain2015-06-261-1/+4
| | | | | | | | | | (cherry picked from commit 4dda3376b71209fae07f5c3c8ac3eb4b54207aa8) (amended for mnc-dev) Bug: 21555893 Change-Id: I874dc356eee6ab061a32f8f3df5f8ac3a4ab7dcf Signed-off-by: Alexey Frunze <Alexey.Frunze@imgtec.com> Signed-off-by: Douglas Leung <douglas.leung@imgtec.com>
* Use compiling class instead of referrer for access checks.Nicolas Geoffray2015-06-221-0/+4
| | | | | | | | bug:21869670 (cherry picked from commit 30451743493bc2f589e96d68ab98f557461f97f9) Change-Id: Ia18986797d166470801e7a9a690c054d2dc57952
* Skip compilation when falling-through out of method code.Calin Juravle2015-05-011-1/+4
| | | | | Bug: 19988134 Change-Id: I68638ce9551848a67af587595f264b51f976df11
* ART: Same skip-compilation heuristic in both backendsDavid Brazdil2015-03-311-5/+1
| | | | | | | | | When deciding if a method should be compiled, Optimizing counts the DEX instructions while Quick approximates this figure as the size of the CodeItem. This patch modifies Optimizing to use the same logic so that the two backends reject the same set of methods. Change-Id: Icb12bf2977f948198df08d59f243532ec8c61783
* ART: Force constants into the entry blockDavid Brazdil2015-03-261-2/+0
| | | | | | | | | | | | | | | | | | Optimizations such as GVN and BCE make the assumption that all constants are located in the entry block of the CFG, but not all passes adhere to this rule. This patch makes constructors of constants private and only accessible to friend classes - HGraph for int/long constants and SsaBuilder for float/double - which ensure that they are placed correctly and not duplicated. Note that the ArenaAllocatorAdapter was modified to not increment the ArenaAllocator's internal reference counter in order to allow for use of ArenaSafeMap inside an arena-allocated objects. Because their destructor is not called, the counter does not get decremented. Change-Id: I36a4fa29ae34fb905cdefd482ccbf386cff14166
* Revert "Revert "Inline across dex files.""Nicolas Geoffray2015-03-251-6/+3
| | | | | | This reverts commit 6a816cf624ba56bf2872916d7b65b18fd9a411ef. Change-Id: I36cb524108786dd7996f2aea0443675be1f1b859
* ART: Boolean simplifierDavid Brazdil2015-03-241-9/+0
| | | | | | | | | | | | | The optimization recognizes the negation pattern generated by 'javac' and replaces it with a single condition. To this end, boolean values are now consistently assumed to be represented by an integer. This is a first optimization which deletes blocks from the HGraph and does so by replacing the corresponding entries with null. Hence, existing code can continue indexing the list of blocks with the block ID, but must check for null when iterating over the list. Change-Id: I7779da69cfa925c6521938ad0bcc11bc52335583
* ART: Add -WunusedAndreas Gampe2015-02-241-0/+2
| | | | | | | Until the global CFLAGS are fixed, add Wunused. Fix declarations in the optimizing compiler. Change-Id: Ic4553f08e809dc54f3d82af57ac592622c98e000
* 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
* Create HGraph outside Builder, print timingsDavid Brazdil2015-02-041-12/+12
| | | | | | | | | This patch refactors the way HGraph objects are created, moving the instantiation out of the Builder class and creating the CodeGenerator earlier. The patch uses this to build a single interface for printing timings info and dumping the CFG. Change-Id: I2eb63eabf28e2d0f5cdc7affaa690c3a4b1bdd21
* No SuspendChecks when branching to return blockDavid Brazdil2015-02-021-1/+1
| | | | | | | | | | | | The return basic block is usually placed at the beginning of the DEX file, making the branches to it back edges where the Optimizing's graph builder places SuspendCheck instructions, only to be removed later by the instruction_simplifier pass. Since huge auto-generated methods tend to contain hundreds/thousands of these, this patch recognizes the pattern and prevents builder from generating the redundant check in the first place. Change-Id: I065a3c2f71964b8fc2e53dc20730ba42938b78a1
* Use the non access check entrypoint when possible.Nicolas Geoffray2015-01-301-0/+1
| | | | Change-Id: I0b53d63141395e26816d5d2ce3fa6a297bb39b54
* Inlining support in optimizing.Nicolas Geoffray2014-12-151-1/+24
| | | | | | | | | | Currently only inlines simple things that don't require an environment, such as: - Returning a constant. - Returning a parameter. - Returning an arithmetic operation. Change-Id: Ie844950cb44f69e104774a3cf7a8dea66bc85661
* Add more compilation stats to optimizingCalin Juravle2014-12-101-5/+17
| | | | | | | | | Optimizing is getting closer to have full coverage and this provides a nice overview on why certain methods are not compiled/optimized. Also, clean up some of the builder methods. Change-Id: Id2f31441a788b797b0efea7ec78bee27bb654186
* ART: Add SparseSwitch support to the optimizing compilerAndreas Gampe2014-12-041-2/+10
| | | | | | | | | | Add simple sparse-switch support through chained IFs. Refactor a bit to better reuse code between switch types. Now enables compiled versions of 015-switch and 095-switch-MAX_INT. Bug: 18410979 Change-Id: Ib617e4b877f0b7fbc3bb289800f612f013480713
* Merge "ART: Add PackedSwitch support to the optimizing compiler"Andreas Gampe2014-12-041-0/+4
|\
| * ART: Add PackedSwitch support to the optimizing compilerAndreas Gampe2014-12-041-0/+4
| | | | | | | | | | | | | | Add simple packed-switch support through chained IFs. Now enables compiled versions of 015-switch and 095-switch-MAX_INT. Change-Id: I17cc8d659d1dd2d64227851c23998c04367e8cf5
* | Add support for float-to-long in the optimizing compiler.Roland Levillain2014-12-041-1/+2
|/ | | | | | | | | | | | | | | | | - Add support for the float-to-long Dex instruction in the optimizing compiler. - Add a Dex PC field to art::HTypeConversion to allow the x86 and ARM code generators to produce runtime calls. - Instruct art::CodeGenerator::RecordPcInfo not to record PC information for HTypeConversion instructions. - Add S0 to the list of ARM FPU parameter registers. - Have art::x86_64::X86_64Assembler::cvttss2si work with 64-bit operands. - Generate x86, x86-64 and ARM (but not ARM64) code for float to long HTypeConversion nodes. - Add related tests to test/422-type-conversion. Change-Id: I954214f0d537187883f83f7a83a1bb2dd8a21fd4
* Add some heursitics for compiling, close to Quick's.Nicolas Geoffray2014-12-021-1/+7
| | | | | | | Quick has more machinery to give up/not give up, but we can backport them later. Change-Id: I5eb62c664246f4ce46f0400cf24ec34a72afb51e
* [optimizing compiler] Add CMP{L,G}_{FLOAT,DOUBLE}Calin Juravle2014-11-271-0/+2
| | | | | | | | | | Adds: - float comparison for arm, x86, x86_64 backends. - ucomis{s,d} assembly to x86 and x86_64. - vmstat assebmly for thumb2 - new assembly tests Change-Id: Ie3e19d0c08b3b875cd0a4be4ee4e9c8a4a076290
* Revert "[optimizing compiler] Add CMP{L,G}_{FLOAT,DOUBLE}"Calin Juravle2014-11-261-2/+0
| | | | | | | | Fails on arm due to missing vmrs op after vcmp. I revert this instead of pushing the fix because I don't understand yet why it compiles with run-test but not with dex2oat. This reverts commit fd861249f31ab360c12dd1ffb131d50f02b0bfc6. Change-Id: Idc2d30f6a0f39ddd3596aa18a532ae90f8aaf62f
* [optimizing compiler] Add CMP{L,G}_{FLOAT,DOUBLE}Calin Juravle2014-11-261-0/+2
| | | | | | | - adds float comparison for arm, x86, x86_64 backends. - adds ucomis{s,d} assembly to x86 and x86_64. Change-Id: I232d2b6e9ecf373beb5cc63698dd97a658ff9c83
* Revert "[optimizing compiler] Add CMP{L,G}_{FLOAT,DOUBLE}"Nicolas Geoffray2014-11-261-2/+0
| | | | | | | | Fails on x86_64 and target. This reverts commit cea28ec4b9e94ec942899acf1dbf20f8999b36b4. Change-Id: I30c1d188c7ecfe765f137a307022ede84f15482c
* [optimizing compiler] Add CMP{L,G}_{FLOAT,DOUBLE}Calin Juravle2014-11-261-0/+2
| | | | | | | - adds float comparison for arm, x86, x86_64 backends. - adds ucomis{s,d} assembly to x86 and x86_64. Change-Id: Ie91e04bfb402025073054f3803a3a569e4705caa
* [optimizing compiler] Add shiftsCalin Juravle2014-11-241-0/+6
| | | | | | Added SHL, SHR, USHR for arm, x86, x86_64. Change-Id: I971f594e270179457e6958acf1401ff7630df07e
* [optimizing compiler] Add REM_INT, REM_LONGCalin Juravle2014-11-171-6/+7
| | | | | | | - for arm, x86, x86_64 - minor cleanup/fix in div tests Change-Id: I240874010206a5a9b3aaffbc81a885b94c248f93
* [optimizing compiler] Rename dex_offset to dex_pc in the builderCalin Juravle2014-11-131-14/+14
| | | | | | | | | | | The term dex offset comes from Dalvik where these were addresses in memory. Currently these should be dex PCs, namely offsets from the start of code items. Quick lacks this clean up but there's no need to bring over the convention to optimizing. (thanks to irogers for the commit message text) Change-Id: If86c0cf021a06f04a21462053e9d5f31bba7f65d
* [optimizing compiler] Add DIV_LONGCalin Juravle2014-11-121-1/+7
| | | | | | | | - for backends: arm, x86, x86_64 - added cqo, idivq, testq assembly for x64_64 - small cleanups Change-Id: I762ef37880749038ed25d6014370be9a61795200
* Implement checkcast for optimizing.Nicolas Geoffray2014-11-121-0/+8
| | | | | | | | | | | | - Ended up not using HTypeCheck because of how instanceof and checkcast end up having different logic for code generation. - Fix a x86_64 assembler bug triggered by now enabling more methods to be compiled. Difficult to test today without b/18117217. Change-Id: I3022e7ae03befb1d10bea9637ad21fadc430abe0
* Support floats and doubles in fields.Nicolas Geoffray2014-11-071-4/+1
| | | | Change-Id: I19832106633405403f0461b3fe13b268abe39db3
* Fixed BuildCheckedDiv signatureCalin Juravle2014-11-061-1/+1
| | | | | | The second_reg might actually be a constant. Change-Id: I08cecc41e3d65ab73b41eba2aca702dea8e1ed95
* [optimizing compiler] Add DIV_INT_2ADDRCalin Juravle2014-11-061-1/+3
| | | | Change-Id: I38fc7e216f820d8ccc8bbf8b8e7a67b75fb9de87
* [optimizing compiler] Add div-int and exception handling.Calin Juravle2014-11-061-0/+7
| | | | | | | | | | | | - for backends: arm, x86, x86_64 - fixed a register allocator bug: the request for a fixed register for the first input was ignored if the output was kSameAsFirstInput - added divide by zero exception - more tests - shuffle around some code in the builder to reduce the number of lines of code for a single function. Change-Id: Id3a515e02bfbc66cd9d16cb9746f7551bdab3d42
* Support int-to-long conversions in the optimizing compiler.Roland Levillain2014-11-051-0/+4
| | | | | | | | | | | | | | - Add support for the int-to-float Dex instruction in the optimizing compiler. - Add a HTypeConversion node type for control-flow graphs. - Generate x86, x86-64 and ARM (but not ARM64) code for int-to-float HTypeConversion nodes. - Add a 64-bit "Move doubleword to quadword with sign-extension" (MOVSXD) instruction to the x86-64 assembler. - Add related tests to test/422-type-conversion. Change-Id: Ieb8ec5380f9c411857119c79aa8d0728fd10f780
* Add support for static fields in optimizing compiler.Nicolas Geoffray2014-10-291-1/+6
| | | | Change-Id: Id2f010589e2bd6faf42c05bb33abf6816ebe9fa9
* Fix wrong unsigned to signed conversions.Nicolas Geoffray2014-10-231-1/+1
| | | | | | The HIntConstant node takes an int32_t, so we have to keep things signed. Change-Id: Ib3fa50e87f99118d320cbb381f619d5be9287530
* Implement array creation related DEX instructions.Nicolas Geoffray2014-10-221-2/+39
| | | | | | Implement new-array, filled-new-array, and fill-array-data. Change-Id: I405560d66777a57d881e384265322617ac5d3ce3
* Implement int negate instruction in the optimizing compiler.Roland Levillain2014-10-211-0/+3
| | | | | | | | | | - Add support for the neg-int (integer two's complement negate) instruction in the optimizing compiler. - Add a HNeg node type for control-flow graphs and an intermediate HUnaryOperation base class. - Generate ARM, x86 and x86-64 code for integer HNeg nodes. Change-Id: I72fd3e1e5311a75c38a8cb665a9211a20325a42e
* Tidy ELF builder.Ian Rogers2014-10-091-1/+1
| | | | | | | | | Don't do "if (ptr)". Use const. Use DISALLOW_COPY_AND_ASSIGN. Avoid public member variables. Move ValueObject to base and use in ELF builder. Tidy VectorOutputStream to not use non-const reference arguments. Change-Id: I2c727c3fc61769c3726de7cfb68b2d6eb4477e53
* Add support for floats and doubles.Nicolas Geoffray2014-10-071-4/+23
| | | | | | | - Follows Quick conventions. - Currently only works with baseline register allocator. Change-Id: Ie4b8e298f4f5e1cd82364da83e4344d4fc3621a3
* Revert "Revert "Implement suspend checks in new compiler.""Nicolas Geoffray2014-09-161-1/+2
| | | | | | This reverts commit 7e3652c45c30c1f2f840e6088e24e2db716eaea7. Change-Id: Ib489440c34e41cba9e9e297054f9274f6e81a2d8
* Revert "Implement suspend checks in new compiler."Nicolas Geoffray2014-09-151-2/+1
| | | | | | This reverts commit 6fbce029fba3ed5da6c36017754ed408e6bcb632. Change-Id: Ia915c27873b021e658a10212e559095dfc91284e
* Implement suspend checks in new compiler.Nicolas Geoffray2014-09-151-1/+2
| | | | | | | For simplicity, they are currently placed on all (dex-level) back edges, and at method entry. Change-Id: I6e833e244d559dd788c69727e22fe40aff5b3435
* Implement array get and array put in optimizing.Nicolas Geoffray2014-07-281-0/+4
| | | | | | Also fix a couple of assembler/disassembler issues. Change-Id: I705c8572988c1a9c4df3172b304678529636d5f6
* Support fields in optimizing compiler.Nicolas Geoffray2014-07-141-4/+10
| | | | | | | | - Required support for temporaries, to be only used by baseline compiler. - Also fixed a few invalid assumptions around locations and instructions that don't need materialization. These instructions should not have an Out. Change-Id: Idc4a30dd95dd18015137300d36bec55fc024cf62
* Support longs in the register allocator for x86_64.Nicolas Geoffray2014-07-021-6/+3
| | | | Change-Id: I7fb6dfb761bc5cf9e5705682032855a0a70ca867
* Add some more instruction support to optimizing compiler.Dave Allison2014-06-241-8/+6
| | | | | | | | | | | | | | | This adds a few more DEX instructions to the optimizing compiler's builder (constants, moves, if_xx, etc). Also: * Changes the codegen for IF_XX instructions to use a condition rather than comparing a value against 0. * Fixes some instructions in the ARM disassembler. * Fixes PushList and PopList in the thumb2 assembler. * Switches the assembler for the optimizing compiler to thumb2 rather than ARM. Change-Id: Iaafcd02243ccc5b03a054ef7a15285b84c06740f
* Long support in optimizing compiler.Nicolas Geoffray2014-04-161-10/+32
| | | | | | | | | - Add stack locations to the Location class. - Change logic of parameter passing/setup by setting the location of such instructions the ones for the calling convention. Change-Id: I4730ad58732813dcb9c238f44f55dfc0baa18799
* Test control flow instruction with optimizing compiler.Nicolas Geoffray2014-04-081-0/+1
| | | | | | Add support for basic instructions to implement these tests. Change-Id: I3870bf9301599043b3511522bb49dc6364c9b4c0
* Add support for taking parameters in optimizing compiler.Nicolas Geoffray2014-04-071-1/+10
| | | | | | | - Fix stack layout to mimic Quick's. - Implement some sub operations. Change-Id: I8cf75a4d29b662381a64f02c0bc61d859482fc4e