summaryrefslogtreecommitdiff
path: root/compiler/optimizing/builder.cc
AgeCommit message (Collapse)Author
2015-12-10Fix braino when resolving an invoke-super. Nicolas Geoffray
We should check the actual_method, and not the resolved_method, on whether it is in the same dex file. bug:26022686 Change-Id: I8a9b0c68e162015e0aec397545d0607482949967
2015-12-08ART: Check invoke-interface earlier in verifier Andreas Gampe
Invoke-interface should only be called on an interface method. Move the check earlier, as otherwise we'll try to resolve and potentially inject a method into the dex cache. Also templatize ResolveMethod with a version always checking the invoke type, and on a cache miss check whether type target type is an interface when an interface invoke type was given. Bug: 21869691 Change-Id: Ica27158f675b5aa223d9229248189612f4706832
2015-12-02Revert "Revert "Don't use the compiler driver for method resolution."" Nicolas Geoffray
This reverts commit c88ef3a10c474045a3476a02ae75d07ddd3230b7. Change-Id: I0ed88a48b313a8d28bc39fae40631123aadb13ef
2015-12-01Revert "Don't use the compiler driver for method resolution." Nicolas Geoffray
Fails 425 in debuggable mode. This reverts commit 4db0bf9c4db6a09716c3388b7d2f88d534470339. Change-Id: I346df8f75674564fc4fb241c60f23e250fc7f0a7
2015-12-01Don't use the compiler driver for method resolution. Nicolas Geoffray
The compiler driver makes assumptions that don't hold for the optimizing compiler, and will for example always go to slow path for an invoke-super when there's no verified method. Also fix GenerateInvokeVirtual in the presence of intrinsics. Next change will address some of the TODOs in sharpening.cc. Change-Id: I2b0e543ee9b9bebcadb2d26de29e850c59ad58b9
2015-11-24Optimize HLoadClass when we know the class is in the cache. Nicolas Geoffray
Change-Id: Iaa74591eed0f2eabc9ba9f9988681d9582faa320
2015-11-24A few more optimizations on avoiding HClinit. Nicolas Geoffray
Change-Id: I622a98b620e9d261cb654e2f5ab578bd8b3484b1
2015-11-23Fix lint error. Nicolas Geoffray
Change-Id: I29632dc7e49f7ec63040455fa40fcf87e9282e5e
2015-11-20Explicitly add HLoadClass/HClinitCheck for HNewInstance. Nicolas Geoffray
bug:25735083 bug:25173758 Change-Id: Ie81cfa4fa9c47cc025edb291cdedd7af209a03db
2015-11-18Revert "Revert "Enable store elimination for singleton objects."" Mingyao Yang
This reverts commit 55d02cf056f993aeafebd54e7b7c68c7a48507c9, and makes the following change: Currently we leverage loop side effects to decide whether heap values are killed by the loop. Stores need to be kept if heap values may be killed by loops and the corresponding loads cannot be eliminated. Similar thing need to be done for each predecessor when we merge predecessor heap values. To do that, the HInstanceFieldSet instruction itself is put in the heap value array instead of the value of the store instruction. The store instruction may be added to possibly_removed_stores_ first, but can later be removed from possibly_removed_stores_ when it's found out that the store needs to be kept due to merging/loop side effects. Change-Id: I4f7bb1960f7b47240873e00ff1adac46fc102a02
2015-11-09Merge "Optimizing: Remove unused ArtMethod* input from HInvokeStaticOrDirect." Vladimir Marko
2015-11-06Optimizing: Remove unused ArtMethod* input from HInvokeStaticOrDirect. Vladimir Marko
Change-Id: Iea99fa683440673ff517e246f35fade96600f229
2015-11-06ART: Fix simplification of catch blocks in the presence of dead code David Brazdil
Simplification of catch blocks transforms the code so that catch blocks have only exceptional predecessors. However, it is invoked before trivially dead code is eliminated which breaks simple assumptions such as the fact that a catch block cannot start with move-exception if it has non-exceptional predecessors. This patch fixes the algorithm to work under these relaxed conditions. Bug: 25494450 Bug: 25492628 Change-Id: Idc8d010102a4b8b9a6cd918b98d6e11d1838db0c
2015-10-29Revert "Enable store elimination for singleton objects." Andreas Gampe
This reverts commit 7f43a3d48fc29045875d50e10bbc5d6ffc25d61e. Fails booting. Bug: 25357772 Change-Id: Ied19536f3ce8d81e76885cb6baed4853e2ed6714
2015-10-27Enable store elimination for singleton objects. Mingyao Yang
Enable store elimination for singleton objects. However for finalizable object, don't eliminate stores. Also added a testcase. Change-Id: Icf991e7ded5b490f55f580ef928ece5c45e89902
2015-10-27Merge "Optimizing: Determine invoke-static/-direct dispatch early." Vladimir Marko
2015-10-23Optimizing: Determine invoke-static/-direct dispatch early. Vladimir Marko
Determine the dispatch type of invoke-static/-direct in a special pass right after the type inference. This allows the inliner to pass the "needs dex cache" check and inline more. It also allows the code generator to avoid requesting a register location for the ArtMethod* for kDexCachePcRelative and direct methods. The supported dispatch check handles also situations that the CompilerDriver currently doesn't allow. The cleanup of the CompilerDriver and required changes to Quick will come in a separate change. Change-Id: I3f8e903a119949e95871d8ab0a995f4731a13a07
2015-10-22Revert "Revert "load store elimination."" Mingyao Yang
This reverts commit 8030c4100d2586fac39ed4007c61ee91d4ea4f25. Change-Id: I79558d85484be5f5d04e4a44bea7201fece440f0
2015-10-20Merge "Revert "Revert "optimizing: propagate type information of arguments""" Calin Juravle
2015-10-15Revert "load store elimination." Nicolas Geoffray
Breaks libcore tests: libcore.java.lang.ref.FinalizeTest#testWatchdogDoesNotFailForObjectsThatAreNearTheDeadline libcore.java.util.ResourceLeakageDetectorTest#testDetectsUnclosedCloseGuard org.apache.harmony.tests.java.lang.ref.ReferenceTest#test_finalizeReferenceInteraction This reverts commit 589dac7f0ce078d19aad7e35bb0195c47ddf01d2. Change-Id: I55115765c10762d5bc152d3425e4622560d8b9f4
2015-10-15load store elimination. Mingyao Yang
This adds a pass to eliminate some unnecessary heap loads/stores. It first collects heap locations and then tracks values stored to those heap locations. Alias analysis is done based on offset, type, singleton, pre-existence, etc. Change-Id: I11a9d8ef20d1b2f245607eb25118e9aff9be472a
2015-10-14Revert "Revert "optimizing: propagate type information of arguments"" Calin Juravle
This reverts commit 89c0d32437011bbe492fe14c766cd707046ce043. Change-Id: I603a49794e155cc97410b8836c8ea425bfdc98eb
2015-10-13Merge "Revert "optimizing: propagate type information of arguments"" Calin Juravle
2015-10-13Revert "optimizing: propagate type information of arguments" Calin Juravle
This reverts commit 2c1ffc3a06e9ed0411e29e7dc2558b5d657ede7a. Change-Id: I3291070c373e661fa578f5a38becbb5a502baf94
2015-10-12Merge "optimizing: propagate type information of arguments" Calin Juravle
2015-10-12optimizing: propagate type information of arguments Calin Juravle
This helps inlining and type check elimination. e.g: void foo(ArrayList a) { int size = a.size(); // this can be inlined now. } Change-Id: I3ffeaa79d9df444aa19511c83c544cb5f9d9ab20
2015-10-12Merge "Optimizing: Avoid string init register set copy for debuggable." Vladimir Marko
2015-10-12Optimizing: Avoid string init register set copy for debuggable. Vladimir Marko
Change-Id: I9c0d2e1353c68129db06d53a190a015710e4fd0d
2015-10-12Assert that referrers class should not need access check. Calin Juravle
Change-Id: Ia682befdb0dc665f74c0f96454cc007304ff2397
2015-10-08Add DCHECKs to ArenaVector and ScopedArenaVector. Vladimir Marko
Implement dchecked_vector<> template that DCHECK()s element access and insert()/emplace()/erase() positions. Change the ArenaVector<> and ScopedArenaVector<> aliases to use the new template instead of std::vector<>. Remove DCHECK()s that have now become unnecessary from the Optimizing compiler. Change-Id: Ib8506bd30d223f68f52bd4476c76d9991acacadc
2015-10-06Add support for unresolved classes in optimizing. Calin Juravle
Change-Id: I0e299a81e560eb9cb0737ec46125dffc99333b54
2015-10-02Enable compilation of members with access check failures. Calin Juravle
Change-Id: I0de73099b53612072c3e6f1235c22f96339fe440
2015-10-02Revert "Revert "Support unresolved fields in optimizing" Calin Juravle
The CL also changes the calling convetion for 64bit static field set to use kArg2 instead of kArg1. This allows optimizing to keep the asumptions: - arm pairs are always of form (even_reg, odd_reg) - ecx_edx is not used as a register on x86. This reverts commit e6f49b47b6a4dc9c7684e4483757872cfc7ff1a1. Change-Id: I93159917565824084abc96775f31be1a4249f2f3
2015-09-29Optimizing: Tag even more arena allocations. Vladimir Marko
Tag previously "Misc" arena allocations with more specific allocation types. Move some native heap allocations to the arena in BCE. Bug: 23736311 Change-Id: If8ef15a8b614dc3314bdfb35caa23862c9d4d25c
2015-09-28Address HPackedSwitch issues raised after merge Mark Mendell
There were some stylistic comments about the merged files. Fix those. Add a test that PackedSwitch can be removed by DCE. Change-Id: Idf45833956e9b58051f942a52b06a1e416606e2e Signed-off-by: Mark Mendell <mark.p.mendell@intel.com>
2015-09-25Merge "Optimizing: Tag more arena allocations." Vladimir Marko
2015-09-25Optimizing: Tag more arena allocations. Vladimir Marko
Replace GrowableArray with ArenaVector and tag arena allocations with new allocation types. As part of this, make the register allocator a bit more efficient, doing bulk insert/erase. Some loops are now O(n) instead of O(n^2). Change-Id: Ifac0871ffb34b121cc0447801a2d07eefd308c14
2015-09-25ART: Preserve loop headers with try/catch David Brazdil
Algorithm for inserting HTryBoundary instructions would generate a non-natural loop when a loop header block was covered by a TryItem. This patch changes the approach to fix the issue. Bug: 23895756 Change-Id: I0e1ee6cf135cea326a96c97954907d202c9793cc
2015-09-21[optimizing] Add basic PackedSwitch support Mark Mendell
Add HPackedSwitch, and generate it from the builder. Code generators convert this to a series of compare/branch tests. Better implementation in the code generators as a real jump table will follow as separate CLs. Change-Id: If14736fa4d62809b6ae95280148c55682e856911 Signed-off-by: Mark Mendell <mark.p.mendell@intel.com>
2015-09-18Revert "Revert "Optimize code generation of check-cast and instance-of."" Nicolas Geoffray
This reverts commit 7537437c6a2f89249a48e30effcc27d4e7c5a04f. Change-Id: If759cb08646e47b62829bebc3c5b1e2f2969cf84
2015-09-17Merge "Revert "Optimize code generation of check-cast and instance-of."" Nicolas Geoffray
2015-09-17Revert "Optimize code generation of check-cast and instance-of." Nicolas Geoffray
Failures with libcore tests. This reverts commit 64acf303eaa2f32c0b1d8cfcbf044a822c5eec08. Change-Id: Ie6f323fcf5d86bae5c334c1352bb21f1bad60a88
2015-09-17Optimizing: Do not use range-based loop when inserting elements. Vladimir Marko
When we iterate over the elements of a container and we may insert new elements into that container, it's wrong to use the range-based loop. Bug: 24133462 Change-Id: Iee35fbcf88ed3bcd6155cbeba09bd256032a16be
2015-09-17Merge "Optimize code generation of check-cast and instance-of." Nicolas Geoffray
2015-09-17Revert "Support unresolved fields in optimizing" Calin Juravle
breaks debuggable tests. This reverts commit 23a8e35481face09183a24b9d11e505597c75ebb. Change-Id: I8e60b5c8f48525975f25d19e5e8066c1c94bd2e5
2015-09-17Optimize code generation of check-cast and instance-of. Nicolas Geoffray
On x86/x64/arm/arm64. Improve code size of selected apks from 0.3% to 1%, and performance of DeltaBlue by 20%. Change-Id: Ib5799f7a53443cd880a121dd7f21932ae9f5c7aa
2015-09-17Support unresolved fields in optimizing Calin Juravle
Change-Id: I9941fa5fcb6ef0a7a253c7a0b479a44a0210aad4
2015-09-17Support unresolved methods in Optimizing Calin Juravle
Change-Id: If2da02b50d2fa668cd58f134a005f1752e7746b1
2015-09-17BuildInvoke refactor: extract String.init in its own code path Calin Juravle
This makes it clear that we special handle String init. Getting rid of all `if (is_string_init)` improves readability into what we actually do and expect for strings. Change-Id: I9b4fba4c3ea89e0003c0704335cbe80e874d0e15
2015-09-16Optimizing: Tag arena allocations in HGraph. Vladimir Marko
Replace GrowableArray with ArenaVector in HGraph and related classes HEnvironment, HLoopInformation, HInvoke and HPhi, and tag allocations with new arena allocation types. Change-Id: I3d79897af405b9a1a5b98bfc372e70fe0b3bc40d