summaryrefslogtreecommitdiff
path: root/compiler/optimizing/optimizing_compiler.cc
AgeCommit message (Collapse)Author
2017-02-06Merge "Code refactoring around sharpening HLoadClass."Nicolas Geoffray
2017-02-06Revert "Revert "Inline across dex files for JIT.""Nicolas Geoffray
bug:30933338 This reverts commit d16da8bd8106452eea82408748dc6b3fd64bcb80. Change-Id: I6a30354d6d00442cb1a542af063c7769865e369d
2017-02-03Code refactoring around sharpening HLoadClass.Nicolas Geoffray
Even if the class is not accessible through the dex cache, we can access it by other means (eg boot class, jit table). So rewrite static field access instruction builder to not bail out if a class cannot be accessed through the dex cache. bug:34966607 test: test-art-host test-art-target Change-Id: I88e4e09951a002b480eb8f271726b56f981291bd
2017-02-03Merge "Revert "Inline across dex files for JIT.""Nicolas Geoffray
2017-02-03Revert "Inline across dex files for JIT."Nicolas Geoffray
Broke hikey build. bug:30933338 This reverts commit f290c01c61f8a2979efa74ffcd2f54c5e426a3d0. Change-Id: I3363d703c54d0f9b69197a29395cc08f60c8b2ac
2017-02-03Merge "Inline across dex files for JIT."Nicolas Geoffray
2017-02-02Inline across dex files for JIT.Nicolas Geoffray
bug:30933338 test: ART_TEST_JIT=true test-art-host test-art-target Change-Id: I4ac708d70d90c2db4139d99a75bf4665a810c206
2017-02-01Revert "Hash-based dex cache type array."Vladimir Marko
Reverting to work around some programs crashing with Check failed: handle_scope_iface.Get() != nullptr. though the reason for the failure not yet understood. Test: m test-art-host Bug: 34839984 Bug: 30627598 Bug: 34659969 Bug: 30419309 This reverts commit ec7862283dd49f5a58d0ac45960ce27c2f7671b8. Change-Id: Ifded663633082f1e59e5b6ff2e026dc559bd6b82
2017-01-30Hash-based dex cache type array.Vladimir Marko
Test: m test-art-host (Interpreter, Optimizing, JIT) Test: m test-art-target on Nexus 6P (Interpreter, Optimizing, JIT) Test: Nexus 6P boots Test: m valgrind-test-art-host Bug: 30627598 Bug: 34659969 Bug: 30419309 Change-Id: Ic00eda89e58088a3573fc9ec0ad04c0e69e161d1
2017-01-25AArch64: Add HInstruction scheduling support.Alexandre Rames
This commit adds a new `HInstructionScheduling` pass that performs basic scheduling on the `HGraph`. Currently, scheduling is performed at the block level, so no `HInstruction` ever leaves its block in this pass. The scheduling process iterates through blocks in the graph. For blocks that we can and want to schedule: 1) Build a dependency graph for instructions. It includes data dependencies (inputs/uses), but also environment dependencies and side-effect dependencies. 2) Schedule the dependency graph. This is a topological sort of the dependency graph, using heuristics to decide what node to schedule first when there are multiple candidates. Currently the heuristics only consider instruction latencies and schedule first the instructions that are on the critical path. Test: m test-art-host Test: m test-art-target Change-Id: Iec103177d4f059666d7c9626e5770531fbc5ccdc
2017-01-10Keep resolved String in HLoadString.Nicolas Geoffray
For the following reasons: - Avoids needing to do a lookup again in CodeGenerator::EmitJitRoots. - Fixes races where we the string was GC'ed before CodeGenerator::EmitJitRoots. - Makes it possible to do GVN on the same string but defined in different dex files. Test: test-art-host, test-art-target Change-Id: If2b5d3079f7555427b1b96ab04546b3373fcf921
2016-12-19CHA guard optimization (elimination/hoisting).Mingyao Yang
Test: manual by checking the dump-cfg output. Change-Id: I254e168b9a85d2d3d23e02eea7e129c1bc9ab920
2016-12-15Flush JIT data cache when committing code.Nicolas Geoffray
Otherwise, executing compiled code may see old data from the data cache. Test: ART_TEST_JIT=true test-art-target on arm/arm64 Test: run-libcore-tests.sh (especially jsr166) on arm/arm64 Change-Id: Id037c68897aa0e9ccacd4c5121f3743fb722c6f3
2016-12-13ART: Clean up utils.hAndreas Gampe
Remove functionality provided by libbase. Move some single-use functions to their respective users. Test: m test-art-host Change-Id: I75594035fa975200d638cc29bb9f31bc6e6cb29f
2016-12-12Revert "Revert "Add kJitTableAddress for HLoadClass.""Nicolas Geoffray
This reverts commit d2d5262c8370309e1f2a009f00aafc24f1cf00a0. Change-Id: I6149d5c7d5df0b0fc5cb646a802a2eea8d01ac08
2016-12-12Revert "Add kJitTableAddress for HLoadClass."Nicolas Geoffray
One test failure after merge. This reverts commit 5b12f7973636bfea29da3956a9baa7a6bbe2b666. Change-Id: I120c49e53274471fc1c82a10d52e99c83f5f85cc
2016-12-12Add kJitTableAddress for HLoadClass.Nicolas Geoffray
This new kind loads classes from the root table associated with JIT compiled code. Also remove kDexCacheAddress, which is replaced by kJitTableAddress. test: ART_TEST_JIT=true test-art-host-jit test-art-target-jit Change-Id: Ia23029688d1a60c178bf2ffa7463927c5d5de4d0
2016-12-05ARM: VIXL32: Implement Invoke, LoadClass, LoadString dispatch.Artem Serov
Implemented dispatch optimizations for InvokeStaticOrDirect, LoadClass, LoadString (excluding cases that use Literals). Performed a cleanup of VIXL backend. Test: export ART_USE_VIXL_ARM_BACKEND=true && \ mma test-art-host dist && mma test-art-target dist Change-Id: Ib37a6b7e7657196b13caec999d190be747857c1d
2016-12-01Class Hierarchy Analysis (CHA)Mingyao Yang
The class linker now tracks whether a method has a single implementation and if so, the JIT compiler will try to devirtualize a virtual call for the method into a direct call. If the single-implementation assumption is violated due to additional class linking, compiled code that makes the assumption is invalidated. Deoptimization is triggered for compiled code live on stack. Instead of patching return pc's on stack, a CHA guard is added which checks a hidden should_deoptimize flag for deoptimization. This approach limits the number of deoptimization points. This CL does not devirtualize abstract/interface method invocation. Slides on CHA: https://docs.google.com/a/google.com/presentation/d/1Ax6cabP1vM44aLOaJU3B26n5fTE9w5YU-1CRevIDsBc/edit?usp=sharing Change-Id: I18bf716a601b6413b46312e925a6ad9e4008efa4 Test: ART_TEST_JIT=true m test-art-host/target-run-test test-art-host-gtest
2016-11-22Clear the right data pointer.Nicolas Geoffray
Internally, stack_map_data is an offset of the roots_data allocation. Pass both to the ClearData method, which will use the right pointer to deallocate. Test: test-art-host in debug mode Change-Id: Ibfe38e7f1853870076048427f2efe7121c11c136
2016-11-21ART: Add dex::TypeIndexAndreas Gampe
Add abstraction for uint16_t type index. Test: m test-art-host Change-Id: I47708741c7c579cbbe59ab723c1e31c5fe71f83a
2016-11-21Merge "Revert "Revert "Revert "Revert "JIT root tables."""""Nicolas Geoffray
2016-11-18Revert "Revert "Revert "Revert "JIT root tables.""""Nicolas Geoffray
Test: 626-set-resolved-string, test-art-host, test-art-target Test: run-libcore-tests.sh Test: phone boots and runs This reverts commit 3395fbc20bcd20948bec8958db91b304c17cacd8. Change-Id: I104b73d093e3eb6a271d564cfdb9ab09c1c8cf24
2016-11-16ARM: VIXL32: Arch specific operations.Artem Serov
Tests which now start to pass: 550-checker-multiply-accumulate 564-checker-negbitwise Test: export ART_USE_VIXL_ARM_BACKEND=true && \ mma test-art-host dist && mma test-art-target dist Change-Id: I0b057486a8e0e48afbc52dd18b61ea16c671bec2
2016-11-14Merge "Revert "Revert "Revert "JIT root tables.""""Nicolas Geoffray
2016-11-14Revert "Revert "Revert "JIT root tables."""Nicolas Geoffray
libcore failures: dalvikvm32 F 11-14 03:04:06 14870 14870 jit_code_cache.cc:310] Check failed: new_string != nullptr This reverts commit 75afcdd3503a8a8518e5b23d21b6e73306ce39ce. Change-Id: I5a6b6b48aa79a763d1ff1ba4d85d63811254787d
2016-11-14Merge "Revert "Revert "JIT root tables."""Nicolas Geoffray
2016-11-11Revert "Revert "JIT root tables.""Nicolas Geoffray
Also contains Revert "Support kJitTableAddress in x86/arm/arm64." This reverts commit 4acd03638fcdb4e5d1666f8eec7eb3bf6d6be035. This reverts commit 997d1217830c0a18b70faeabd53c04700a87d7d9. Test: ART_USE_READ_BARRIER=true/false test-art-host test-art-target Change-Id: I77cb1e9bf8f1b4c58b72d3cf5ca31ced2aaa1ea3
2016-11-10Dump c1visualizer output before and after each pass.Nicolas Geoffray
In order to get the last state of a graph before a crash. Test: dex2oat --dump-cfg Change-Id: I461a26a47a170b95fadb9da21a443af26fe52181
2016-11-09Merge "Revert "JIT root tables.""Nicolas Geoffray
2016-11-09Revert "JIT root tables."Nicolas Geoffray
May be the offender for jit-gcstress failure of 902. This reverts commit ac3ebc3150760425ed00abd56da48f9a6e0666bc. Change-Id: I9ea6c9236fd1729fed7d1868dd8a111172932308
2016-11-09Merge "JIT root tables."Nicolas Geoffray
2016-11-08ART: Fix tidy warningsAndreas Gampe
Switch to char versions of find variants. Add "explicit" constructor variants or refactor and remove defaults. Use const references. Bug: 32619234 Test: m test-art-host Change-Id: I970cc2f47d6cf8f0c74104b994b075b2fafb3d45
2016-11-08JIT root tables.Nicolas Geoffray
Implement root tables for the JIT. Each JIT compiled method gets a table allocated before the stack maps. The table gets visited through Runtime::SweepSystemWeaks. Implement String roots for x86_64 as an example. Test: test-art-host test-art-target Change-Id: Id3d5bc67479e08b52dd4b253e970201203a0f0d2
2016-11-02New instruction simplifications. Extra dce pass. Allow more per block repeats.Aart Bik
Rationale: We were missing some obvious simplifications, which left performance at the table for e.g. CaffeineLogic compiled with dx (4200us->2700us). The constant for allowing a repeat on a BB seemed very low, at the very least it should depend on the BB size. Test: test-art-host Change-Id: Ic234566e117593e12c936d556222e4cd4f928105
2016-11-01Flush the CFG visualizer output after writing to it.Roland Levillain
This fixes test failures exposed by the ART Buildbot in 608-checker-unresolved-lse (AOT) on the hammerhead-ndebug configuration. The test used to fail because the CFG file dumped by second invocation of dex2oat on device would be truncated (at the beginning of the disassembly section of the second compiled Dex file's contents) because of dex2oat's fast exit. Interestingly enough, this is the only case where this failure has been observed, which seems to be due to a combination of: - targeting (32-bit) ARM; - using a secondary Dex file (used to create an unresolved access for that test); - compiling that secondary Dex file with dex2oat (ndebug mode) instead of dex2oatd; - supporting multithread CFG graph dumping (by having the write-to-file operation in a critical section) since https://android-review.googlesource.com/#/c/296224/. Test: art/test/run-test -O --debuggable 608-checker-unresolved-lse Change-Id: Ifc1a23a3708b8645fd36c148312074bb9fe00cfc
2016-10-28ART: Make graph visualizer thread-safeAndreas Gampe
Store visualizer to a temporary string stream during compilation. Print to the final output on destruction, and do so under a lock. Note: the order of methods in the output is only guaranteed to be deterministic with single-threaded compilation (-j1). Test: m Test: Compile multithread Test: Check output file that begin_compilation and end_compilation are interleaved Test: Check that names of compiled methods match Change-Id: I7eb3be2f88333cf1f116fe71b77cffa1ac702208
2016-10-20Merge "Improve recognition of select-based period induction."Treehugger Robot
2016-10-20Improve recognition of select-based period induction.Aart Bik
Rationale: Similar to the previous CL, this helps to eliminate more dead induction. Now, CaffeineLogic, when compiled with dx (rather than jack) improves by a 1.5 speedup (9000us -> 6000us). Note: We need to run the simplifier before induction analysis to trigger the select simplification first. Although a bit of a compile-time hit, it seems a good idea to run a simplifier here again anyway. Test: test-art-host Change-Id: I93b91ca40a4d64385c64393028e8d213f0c904a8
2016-10-20Merge "ARM: VIXL32: Pass initial ART tests with new code generator."Roland Levillain
2016-10-18Remove mirror:: and ArtMethod deps in utils.{h,cc}David Sehr
The latest chapter in the ongoing saga of attempting to dump a DEX file without having to start a whole runtime instance. This episode finds us removing references to ArtMethod/ArtField/mirror. One aspect of this change that I would like to call out specfically is that the utils versions of the "Pretty*" functions all were written to accept nullptr as an argument. I have split these functions up as follows: 1) an instance method, such as PrettyClass that obviously requires this != nullptr. 2) a static method, that behaves the same way as the util method, but calls the instance method if p != nullptr. This requires using a full class qualifier for the static methods, which isn't exactly beautiful. I have tried to remove as many cases as possible where it was clear p != nullptr. Bug: 22322814 Test: test-art-host Change-Id: I21adee3614aa697aa580cd1b86b72d9206e1cb24
2016-10-17ARM: VIXL32: Pass initial ART tests with new code generator.Scott Wakeling
- Implement enough codegen to pass ~70 art/tests. - When ART_USE_VIXL_ARM_BACKEND is defined: - Blacklist known-to-fail target tests - interpret-only everything except the tests themselves - Set a flag to use the VIXL based ARM backend Test: export ART_USE_VIXL_ARM_BACKEND=true && mma test-art-target && mma test-art-host Change-Id: Ic8bc095e8449f10f97fa0511284790f36c20e276
2016-10-12Replace StackHandleScopeCollection with VariableSizedHandleScopeMathieu Chartier
VariableSizedHandleScope's internal handle scopes are not pushed directly on the thread. This means that it is safe to intermix with other types of handle scopes. Added test. Test: clean-oat-host && test-art-host Change-Id: Id2fd1155788428f394d49615d337d9134824c8f0
2016-10-05Merge "Remove #include "oat_file.h" from class_linker.h ."Vladimir Marko
2016-10-05Remove #include "oat_file.h" from class_linker.h .Vladimir Marko
Refactor the OatClass and OatMethod related functions from ClassLinker to OatFile and ArtMethod, respectively. Refactor the remaining ClassLinker dependencies on OatFile to break the #include dependency and reduce incremental build times. Test: m test-art-host Change-Id: Iebc5b9f81b48fbcf79821cc827a5d7c4a0261bf6
2016-10-05Properly scope HLoopOptimization's allocator.Nicolas Geoffray
HOptimization classes do not get their destructor called, as they are arena objects. So the scope for the optimization allocator needs to be the Run method. Also anticipate bisection search breakage by adding HLoopOptimization to the list of recognized optimizations. Change-Id: I7770989c39d5700a3b6b0a20af5d4b874dfde111
2016-10-03A first implementation of a loop optimization framework.Aart Bik
Rationale: We are planning to add more and more loop related optimizations and this framework provides the basis to do so. For starters, the framework optimizes dead induction, induction that can be replaced with a simpler closed-form, and eliminates dead loops completely (either pre-existing or as a result of induction removal). Speedup on e.g. Benchpress Loop is 73x (17.5us. -> 0.24us.) [with the potential for more exploiting outer loop too] Test: 618-checker-induction et al. Change-Id: If80a809acf943539bf6726b0030dcabd50c9babc
2016-09-30Simplify our intrinsic recognizer.Nicolas Geoffray
- Use the modifiers for storing the intrinsic kind. - Delete dex_file_method_inliner and its associated map. This work was also motivated by the fact that the inline method analyzer leaks intrinsic tables, and even worse, might re-use a table from one dex file to another unrelated dex file in the presence of class unloading and the unlikely event of the dex files getting the same address. test: m test-art-host m test-art-target Change-Id: Ia653d2c72df13889dc85dd8c84997582c034ea4b
2016-09-29Clean up ScopedThreadStateChange to use ObjPtrMathieu Chartier
Also fixed inclusion of -inl.h files in .h files by adding scoped_object_access-inl.h and scoped_fast_natvie_object_access-inl.h Changed AddLocalReference / Decode to use ObjPtr. Changed libartbenchmark to be debug to avoid linkage errors. Bug: 31113334 Test: test-art-host Change-Id: I4d2e160483a29d21e1e0e440585ed328b9811483
2016-08-30ART: SHARED_REQUIRES to REQUIRES_SHAREDAndreas Gampe
This coincides with the actual attribute name and upstream usage. Preparation for deferring to libbase. Test: m Test: m test-art-host Change-Id: Ia8986b5dfd926ba772bf00b0a35eaf83596d8518