summaryrefslogtreecommitdiff
path: root/compiler/common_compiler_test.cc
AgeCommit message (Collapse)Author
2016-09-30Merge "Store resolved Strings for AOT code in .bss."Vladimir Marko
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-09-29Store resolved Strings for AOT code in .bss.Vladimir Marko
And do some related refactorings. Bug: 20323084 Bug: 30627598 Test: Run ART test suite including gcstress on host and Nexus 9. Test: Run ART test suite including gcstress with baker CC on host and Nexus 9. Test: Build aosp_mips64-eng. Change-Id: I1b12c1570fee8e5da490b47f231050142afcbd1e
2016-09-23Smarter image layoutMathieu Chartier
Put strings in the dex file that resolves them. Depth first traversal with overrides for class and dex cache. The work list keeps track of what oat_index with each pushed item. This means the static fields of a class will usually be in the same image. Added layout test to image_test to make sure things are somewhat reasonably attributed. Bug: 28640955 Test: test-art-host (cherry picked from commit 4e9c4e746617bad6a012d799d2f5cf9e01d24ea2) Change-Id: I67a536c33aeed603b252d8e0f75622c9efbf2559
2016-08-01ART: Convert pointer size to enumAndreas Gampe
Move away from size_t to dedicated enum (class). Bug: 30373134 Bug: 30419309 Test: m test-art-host Change-Id: Id453c330f1065012e7d4f9fc24ac477cc9bb9269
2016-04-28Revert "Revert "Write conflict tables in image""Mathieu Chartier
Added test. Bug: 27906566 This reverts commit 8e2478d23e89a7022c93ddc608dcbba7b29b91e6. (cherry picked from commit cdca476bf3394ce9d97a369e84e701b427009318) Change-Id: Ia94fc7acc7ae3879921c4e8d0a02b156037ac286
2016-04-07Fix image_test for the CC collector.Hiroshi Yamauchi
Increase the image address space reserve. Bug: 27578460 Change-Id: I262f6be81c496a7a777013702e3da74ea4d619b4
2016-04-04Clean up OatQuickMethodHeader after Quick removal.Vladimir Marko
This reduces the size of the pre-header by 8 bytes, reducing oat file size and mmapped .text section size. The memory needed to store a CompiledMethod by dex2oat is also reduced, for 32-bit dex2oat by 8B and for 64-bit dex2oat by 16B. The aosp_flounder-userdebug 32-bit and 64-bit boot.oat are each about 1.1MiB smaller. Disable the broken StubTest.IMT, b/27991555 . Change-Id: I05fe45c28c8ffb7a0fa8b1117b969786748b1039
2016-03-21Remove Quick from tree.Nicolas Geoffray
So long, old friend. Change-Id: I0241c798a34b92bf994fed83888da67d6e7f1891
2016-03-09ART: Use optimizing compiler in image_testAndreas Gampe
Expose some compiler options so we can run the image test with the optimizing compiler without running into a stack overflow. Also allow a variable amount of threads in CreateCompilerDriver. Use 16 as a middle ground on the host to speed up the otherwise now slowed-down test. Bug: 27240085 Bug: 27552475 Change-Id: I8db5055d32ae722c8f430903244faa9166cc4886
2016-02-24ART: Allow method references across oat files for multi-image, 2nd attempt.Vladimir Marko
These were disabled because we didn't have sufficient information about the multi-image layout when processing link-time patches in OatWriter. This CL refactors the ELF file creation so that the information is available. Also clean up ImageWriter to use oat file indexes instead of filenames and avoid reopening the oat file to retrieve the checksum. Change-Id: Icc7b528deca29da1e473c8f079521a36d6c4892f
2016-02-17Revert "Allow method references across oat files for multi-image."Vladimir Marko
Breaks Quick tests. This reverts commit 6065402316da2b51eed5fc34cffbd991766bd408. Change-Id: I8a5469ba7cea5f46b85cb489b3e0ef06ed548f03
2016-02-17Allow method references across oat files for multi-image.Vladimir Marko
These were disabled because we didn't have sufficient information about the multi-image layout when processing link-time patches in OatWriter. This CL refactors the ELF file creation so that the information is available. Change-Id: I6f2e8dc8572d143c72cc2693bb0ba4fd76f889ab
2016-02-01Ensure instruction cache is flushed in compiler tests with Clang.Roland Levillain
Invoke __builtin___clear_cache with Clang in art::CommonCompilerTest::MakeExecutable. This fixes "Illegal instruction" failures in codegen_test on angler. Factor this logic in a function and use it in art::jit::JitCodeCache::CommitCodeInternal too. Bug: 26786447 Change-Id: I81fa056c8d7c6bf2168c9340deeab82231cb1084
2016-01-19Merge "Improve profile processing"Calin Juravle
2016-01-19Improve profile processingCalin Juravle
- allow file descriptors in addition to file names for profiles - fix some minor issues (wrong comparison signs, unhandled errors) - added gtests for profile_compilation_info, profile_assistant and compiler_driver Bug: 26080105 Change-Id: I136039fa1f25858399000049e48b01eafae54eb1
2016-01-18Move --dump-cfg and dump-cfg-append to CompilerOptions.Nicolas Geoffray
It simplifies passing the option to the JIT. Change-Id: Iee1b722362899e5809ef97be90961e3dda1e16cc
2016-01-07Perform profile file analysis in dex2oatCalin Juravle
Dex2oat can accept now multiple profile files to drive a profile based compilation. --profile-file and --reference-profile-file speficy a pair of profile files which will be evaluated for significant differences before starting the compilation. If the difference is insignificant (according to some internal metric) the compilation is skipped and a message is logged. Multiple pairs of --profile-file and --reference-profile-file can be specified. This effectively enables multi user support since profiles for different users will be kept separately. --reference-profile-file can be left out, case in which the decision is solely based on --profile-file. If both flags are present, then their repetition should form unique pairs. If the compilation is performed and --reference-profile-file is given then its data is merged with the data from the corresponding --profile- file and saved back to the file. If no profile flags are given, dex2oat proceeds as before and compiles the dex files unconditionally. As part of this change - merge ProfileCompilationInfo and OfflineProfilingInfo under the same object. There was no use to keep them separate anymore. - SaveProfilingInfo now merges the data with what was in the file before instead of overwriting it. Bug: 26080105 Change-Id: Ia8c8b55587d468bca5179f78941854285426234d
2015-12-23Dex2oat support for multiple oat file and image file outputs.Jeff Hao
Multiple changes to dex2oat and the runtime to support a --multi-image option. This generates a separate oat file and image file output for each dex file input. Change-Id: Ie1d6f0b8afa8aed5790065b8c2eb177990c60129
2015-12-16Revert "Revert "Combine direct_methods_ and virtual_methods_ fields of ↵Alex Light
mirror::Class"" This reverts commit ae358c1d5cef227b44d6f4971b79e1ab91aa26eb. Bug: 24618811 Change-Id: I8becf9bae3258450b90cfef5e79589db7c535a4d
2015-12-15Revert "Combine direct_methods_ and virtual_methods_ fields of mirror::Class"Alex Light
This reverts commit 6286a97bea0f584342803a215550038852b24776. Change-Id: I5b00f6d1350e9c587acd4b185367dc815ea707de
2015-12-14Combine direct_methods_ and virtual_methods_ fields of mirror::ClassAlex Light
This makes several parts of the overall runtime simpler and reduces the size of a class object by 32-bits. Bug: 24618811 Change-Id: I36129b52189e26898ea56fa2b7b45652e06af236
2015-12-10Revert "Revert "Add support for LZ4 compressed image files""Mathieu Chartier
Needed to call compiler_driver_->SetSupportBootImageFixup(false). Bug: 22858531 This reverts commit 83d4d72aa0e4170209ab50c67ba22e46b71352c1. Change-Id: Iaed6a810a0c088f1f2c57cf2f12087f3978a3de1
2015-12-10Revert "Add support for LZ4 compressed image files"Nicolas Geoffray
Tentative. Looks like it breaks image_test for hammerhead: art/compiler/linker/arm/relative_patcher_thumb2.cc:36] Check failed: target_offset & 1u == 1u (target_offset & 1u=0, 1u=1) Bug: 22858531 This reverts commit c6f41b5b3ca3d7ac3c12ad3995ffef4e831973a0. Change-Id: I9bc5738a8b5c8f8bc8b73309f9420fd691bc79a9
2015-12-09Add support for LZ4 compressed image filesMathieu Chartier
Added dex2oat option --image-format=(store|lz4). Using lz4 means that the main image section (all data other than header and bitmap) are stored in a compressed state. N5 results: Boot image size: 8067128 -> 2827605 Decompression time 18.93ms Decompression rate: 426MB/s Patchoat is not currently supported since it maps the source image directly. In order to support compressed images we would need to recompress the output image and then write it back out to a file. Also there are not many cases where we would want to patch a compressed image since they are going to be dirty memory when uncompressed anyways. Might as well just patch as we are loading. Bug: 22858531 Change-Id: I8c54ccf73408273011161a61bb891736735074d9
2015-11-15x86/x86-64 read barrier support for concurrent GC in Optimizing.Roland Levillain
This first implementation uses slow paths to instrument heap reference loads and GC root loads for the concurrent copying collector, respectively calling the artReadBarrierSlow and artReadBarrierForRootSlow (new) runtime entry points. Notes: - This implementation does not instrument HInvokeVirtual nor HInvokeInterface instructions (for class reference loads), as the corresponding read barriers are not stricly required with the current concurrent copying collector. - Intrinsics which may eventually call (on slow path) are disabled when read barriers are enabled, as the current slow path infrastructure does not support this case. - When read barriers are enabled, the code generated for a HArraySet instruction always go into the array set slow path for object arrays (delegating the operation to the runtime), as we are lacking a mechanism to keep a temporary register live accross a runtime call (needed for the instrumentation of type checking code, which requires two successive read barriers). Bug: 12687968 Change-Id: I14cd6107233c326389120336f93955b28ffbb329
2015-10-27Revert "Remove DCHECK that does not work for gtests."Vladimir Marko
And fix the code alignment in gtests. This reverts commit 7d32dbc02beac2cb0217d52b61f2b3ef9974ffa6. Change-Id: I68813c36d1493f2746ceb129b30a649350d6bc13
2015-10-27Reduce memory used by CompiledMethods.Vladimir Marko
Use LengthPrefixedArray<>s instead of SwapVector<>s to store CompiledMethod data and get rid of the unnecessary members of CompiledMethod to reduce dex2oat memory usage. Refactor the deduplication from CompilerDriver to a new class. Use HashSet<> instead of std::set<> for the DedupeSet<> to further decrease the memory usage and improve performance. This reduces the dex2oat memory usage when compiling boot image on Nexus 5 (with Optimizing, -j1) by ~6.75MiB (5%). This also reduces the compile time by ~2.2% (~1.6% dex2oat time; with Optimizing, without -j). Change-Id: I974f1f5e58350de2bf487a2bca3907fa05fb80ea
2015-10-20Remove ArtCode.Nicolas Geoffray
- Instead use OatQuickMethodHeader. - Various cleanups now that we don't have all those ArtMethod -> ArtCode -> OatQuickMethodHeader indirections. As a consequence of this cleanup, exception handling got a bit faster. ParserCombinators benchmark (exception intensive) on x64: (lower is better) Before: ParserCombinators(RunTime): 1062500.0 us. After: ParserCombinators(RunTime): 833000.0 us. Change-Id: Idac917b6f1b0dc254ad68fb3781cd61bccadb0f3
2015-09-15Add option to append to the cfg dump.Calin Juravle
This makes life easier when verifying tests with unresolved classes (which call dex2oat at rutime). Change-Id: I7985b2b7c0f343462e03a26b8395297c810b1d95
2015-06-30Make compiler-related gtests honor ART_USE_OPTIMIZING_COMPILER.Roland Levillain
Previously, gtests using the art::CommonCompilerTest class were using Quick as compiler. Now, setting the environment variable ART_USE_OPTIMIZING_COMPILER to `true` before building and running these tests will use Optimizing instead. Change-Id: I724a3215d2eb1841089745fbabb5cb58b0422ef3
2015-05-29Move mirror::ArtMethod to nativeMathieu Chartier
Optimizing + quick tests are passing, devices boot. TODO: Test and fix bugs in mips64. Saves 16 bytes per most ArtMethod, 7.5MB reduction in system PSS. Some of the savings are from removal of virtual methods and direct methods object arrays. Bug: 19264997 Change-Id: I622469a0cfa0e7082a2119f3d6a9491eb61e3f3d
2015-04-22Replace NULL with nullptrMathieu Chartier
Also fixed some lines that were too long, and a few other minor details. Change-Id: I6efba5fb6e03eb5d0a300fddb2a75bf8e2f175cb
2015-04-21ART: Add compiled-methodsAndreas Gampe
Add a dex2oat option for compiled-methods, a more granular filter than compiled-classes. Add compiler-driver support for it. Refactor dex2oat to reuse file reading. Add a test to oat_test. Change-Id: I78d0d040bce7738b4bb7aabe7768b5788d2587ac
2015-04-20ART: Change image_classes and compiled_classes to unordered setAndreas Gampe
These lists can be large, and the soon-to-follow compiled_methods will be potentially even larger. Use a hash set instead of a tree set. Change-Id: I7d25c075540f47771354c6f49928b4fd0c76eb2e
2015-03-31Merge "Fixed layout for dex caches in boot image."Vladimir Marko
2015-03-31Fixed layout for dex caches in boot image.Vladimir Marko
Define a fixed layout for dex cache arrays (type, method, string and field arrays) for dex caches in the boot image. This gives those arrays fixed offsets from the boot image code and allows PC-relative addressing of their elements. Use the PC-relative load on arm64 for relevant instructions, i.e. invoke-static, invoke-direct, const-string, const-class, check-cast and instance-of. This reduces the arm64 boot.oat on Nexus 9 by 1.1MiB. This CL provides the infrastructure and shows on the arm64 the gains that we can achieve by having fixed dex cache arrays' layout. To fully use this for the boot images, we need to implement the PC-relative addressing for other architectures. To achieve similar gains for apps, we need to move the dex cache arrays to a .bss section of the oat file. These changes will be implemented in subsequent CLs. (Also remove some compiler_driver.h dependencies to reduce incremental build times.) Change-Id: Ib1859fa4452d01d983fd92ae22b611f45a85d69b
2015-03-29ART: Refactor callbacks_ in common_runtime_testAndreas Gampe
The callback is now important for some runtime checks, and just resetting callbacks_ is not correct anymore. Change-Id: I2cb806f1916fd5ea190911a833ce460be557a428
2015-03-27ART: Some runtime cleanupAndreas Gampe
Use an enum for the compiler-callback mode. Refactor and remove some unnecessary includes in runtime.h. Change-Id: If2245fa470171311b8e05b677cf6bb28f209585a
2015-03-27ART: PathClassLoader for compilerAndreas Gampe
Use an actual PathClassLoader when compiling apps, instead of a side structure and cutout. This CL sets up a minimal object 'cluster' that recreates the Java side of a regular ClassLoader such that the Class-Linker will recognize it and use the internal native fast-path. This CL removes the now unnecessary compile-time-classpath and replaces it with a single 'compiling-the-boot-image' flag in the compiler callbacks. Note: This functionality is *only* intended for the compiler, as the objects have not been completely initialized. Bug: 19781184 Change-Id: I7f36af12dd7852d21281110a25c119e8c0669c1d
2015-03-02Add support for .bss section in oat files.Vladimir Marko
Change-Id: I779b80b8139d9afdc28373f8c68edff5df7726ce
2015-02-24Revert "Revert "Add JIT""Mathieu Chartier
Added missing EntryPointToCodePointer. This reverts commit a5ca888d715cd0c6c421313211caa1928be3e399. Change-Id: Ia74df0ef3a7babbdcb0466fd24da28e304e3f5af
2015-02-24Revert "Add JIT"Nicolas Geoffray
Sorry, run-test crashes on target: 0-05 12:15:51.633 I/DEBUG (27995): Abort message: 'art/runtime/mirror/art_method.cc:349] Check failed: PcIsWithinQuickCode(reinterpret_cast<uintptr_t>(code), pc) java.lang.Throwable java.lang.Throwable.fillInStackTrace() pc=71e3366b code=0x71e3362d size=ad000000' 10-05 12:15:51.633 I/DEBUG (27995): r0 00000000 r1 0000542b r2 00000006 r3 00000000 10-05 12:15:51.633 I/DEBUG (27995): r4 00000006 r5 b6f9addc r6 00000002 r7 0000010c 10-05 12:15:51.633 I/DEBUG (27995): r8 b63fe1e8 r9 be8e1418 sl b6427400 fp b63fcce0 10-05 12:15:51.633 I/DEBUG (27995): ip 0000542b sp be8e1358 lr b6e9a27b pc b6e9c280 cpsr 40070010 10-05 12:15:51.633 I/DEBUG (27995): Bug: 17950037 This reverts commit 2535abe7d1fcdd0e6aca782b1f1932a703ed50a4. Change-Id: I6f88849bc6f2befed0c0aaa0b7b2a08c967a83c3
2015-02-23Add JITMathieu Chartier
Currently disabled by default unless -Xjit is passed in. The proposed JIT is a method JIT which works by utilizing interpreter instrumentation to request compilation of hot methods async during runtime. JIT options: -Xjit / -Xnojit -Xjitcodecachesize:N -Xjitthreshold:integervalue The JIT has a shared copy of a compiler driver which is accessed by worker threads to compile individual methods. Added JIT code cache and data cache, currently sized at 2 MB capacity by default. Most apps will only fill a small fraction of this cache however. Added support to the compiler for compiling interpreter quickened byte codes. Added test target ART_TEST_JIT=TRUE and --jit for run-test. TODO: Clean up code cache. Delete compiled methods after they are added to code cache. Add more optimizations related to runtime checks e.g. direct pointers for invokes. Add method recompilation. Move instrumentation to DexFile to improve performance and reduce memory usage. Bug: 17950037 Change-Id: Ifa5b2684a2d5059ec5a5210733900aafa3c51bca
2015-01-28Clean up pass driverMathieu Chartier
Added pass manager to hold the state which used to be in global variables. Static variables caused issues with Runtime.exit since they are destroyed by the global destructors while threads are still executing. Bug: 17950037 Change-Id: Ie0e4546dc9e48909c8df996a5c135be682d50044
2015-01-13ART: dex2oat flag for HGraphVisualizer dump fileDavid Brazdil
This patch adds a new '--dump-cfg=<file>' flag to dex2oat which specifies the file that HGraphVisualizer will store its output into. Until now the graph was dumped to 'art.cfg' in the current working directory. To make Checker work with run-test, the output directory needs to be customizable. Change-Id: I4a940f7708b88deea5a0e51d13aed13e52199349
2014-12-22ART: Fix common_compiler_test assumptionsAndreas Gampe
JNI-compiled methods now do not have mapping tables or GC maps, not even zero-sized. Update the code in common_compiler_test. Bug: 18596910 Change-Id: If22bf1b2e369273148f060b0b1ffc02b2b1ef608
2014-12-22ART: Swap-space in the compilerAndreas Gampe
Introduce a swap-space and corresponding allocator to transparently switch native allocations to memory backed by a file. Bug: 18596910 (cherry picked from commit 62746d8d9c4400e4764f162b22bfb1a32be287a9) Change-Id: I131448f3907115054a592af73db86d2b9257ea33
2014-12-12Remove portable.Elliott Hughes
Change-Id: I3bf3250fa866fd2265f1b115d52fa5dedc48a7fc