summaryrefslogtreecommitdiff
path: root/compiler/optimizing/code_generator_arm.cc
AgeCommit message (Collapse)Author
2015-04-29Refactor InvokeDexCallingConventionVisitor in Optimizing.Roland Levillain
Change-Id: I7ede0f59d5109644887bf5d39201d4e1bf043f34
2015-04-28Merge "Have HInvoke instructions know their number of actual arguments."Roland Levillain
2015-04-28Have HInvoke instructions know their number of actual arguments.Roland Levillain
Add an art::HInvoke::GetNumberOfArguments routine so that art::HInvoke and its subclasses can return the number of actual arguments of the called method. Use it in code generators and intrinsics handlers. Consequently, no longer remove a clinit check as last input of a static invoke if it is still present during baseline code generation, but ensure that static invokes have no such check as last input in optimized compilations. Change-Id: Iaf9e07d1057a3b15b83d9638538c02b70211e476
2015-04-27Replace String CharArray with internal uint16_t array.Jeff Hao
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
2015-04-24Fix DCHECKs about clinit checks in Optimizing's code generators.Roland Levillain
These assertions are not true for the baseline compiler. As a temporary workaround, remove a clinit check as last input of a static invoke if it is still present at the stage of code generation. Change-Id: I5655f4a0873e2e7ee7790b6a341c18b4b7b52af1
2015-04-24Merge "Ensure inlined static calls perform clinit checks in Optimizing."Roland Levillain
2015-04-24Ensure inlined static calls perform clinit checks in Optimizing.Roland Levillain
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
2015-04-24Remove ArtMethod* parameter from dex cache entry points.Vladimir Marko
Load the ArtMethod* using an optimized stack walk instead. This reduces the size of the generated code. Three of the entry points are called only from a slow-path and the fourth (InitializeTypeAndVerifyAccess) is rare and already slow enough that the one or two extra loads (depending on whether we already have the ArtMethod* in a register) are insignificant. And as we're starting to use PC-relative addressing of the dex cache arrays (already done by Quick for the boot image), having the ArtMethod* in a register becomes less likely anyway. Change-Id: Ib19b9d204e355e13bf386662a8b158178bf8ad28
2015-04-23Merge "Remove unnecessary null checks in CheckCast and InstanceOf"Calin Juravle
2015-04-23Remove unnecessary null checks in CheckCast and InstanceOfGuillaume "Vermeille" Sanchez
Change-Id: I6fd81cabd8673be360f369e6318df0de8b18b634
2015-04-20Merge "[optimizing] Add memory barriers in constructors when needed"Calin Juravle
2015-04-20[optimizing] Add memory barriers in constructors when neededCalin Juravle
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
2015-04-20Fix lint error.Nicolas Geoffray
Change-Id: Id956c0e8c864a14c05d291f6b890df4877652306
2015-04-20Opt compiler: Correctly require register or FPU register.Alexandre Rames
Also add a check that location summary are correctly typed with the HInstruction. Change-Id: I699762ff4e8f4e321c7db01ea005236ea1934af9
2015-04-16ART: Remove DCHECKs for boolean typeDavid Brazdil
Since bool and int are interchangeable types, checking whether an input is kPrimBoolean can fail when replaced with 0/1 constant or a phi. This patch removes the problematic DCHECKs, adds a best-effort verification into SSAChecker but leaves the phi case empty until a suitable analysis is implemented. Change-Id: I31e8daf27dd33d2fd74049b82bed1cb7c240c8c6
2015-04-15Merge "Type MoveOperands."Nicolas Geoffray
2015-04-15Type MoveOperands.Nicolas Geoffray
The ParallelMoveResolver implementation needs to know if a move is for 64bits or not, to handle swaps correctly. Bug found, and test case courtesy of Serguei I. Katkov. Change-Id: I9a0917a1cfed398c07e57ad6251aea8c9b0b8506
2015-04-15ART: Implement HBooleanNot instructionDavid Brazdil
Optimizations simplifying operations on boolean values (boolean simplifier, instruction simplifier) can benefit from having a special HInstruction for negating booleans in order to perform more transforms and produce faster machine code. This patch implements HBooleanNot as 'x xor 1', assuming that booleans are 1-bit integers and allowing for a single-instruction negation on all supported platforms. Change-Id: I33a2649c1821255b18a86ca68ed16416063c739f
2015-04-13Merge "Whitespace cleanup in DWARFReg helper functions."David Srbecky
2015-04-12Whitespace cleanup in DWARFReg helper functions.David Srbecky
Change-Id: Iedc05969b05be6d93e40467ff23287faaae08fb3
2015-04-12Move 'ret' instruction generation inside GenerateFrameExit.David Srbecky
Change-Id: I0c594d9a2356a006a5ce8dfd41d307cf7c3704ba
2015-04-09Implement CFI for Optimizing.David Srbecky
CFI is necessary for stack unwinding in gdb, lldb, and libunwind. Change-Id: I1a3480e3a4a99f48bf7e6e63c4e83a80cfee40a2
2015-04-06ART: Enable more Clang warningsAndreas Gampe
Change-Id: Ie6aba02f4223b1de02530e1515c63505f37e184c
2015-04-01Revert "Revert "Deoptimization-based bce.""Mingyao Yang
This reverts commit 0ba627337274ccfb8c9cb9bf23fffb1e1b9d1430. Change-Id: I1ca10d15bbb49897a0cf541ab160431ec180a006
2015-03-30ART: Arm32 optimizing compiler backend should honor sdivAndreas Gampe
We still support architectures that do not have sdiv. Issue: https://code.google.com/p/android/issues/detail?id=162257 Change-Id: I6d43620b7599f70a630668791a796a1703b62912
2015-03-27Intrinsify String.compareTo.Nicolas Geoffray
Change-Id: Ia540df98755ac493fe61bd63f0bd94f6d97fbb57
2015-03-25Merge changes I4b3b4d90,I70e0d78f,I2848636fCalin Juravle
* changes: Forbid the use of shifts in ShifterOperand in Thumb2 Make subs and adds alter flags when rn is an immediate Inline long shift code
2015-03-25ART: Formatting and comments in BooleanSimplifierDavid Brazdil
Change-Id: I9a5aa3f2aa8b0a29d7b0f1e5e247397cf8e9e379
2015-03-25Inline long shift codeGuillaume "Vermeille" Sanchez
Change-Id: I2848636f892e276507d04f4313987b9f4c80686b
2015-03-24ART: Boolean simplifierDavid Brazdil
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
2015-03-24Revert "Deoptimization-based bce."Andreas Gampe
This breaks compiling the core image: Error after BCE: art::SSAChecker: Instruction 219 in block 1 does not dominate use 221 in block 1. This reverts commit e295e6ec5beaea31be5d7d3c996cd8cfa2053129. Change-Id: Ieeb48797d451836ed506ccb940872f1443942e4e
2015-03-23Deoptimization-based bce.Mingyao Yang
A mechanism is introduced that a runtime method can be called from code compiled with optimizing compiler to deoptimize into interpreter. This can be used to establish invariants in the managed code If the invariant does not hold at runtime, we will deoptimize and continue execution in the interpreter. This allows to optimize the managed code as if the invariant was proven during compile time. However, the exception will be thrown according to the semantics demanded by the spec. The invariant and optimization included in this patch are based on the length of an array. Given a set of array accesses with constant indices {c1, ..., cn}, we can optimize away all bounds checks iff all 0 <= min(ci) and max(ci) < array-length. The first can be proven statically. The second can be established with a deoptimization-based invariant. This replaces n bounds checks with one invariant check (plus slow-path code). Change-Id: I8c6e34b56c85d25b91074832d13dba1db0a81569
2015-03-17Merge "Revert "Inline long shift code""Calin Juravle
2015-03-17Revert "Inline long shift code"Calin Juravle
This reverts commit 09895ebf2d98783e65930a820e9288703bb1a50b. Change-Id: I7544022d896ef4353bc2cdf4b036403ed20c956d
2015-03-17Merge "Inline long shift code"Calin Juravle
2015-03-17Inline long shift codeGuillaume "Vermeille" Sanchez
Change-Id: I96887c295eb9a23dad4c9cc05d0a0e3ba17f674d
2015-03-17PREOPT compiles using dex2oatd so don't emit debug instructions.Nicolas Geoffray
Change-Id: I8d2ab8d956ad0ce313928918c658d49f490ad081
2015-03-16Update locations of registers after slow paths spilling.Nicolas Geoffray
Change-Id: Id9aafcc13c1a085c17ce65d704c67b73f9de695d
2015-03-13Refactor code in preparation of correct stack maps in slow path.Nicolas Geoffray
Move the logic of saving/restoring live registers in slow path in the SlowPathCode method. Also add a RecordPcInfo helper to SlowPathCode, that will act as the placeholder of saving correct stack maps. Change-Id: I25c2bc7a642ef854bbc8a3eb570e5c8c8d2d030c
2015-03-03Opt compiler: enhance gvn for commutative ops.Mingyao Yang
Change-Id: I415b50d58b30cab4ec38077be22373eb9598ec40
2015-02-24not-int can also take non-int (byte and short) instructions.Nicolas Geoffray
So we should use the result-type instead if the input type for knowning what instruction to use. Bug: 19454010 Change-Id: I88782ad27ae8c8e1b7868afede5057d26f14685a
2015-02-20Improve type propagation with if-contextsCalin Juravle
This works by adding a new instruction (HBoundType) after each `if (a instanceof ClassA) {}` to bound the type that `a` can take in the True- dominated blocks. Change-Id: Iae6a150b353486d4509b0d9b092164675732b90c
2015-02-19Ensure the graph is correctly typed.Nicolas Geoffray
We used to be forgiving because of HIntConstant(0) also being used for null. We now create a special HNullConstant for such uses. Also, we need to run the dead phi elimination twice during ssa building to ensure the correctness. Change-Id: If479efa3680d3358800aebb1cca692fa2d94f6e5
2015-02-13Optimize double/float immediate loading on arm.Nicolas Geoffray
Also reserve a D register for temp. Change-Id: I6584d9005b0f5685c3afcd8e9153b4c87b56aa8e
2015-02-10Merge "Improve ParallelMoveResolver to work with pairs."Nicolas Geoffray
2015-02-10Improve ParallelMoveResolver to work with pairs.Nicolas Geoffray
Change-Id: Ie2a540ffdb78f7f15d69c16a08ca2d3e794f65b9
2015-02-09Merge "ART: Arm intrinsics for Optimizing compiler"Andreas Gampe
2015-02-09ART: Arm intrinsics for Optimizing compilerAndreas Gampe
Add arm32 intrinsics to the optimizing compiler. Change-Id: If4aeedbf560862074d8ee08ca4484b666d6b9bf0
2015-02-06Optimize leaf methods.Nicolas Geoffray
Avoid suspend checks and stack changes when not needed. Change-Id: I0fdb31e8c631e99091b818874a558c9aa04b1628
2015-02-04Finally implement Location::kNoOutputOverlap.Nicolas Geoffray
The [i, i + 1) interval scheme we chose for representing lifetime positions is not optimal for doing this optimization. It however doesn't prevent recognizing a non-split interval during the TryAllocateFreeReg phase, and try to re-use its inputs' registers. Change-Id: I80a2823b0048d3310becfc5f5fb7b1230dfd8201