summaryrefslogtreecommitdiff
path: root/compiler/dex/quick
AgeCommit message (Collapse)Author
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-27Cleanup String.<init> handling. Nicolas Geoffray
Move everything to one place (currently well_known_classes.cc, but no strong preference) and define a macro to easily handle the list of affected methods. test: m test-art-host test: m test-art-target Change-Id: Ib8372d130d5458516a1f1ae31014afc76037fc34
2016-08-30ART: SHARED_REQUIRES to REQUIRES_SHARED Andreas 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
2016-08-01ART: Convert pointer size to enum Andreas Gampe
Move away from size_t to dedicated enum (class). Bug: 30373134 Bug: 30419309 Test: m test-art-host Change-Id: Id453c330f1065012e7d4f9fc24ac477cc9bb9269
2016-07-27ART: Delete old compiler_enums.h Andreas Gampe
Holdover from the Quick days. Move the two enums that are still used closer to the actual users (and prune no longer used cases). Test: m test-art-host Change-Id: I88aa49961a54635788cafac570ddc3125aa38262
2016-05-13Fix misc-macro-parentheses warnings. Chih-Hung Hsieh
* Add parentheses to fix warnings. * Use NOLINT to suppress wrong clang-tidy warnings. Bug: 28705665 Change-Id: Icc8bc9b59583dee0ea17ab83e0ff0383b8599c3e
2016-03-21Remove Quick from tree. Nicolas Geoffray
So long, old friend. Change-Id: I0241c798a34b92bf994fed83888da67d6e7f1891
2016-03-09Fix and enable java.lang.StringFactory intrinsics. Roland Levillain
The following intrinsics were not considered by the intrinsics recognizer: - StringNewStringFromBytes - StringNewStringFromChars - StringNewStringFromString This CL enables them and add tests for them. This CL also: - Fixes the locations of the ARM64 & MIPS64 StringNewStringFromString intrinsics. - Fixes the definitions of the FOUR_ARG_DOWNCALL macros on ARM and x86, which are used to implement the art_quick_alloc_string_from_bytes* runtime entry points. - Fixes PC info (stack maps) recording in the StringNewStringFromBytes, StringNewStringFromChars and StringNewStringFromString ARM, ARM64 & MIPS64 intrinsics. Bug: 27425743 Change-Id: I38c00d3f0b2e6b64f7d3fe9146743493bef9e45c
2016-03-07Unsafe: Recognize intrinsics for 1.8 java.util.concurrent Aart Bik
With unit test. Rationale: Recognizing the 1.8 methods as intrinsics is the first step towards providing efficient implementation on all architectures. Where not implemented (everywhere for now), the methods fall back to the JNI native or reference implementation. NOTE: needs iam's CL first! bug=26264765 Change-Id: Ife65e81689821a16cbcdd2bb2d35641c6de6aeb6
2016-03-01Merge "Fix the signature of the IndexOf entry point." Roland Levillain
2016-02-29Fix the signature of the IndexOf entry point. Roland Levillain
The IndexOf entry point was declared as taking four arguments (void*, uint32_t, uint32_t, uint32_t) whereas all actual implementations use three arguments (void*, uint32_t, uint32_t). As that fourth argument is not documented, drop it from the intrinsic declaration to have it match the implementations. Change-Id: I65d747033192025ccd2b9a5e8f8ed05b77a21941
2016-02-29Improve documentation about StringFactory.newStringFromChars. Roland Levillain
Make it clear that the native method requires its third argument to be non-null, and therefore that the intrinsics do not need a null check for it. Bug: 27378573 Change-Id: Id2f78ceb0f7674f1066bc3f216b738358ca25542
2016-02-26Implement fp to bits methods as intrinsics. Aart Bik
Rationale: Better optimization, better performance. Results on libcore benchmark: Most gain is from moving the invariant call out of the loop after we detect everything is a side-effect free intrinsic. But generated code in general case is much cleaner too. Before: timeFloatToIntBits() in 181 ms. timeFloatToRawIntBits() in 35 ms. timeDoubleToLongBits() in 208 ms. timeDoubleToRawLongBits() in 35 ms. After: timeFloatToIntBits() in 36 ms. timeFloatToRawIntBits() in 35 ms. timeDoubleToLongBits() in 35 ms. timeDoubleToRawLongBits() in 34 ms. bug=11548336 Change-Id: I6e001bd3708e800bd75a82b8950fb3a0fc01766e
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-18Remove string init map. Nicolas Geoffray
Partial revert of the String init change. - Make Quick bailout in the presence of String allocation. - Rely on the compiler for knowing when dex registers alias. bug:27173201 Change-Id: I0bf58ba3825c71cef110b53f3a0a6f567cb2ef9a
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-10Merge "Try to substitute constructor chains for IPUTs." Vladimir Marko
2016-02-09Try to substitute constructor chains for IPUTs. Vladimir Marko
Match a constructor chain where each constructor either forwards some or all of its arguments to the next (i.e. superclass constructor or a constructor in the same class) and may pass extra zeros (of any type, including null), followed by any number of IPUTs on "this", storing either arguments or zeros, until we reach the contructor of java.lang.Object. When collecting IPUTs from the constructor chain, remove any IPUTs that store the same field as an IPUT that comes later. This is safe in this case even if those IPUTs store volatile fields because the uninitialized object reference wasn't allowed to escape yet. Also remove any IPUTs that store zero values as the allocated object is already zero initialized. Change-Id: If93022310bf04fe38ee741665ac4a65d4c2bb25f
2016-02-08Move code related to debug info generation to its own directory. David Srbecky
debug/dwarf/ contains helper classes which hide the details of the DWARF file format. It acts as independent DWARF library. debug/ contains ART-specific code which generates ELF debug sections (which includes non-DWARF sections like .symtab). Change-Id: Id351f604e4e64be2ca395a78324ea02e30481497
2016-01-29MIPS64: Remove unaligned memory access from art generated code Lazar Trsic
Unaligned memory access was caused by sd, ld, ldc1 and sdc1 instructions. Check if offset is unaligned and replace it with two 32 bit memory accesses, if so. Added assembler tests for new instructions, as well as assembler tests for LoadFromOffset, LoadFpuFromOffset, StoreToOffset and StoreFpuToOffset. Change-Id: I0228a4a2ce6c801eeb5b46952b8330e14468deb3
2016-01-28Merge "ART: Add option to ensure deterministic compilation" Andreas Gampe
2016-01-27ART: Add option to ensure deterministic compilation Andreas Gampe
To ensure reliable stable generation of a boot image, add a flag for forced determinism, trading compile time for a deterministic output. We have to run certain passes in the compiler-driver single-threaded. It is also necessary to try to make the heap layout deterministic. Switch to nonconcurrent GC, use the free-list implementation for LOS, and try to allocate the main space at a known location. This is best effort at the moment. To allow the compiler phase to be parallelized, const-strings need to be created beforehand. The identity hashcode seed needs to be pinned. Besides the Dex object we also need to null the DexFile pointer in dex caches. For classes, we need to remove the clinit thread ID. Fix oatdump alignment padding accounting. Bug: 26687569 Change-Id: Ia82120e8f715bb3691d861817b12778ac677355a
2016-01-27Merge "Revert "Revert "Add option to generate compressed backtrace info.""" David Srbecky
2016-01-26Merge "Recognize common utilities as intrinsics." Aart Bik
2016-01-26Enable interface default methods by default. Neil Fuller
This also enables interface static methods. This removes the -Xexperimental:default-methods flag and all places where we explicitly check for its presence. Bug: 24618811 Change-Id: Icd91e377bd6e1a45a1645f810d15de1b0312e31d
2016-01-26Recognize common utilities as intrinsics. Aart Bik
Rationale: Recognizing these method calls as intrinsics already has major advantages (compiler knows about no-side-effects/no-throw properties). Next step is, of course, to implement these with native instructions on each architecture. Change-Id: I06fd12973238caec00d67b31b195d7f8807a538e
2016-01-26Revert "Revert "Add option to generate compressed backtrace info."" David Srbecky
This reverts commit 8546cc9aeb05e866e1fb6a9e4130d53ea330baa8. Change-Id: I676fdf9af27fa3b16fa8921778ff8832ab8c437d
2016-01-25Revert "Add option to generate compressed backtrace info." David Srbecky
This reverts commit 5fdcc3c931b70204fd8c491afa66f57f8428490f. Change-Id: I9c1f5aad6933a46af6717e3a90a51f76111f9c8a
2016-01-22Add option to generate compressed backtrace info. David Srbecky
Add flag --generate-mini-debug-info which generates LZMA compressed .symtab and .debug_frame, which are sufficient to print java backtraces in libunwind. If enabled, it increases the size of boot.oat by about 3.5%. Change-Id: Ic3c2ef7704c05fa328720c6781ca2a9b8e3935a3
2016-01-20Implemented BitCount as an intrinsic. With unit test. Aart Bik
Rationale: Recognizing this important operation as an intrinsic has various advantages: (1) having the no-side-effects/no-throw allows for much more GVN/LICM/BCE. (2) Some architectures, like x86_64, provide direct support for this operation. Performance improvements on X86_64: CheckersEvalBench (32-bit bitboard): 27,210KNS -> 36,798KNS = + 35% ReversiEvalBench (64-bit bitboard): 52,562KNS -> 89,086KNS = + 69% Change-Id: I65d549b0469b7909b12c6611cdc34a8640a5751f
2016-01-19Fix various typos in ART's comments and string literals. Roland Levillain
Change-Id: I85d628055b1a61647a77fef730c9631c234e22a2
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-14Merge "Support directly invoking interface default methods" Alex Light
2016-01-12Support directly invoking interface default methods Alex Light
With the Java 8 Language one is allowed to directly call default interface methods of interfaces one (directly) implements through the use of the super keyword. We support this behavior through the invoke-super opcode with the target being an interface. We add 3 tests for this behavior. Currently only supports slow-path interpreter. Invoke-super is currently extremely slow. Bug: 24618811 Change-Id: I7e06e17326f7dbae0116bd7dfefca151f0092bd2
2016-01-07Perform profile file analysis in dex2oat Calin 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-28ART: Disable Math.round intrinsics Andreas Gampe
The move to OpenJDK means that Android has caught up with the definition change of Math.round. Disable intrinsics. Bug: 26327751 Change-Id: I00dc6cfca12bd7c95e56a4ab76ffee707d3822dc
2015-12-28Revert "Make Math.round consistent on arm64." Andreas Gampe
This reverts commit 40041c9a38e3961d8675d117517719458a115520. Needs to be generalized to all platforms. Bug: 26327751 Change-Id: Iae8f1c8846d120d8e3e99b6eb87f3760bf793ec5
2015-12-27Make Math.round consistent on arm64. Nicolas Geoffray
OpenJDK seems to have a different rounding implementation than libcore. Temporarily disable the intrinsic. Test that fails: Assert.assertEquals(StrictMath.round(0.49999999999999994d), 1l); Assert.assertEquals(Math.round(0.49999999999999994d), 1l); bug:26327751 Change-Id: Iad2fb847e4a553b8c1f5031f772c81e7e4db9f4c
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 "X86: Use locked add rather than mfence"" Mark P Mendell
This reverts commit 0da3b9117706760e8722029f407da6d0297cc943. Fix a compilation failure that slipped in somehow. Change-Id: Ide8681cdc921febb296ea47aa282cc195f154049
2015-12-16Revert "X86: Use locked add rather than mfence" Aart Bik
This reverts commit 7b3e4f99b25c31048a33a08688557b133ad345ab. Reason: build error on sdk (linux) in git_mirror-aosp-master-with-vendor , please fix first art/compiler/optimizing/code_generator_x86_64.cc:4032:7: error: use of undeclared identifier 'codegen_' codegen_->MemoryFence(); Change-Id: I91f8542cfd944b7425d1981c35872dcdcb901e18
2015-12-15X86: Use locked add rather than mfence Mark Mendell
Java semantics for memory ordering can be satisfied using lock addl $0,0(SP) rather than mfence. The locked add synchronizes the memory caches, but doesn't affect device memory. Timing on a micro benchmark with a mfence or lock add $0,0(sp) in a loop with 600000000 iterations: time ./mfence real 0m5.411s user 0m5.408s sys 0m0.000s time ./locked_add real 0m3.552s user 0m3.550s sys 0m0.000s Implement this as an instruction-set-feature lock_add. This is off by default (uses mfence), and enabled for atom & silvermont variants. Generation of mfence can be forced by a parameter to MemoryFence. Change-Id: I5cb4fded61f4cbbd7b7db42a1b6902e43e458911 Signed-off-by: Mark Mendell <mark.p.mendell@intel.com>
2015-12-11Revert "Revert "Enable profiled guided compilation in dex2oat"" Calin Juravle
This reverts commit 2306ae0d412cc53cbf64877e4a8c37292dd907d8. Change-Id: I50640009c2fac88ea703812b76549a0e8a6d7584
2015-12-11Merge "Revert "Enable profiled guided compilation in dex2oat"" Calin Juravle
2015-12-11Revert "Enable profiled guided compilation in dex2oat" Calin Juravle
The test still have some flakiness in it which didn't reproduce locally. This reverts commit 500c9be1f261a8a95ae7a25f4f8084f43207f313. Change-Id: I132aff62bf03c2f926aafde6869707573bae9b36
2015-12-11Merge "Enable profiled guided compilation in dex2oat" Calin Juravle
2015-12-10Optimizing: Add direct calls to math intrinsics Mark Mendell
Support the double forms of: cos, sin, acos, asin, atan, atan2, cbrt, cosh, exp, expm1, hypot, log, log10, nextAfter, sinh, tan, tanh Add these entries to the vector addressed off the thread pointer. Call the libc routines directly, which means that we have to implement the native ABI, not the ART one. For x86_64, that includes saving XMM12-15 as the native ABI considers them caller-save, while the ART ABI considers them callee-save. We save them by marking them as used by the call to the math function. For x86, this is not an issue, as all the XMM registers are caller-save. Other architectures will call Java as before until they are ready to implement the new intrinsics. Bump the OAT version since we are incompatible with old boot.oat files. Change-Id: Ic6332c3555c09393a17d1ad4daf62932488722fb Signed-off-by: Mark Mendell <mark.p.mendell@intel.com>
2015-12-10Enable profiled guided compilation in dex2oat Calin Juravle
- add parsing of the profile info saved during JIT. - don't compile methods which are not part of the profile info. - delete old profile hooks. - add test for reading/writing profile. The test is disable in: * interpreter modes: the test needs JIT. * no-dex2oat/no-prebuild: we only save profiling info for the primary oat file. In these modes we don't create oat files and thus nothing is saved. Bug:26080105 Change-Id: Ifdc63dc9d4b537fc79e54c3edc3ae3a462bc30fb
2015-12-02Revert "Enable profiled guided compilation in dex2oat" Nicolas Geoffray
Test has flakes: +art F 30865 30865 art/runtime/java_vm_ext.cc:466] JNI DETECTED ERROR IN APPLICATION: input is not valid Modified UTF-8: illegal start byte 0x80 +art F 30865 30865 art/runtime/java_vm_ext.cc:466] string: '��gy�' +art F 30865 30865 art/runtime/java_vm_ext.cc:466] input: '<0x80> 0xd8 0x67 0x79 0x8e 0x7f' +art F 30865 30865 art/runtime/java_vm_ext.cc:466] in call to NewStringUTF +art F 30865 30865 art/runtime/java_vm_ext.cc:466] from java.lang.String Main.getProfileInfoDump(java.lang.String, java.lang.Class, java.lang.Class) This reverts commit 27e17fd81cc30e16e86c9c15498cae7f920c9dfe. Change-Id: Id224b5970c3620c4c71fc0d39ed4a2e4755e5f29