summaryrefslogtreecommitdiff
path: root/compiler/optimizing/optimizing_compiler.cc
Commit message (Collapse)AuthorAgeFilesLines
...
* Revert "Optimizing: Disable -Wframe-larger-than= for CompileOptimized()."Vladimir Marko2015-10-061-4/+2
| | | | | | | | | | | Instead, prevent inlining of AllocateRegisters() that uses huge stack-allocated objects. Bug: 24698147 This reverts commit 67f784e63343db5ecd6e584343484684ea60d1f8. Change-Id: I94c408f7acf6e43897a248d9ea0761b979ed00c8
* Optimizing: Disable -Wframe-larger-than= for CompileOptimized().Vladimir Marko2015-10-061-0/+4
| | | | | Bug: 24698147 Change-Id: I360e9412d85afa83ef2152e4c16bcd3139b34f75
* Don't delegate to Quick anymore.Nicolas Geoffray2015-10-021-18/+2
| | | | Change-Id: I81ffd83daec7be03a796903f40b8bbdcd63c34c7
* Enable compilation of members with access check failures.Calin Juravle2015-10-021-3/+7
| | | | Change-Id: I0de73099b53612072c3e6f1235c22f96339fe440
* Revert "Revert "Enable optimizations with --debuggable.""Nicolas Geoffray2015-09-301-8/+1
| | | | | | This reverts commit b7d27a53cb280a943c0a63a9e0806cf8e3ae4cde. Change-Id: I398c23863e4fd86a3112076417378d22efd08306
* Revert "Enable optimizations with --debuggable."Nicolas Geoffray2015-09-291-1/+8
| | | | | | | | Build error with gcc. This reverts commit 43855ccb01703b188777fe59e1110e6a23803171. Change-Id: I45abc7ee0943b2ad7bd644c88858891fc7a38ead
* Enable optimizations with --debuggable.Nicolas Geoffray2015-09-291-8/+1
| | | | Change-Id: I8979e59ee081222687fda1c93ac0bf3acbbad936
* Support unresolved methods in OptimizingCalin Juravle2015-09-171-2/+10
| | | | Change-Id: If2da02b50d2fa668cd58f134a005f1752e7746b1
* Merge "Add option to append to the cfg dump."Calin Juravle2015-09-161-1/+3
|\
| * Add option to append to the cfg dump.Calin Juravle2015-09-151-1/+3
| | | | | | | | | | | | | | This makes life easier when verifying tests with unresolved classes (which call dex2oat at rutime). Change-Id: I7985b2b7c0f343462e03a26b8395297c810b1d95
* | Use induction variable range analysis in BCE (statically).Aart Bik2015-09-151-1/+4
|/ | | | | | | | | | Rationale: Finally! After lots of very large CLs, now a small CL that uses the new induction variable analysis in BCE (statically, using this dynamically with de-opt is TBD). Despite its relative small size, be aware though, since the CL introduces a new phase to the compiler. Change-Id: If5555a173fd5d55d147c63138ef51fc296fa1414
* Merge "Revert "Revert "ART: Register allocation and runtime support for ↵David Brazdil2015-09-151-30/+34
|\ | | | | | | try/catch"""
| * Revert "Revert "ART: Register allocation and runtime support for try/catch""David Brazdil2015-09-151-30/+34
| | | | | | | | | | | | | | | | | | The original CL triggered b/24084144 which has been fixed by Ib72e12a018437c404e82f7ad414554c66a4c6f8c. This reverts commit 659562aaf133c41b8d90ec9216c07646f0f14362. Change-Id: Id8980436172457d0fcb276349c4405f7c4110a55
| * Revert "ART: Register allocation and runtime support for try/catch"David Brazdil2015-09-141-34/+30
| | | | | | | | | | | | | | | | Breaks libcore test org.apache.harmony.security.tests.java.security.KeyStorePrivateKeyEntryTest#testGetCertificateChain. Need to investigate. This reverts commit b022fa1300e6d78639b3b910af0cf85c43df44bb. Change-Id: Ib24d3a80064d963d273e557a93469c95f37b1f6f
| * ART: Register allocation and runtime support for try/catchDavid Brazdil2015-09-141-30/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch completes a series of CLs that add support for try/catch in the Optimizing compiler. With it, Optimizing can compile all methods containing try/catch, provided they don't contain catch loops. Future work will focus on improving performance of the generated code. SsaLivenessAnalysis was updated to propagate liveness information of instructions live at catch blocks, and to keep location information on instructions which may be caught by catch phis. RegisterAllocator was extended to spill values used after catch, and to allocate spill slots for catch phis. Catch phis generated for the same vreg share a spill slot as the raw value must be the same. Location builders and slow paths were updated to reflect the fact that throwing an exception may not lead to escaping the method. Instruction code generators are forbidden from using of implicit null checks in try blocks as live registers need to be saved before handing over to the runtime. CodeGenerator emits a stack map for each catch block, storing locations of catch phis. CodeInfo and StackMapStream recognize this new type of stack map and store them separate from other stack maps to avoid dex_pc conflicts. After having found the target catch block to deliver an exception to, QuickExceptionHandler looks up the dex register maps at the throwing instruction and the catch block and copies the values over to their respective locations. The runtime-support approach was selected because it allows for the best performance in the normal control-flow path, since no propagation of catch phi values is necessary until the exception is thrown. In addition, it also greatly simplifies the register allocation phase. ConstantHoisting was removed from LICMTest because it instantiated (now abstract) HConstant and was bogus anyway (constants are always in the entry block). Change-Id: Ie31038ad8e3ee0c13a5bbbbaf5f0b3e532310e4e
* | Temporarly disable SSA creation in try/catch/debuggable.Nicolas Geoffray2015-09-151-0/+6
|/ | | | | | | | This is to enable optimizations when the debuggable flag is set. bug:24054676 Change-Id: I34eef2481ae44ad3550e04ec6f796d421d03adc0
* [optimizing] Add support for x86 constant areaMark Mendell2015-09-081-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use the Quick trick of finding the address of the method by calling the next instruction and popping the return address into a register. This trick is used because of the lack of PC-relative addressing in 32 bit mode on the X86. Add a HX86ComputeBaseMethodAddress instruction to trigger generation of the method address, which is referenced by instructions needing access to the constant area. Add a HX86LoadFromConstantTable instruction that takes a HX86ComputeBaseMethodAddress and a HConstant that will be used to load the value when needed. Change Add/Sub/Mul/Div to detect a HX86LoadFromConstantTable right hand side, and generate code that directly references the constant area. Other uses will be added later. Change the inputs to HReturn and HInvoke(s), replacing the FP constants with HX86LoadFromConstantTable instead. This allows values to be loaded from the constant area into the right location. Port the X86_64 assembler constant area handling to the X86. Use the new per-backend optimization framework to do this conversion. Change-Id: I6d235a72238262e4f9ec0f3c88319a187f865932 Signed-off-by: Mark Mendell <mark.p.mendell@intel.com>
* Merge "Reduce how often we call FindDexCache"Mathieu Chartier2015-09-031-12/+14
|\
| * Reduce how often we call FindDexCacheMathieu Chartier2015-09-031-12/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Before host boot.oat -j4 optimizing compile: real 1m17.792s user 3m26.140s sys 0m8.340s After: real 1m12.324s user 3m22.718s sys 0m8.320s Change-Id: If18e9e79e06cdf1676692e5efacb682bf93889c3
* | Add more dwarf debug line info for Optimized methods.Yevgeny Rouban2015-09-031-9/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Optimizing compiler generates minimum debug line info that is built using the dex_pc information about suspend points. This is not enough for performance and debugging needs. This CL generates additional debug line information for instructions which have known dex_pc and it ensures that whole call sites are mapped (as opposed to suspend points which map only one instruction past the function call). Bug: 23157336 Change-Id: I9f2b1c2038e3560847c175b8121cf9496b8b58fa Signed-off-by: Yevgeny Rouban <yevgeny.y.rouban@intel.com>
* | Optimizing: Tag Arena allocations with their source.Vladimir Marko2015-09-021-21/+34
|/ | | | | | | | | | | This adds the ability to track where we allocate memory when the kArenaAllocatorCountAllocations flag is turned on. Also move some allocations from native heap to the Arena and remove some unnecessary utilities. Bug: 23736311 Change-Id: I1aaef3fd405d1de444fe9e618b1ce7ecef07ade3
* Revert "Revert "Change dex caches to be weak roots""Mathieu Chartier2015-08-311-1/+2
| | | | | | | | | | | | This reverts commit 81a9087f0df0518c39405b7d18ba5858a6d8b77b. Boot.oat creation time goes from 4.7s to 4.9s on host due to extra locking. Will try to improve this in another CL. Bug: 23602225 Bug: 22720414 Change-Id: I7e25b75cfb63faa196c7b0f60e46cce50bf12021
* Fix some HandleScope bugs and add corresponding checksMathieu Chartier2015-08-281-1/+6
| | | | | | | | | | | Some places were creating or destroying handle scopes without holding the mutator lock. This can cause GC crashes if thread roots are being marked or hprof dumps to also fail. Also added checks to catch some of these errors. Bug: 23468617 Change-Id: I1a2d615923484cfc25014967656775c445aa3f1f
* ART: Propagate verifier failure types to the compilersAndreas Gampe2015-08-261-2/+2
| | | | | | | | | | | Add a bit-set encoding of seen failure types to the verifier and make it available. Store this in VerifiedMethod, so that compilers can inspect it and make choices based on failures. Rewrite the current punting of runtime-throw errors to be at the compiler-driver level. Bug: 23502994 Change-Id: I1cfc7cbdf2aec1f14ba18f0169e432ba4ae16883
* Merge "ART: Enable basic optimizations for try/catch"David Brazdil2015-08-191-18/+17
|\
| * ART: Enable basic optimizations for try/catchDavid Brazdil2015-08-191-18/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Generating code for try/catch methods requires having run at least the instruction simplifier to remove redundant suspend checks. This patch enables the first group of optimizations when try/catch is present. Enabled optimizations: 1) IntrinsicsRecognizer Does not modify the graph, only sets HInvoke::intrinsic_. 2) ConstantFolding Does not deal with throwing instructions. 3) InstructionSimplifier May remove a throwing instruction (e.g. LoadClass in VisitCheckCast), or may turn a throwing instruction into a non-throwing one (ArraySet). Their corresponding catch phi inputs are not removed but correctness is preserved. 4) ReferenceTypePropagation Does not modify the graph, only sets type properties. Typing of LoadException from catch handler information was added. 5) DeadCodeElimination Removing individual instructions is fine (same as 3). Removal of dead blocks was disabled for try/catch. Change-Id: I2722c3229eb8aaf326391e07f522dbf5186774b8
* | Merge "Revert "Revert "Optimizing: Better invoke-static/-direct dispatch."""Vladimir Marko2015-08-191-2/+19
|\ \ | |/ |/|
| * Revert "Revert "Optimizing: Better invoke-static/-direct dispatch.""Vladimir Marko2015-08-191-2/+19
| | | | | | | | | | | | | | | | | | | | Fixed kCallArtMethod to use correct callee location for kRecursive. This combination is used when compiling with debuggable flag set. This reverts commit b2c431e80e92eb6437788cc544cee6c88c3156df. Change-Id: Idee0f2a794199ebdf24892c60f8a5dcf057db01c
* | Put in place the ARM64 instruction simplification framework.Alexandre Rames2015-08-191-0/+32
|/ | | | | | | | This commit introduces and runs the empty InstructionSimplifierArm64 pass. Further commits will introduce arm64-specific transformations in that pass. Change-Id: I458f8a2b15470297b87fc1f7ff85bd52155d93ef
* Revert "Optimizing: Better invoke-static/-direct dispatch."Vladimir Marko2015-08-191-19/+2
| | | | | | | | Reverting due to failing ndebug tests. This reverts commit 9b688a095afbae21112df5d495487ac5231b12d0. Change-Id: Ie4f69da6609df3b7c8443412b6cf7f5c43c2c5d9
* Optimizing: Better invoke-static/-direct dispatch.Vladimir Marko2015-08-191-2/+19
| | | | | | | | | | | | | | Add framework for different types of loading ArtMethod* and code pointer retrieval. Implement invoke-static and invoke-direct calls the same way as Quick. Document the dispatch kinds in HInvokeStaticOrDirect's new enumerations MethodLoadKind and CodePtrLocation. PC-relative loads from dex cache arrays are used only for x86-64 and arm64. The implementation for other architectures will be done in separate CLs. Change-Id: I468ca4d422dbd14748e1ba6b45289f0d31734d94
* Allow for fine tuning the inliner.Calin Juravle2015-07-291-15/+41
| | | | | | Bug: 21868508 Change-Id: Ice7f1604ed65e3d4ed2a010ee431272b7d000cdb
* Revert "Revert "Revert "Revert "Fixes and improvements in ↵Calin Juravle2015-07-281-1/+2
| | | | | | | | ReferenceTypePropagation"""" This reverts commit e344a8070d4549d513413c06767abf8a2c5e9709. Change-Id: I400fab0e02ce3c11376cc1f3ae9c7cf2c82ffcc1
* Revert "Revert "Revert "Fixes and improvements in ReferenceTypePropagation"""Calin Juravle2015-07-281-2/+1
| | | | | | This reverts commit 00e3b38be4b280d6d7a7e843cd336ffbd2ba4365. Change-Id: I4dbadb2d7312a410f1c56283f063dd82156cf702
* Revert "Revert "Fixes and improvements in ReferenceTypePropagation""Calin Juravle2015-07-271-1/+2
| | | | | | This reverts commit 9b0096ba77e7e61bc2dcbbf954831dcae54a6c27. Change-Id: I824f16e800ca32e646577d5e1e0d593887ccead1
* Move to newer clang annotationsMathieu Chartier2015-07-221-1/+1
| | | | | | | | | | | | | | | Also enable -Wthread-safety-negative. Changes: Switch to capabilities and negative capabilities. Future work: Use capabilities to implement uninterruptible annotations to work with AssertNoThreadSuspension. Bug: 20072211 Change-Id: I42fcbe0300d98a831c89d1eff3ecd5a7e99ebf33
* ART: Add VerboseMethods to optimizing compilerAndreas Gampe2015-07-221-7/+26
| | | | | | Bring the optimizing compiler up to Quick levels for debuggability. Change-Id: Ib2adce7a31cc6a60c37c63d0df5cb6a35a85e790
* Revert "Revert "Use the quickened metadata to compile -QUICK opcodes.""Nicolas Geoffray2015-07-171-2/+20
| | | | | | This reverts commit 8ab9a9010f3929acbb6c671008b8885b762b01e1. Change-Id: I1e654d5010ea2112982c3055fcb8c8f9c10e9ac8
* Merge "Reduce space filter threshold to 128."Nicolas Geoffray2015-07-171-2/+2
|\
| * Reduce space filter threshold to 128.Nicolas Geoffray2015-07-171-2/+2
| | | | | | | | | | | | | | | | In order to get closer to our code increase limit. Bug:21868508 Change-Id: I05f76bfd97f03bda3741eca4e6a678c536ad0702
* | Revert "Use the quickened metadata to compile -QUICK opcodes."Nicolas Geoffray2015-07-171-16/+2
| | | | | | | | | | | | | | | | Broke sdk build. Investigating. This reverts commit 4515a67434c9e3e1627586629a1f2aba1a99aa6a. Change-Id: I6c1107ab626758570a59dc6bf3e4228c70a57196
* | Use the quickened metadata to compile -QUICK opcodes.Nicolas Geoffray2015-07-161-2/+16
| | | | | | | | Change-Id: I28a8d68921698bea81f54c95cc6e4c6d2c03f2b4
* | ART: Build SSA form when try/catch is presentDavid Brazdil2015-07-151-9/+14
| | | | | | | | | | | | | | | | | | This patch implements support for try/catch in the SsaBuilder. Values of locals are propagated from throwing sites inside try blocks to their respective catch blocks and phis ("catch phis") are created when necessary. Change-Id: I0736565c2c4ff3f9f0924b6e3a785a50023f875a
* | [optimizing] Don't rely on the verifier for String.<init>.Nicolas Geoffray2015-07-101-1/+1
|/ | | | | | Continue work on cutting the dependency on the verifier. Change-Id: I0f95b1eb2e10fd8f6bf54817f1202bdf6dfdb0fe
* Only do some checks when compiling against the core image.Nicolas Geoffray2015-06-251-1/+7
| | | | | | | | This will avoid false negatives when running dex2oatd on apks. bug:21865473 Change-Id: Id8eacaefae0bcf07a2ada8aedd7951854cdb5c4f
* Use a flag from the verifier to know if we should compile.Nicolas Geoffray2015-06-241-1/+2
| | | | | | | | | Only used for the lack of bottom type in the aget-object case for now. Could be used for more. bug:21865466 Change-Id: I64c2c84dfa1c0d259631e65e5f44b94e4139e6a7
* ART: Run GraphChecker after Builder and SsaBuilderDavid Brazdil2015-06-241-48/+74
| | | | | | | | | This patch refactors the way GraphChecker is invoked, utilizing the same scoping mechanism as pass timing and graph visualizer. Therefore, GraphChecker will now run not just after instances of HOptimization but after the builders and reg alloc, too. Change-Id: I8173b98b79afa95e1fcbf3ac9630a873d7f6c1d4
* Opt compiler: Add disassembly to the '.cfg' output.Alexandre Rames2015-06-221-9/+28
| | | | | | | This is automatically added to the '.cfg' output when using the usual `--dump-cfg` option. Change-Id: I864bfc3a8299c042e72e451cc7730ad8271e4deb
* MIPS: Initial version of optimizing compiler for MIPS64R6.Alexey Frunze2015-06-191-0/+1
| | | | | | | Bug: 21555893 Change-Id: I874dc356eee6ab061a32f8f3df5f8ac3a4ab7dcf Signed-off-by: Alexey Frunze <Alexey.Frunze@imgtec.com> Signed-off-by: Douglas Leung <douglas.leung@imgtec.com>
* Run a simplification pass before code generation.Nicolas Geoffray2015-06-181-1/+7
| | | | | | | | | | 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 Change-Id: I1f84016017bf691c2a34982e202a505b269f609a