summaryrefslogtreecommitdiff
path: root/compiler/utils
AgeCommit message (Collapse)Author
2018-12-04Merge "Add support for ANDROID_RUNTIME_ROOT variable" Neil Fuller
2018-12-03Add support for ANDROID_RUNTIME_ROOT variable Neil Fuller
This commit introduces the ANDROID_RUNTIME_ROOT environment variable in preparation for its use within the runtime module. As a module, ART must no longer use the Android-wide ANDROID_ROOT environment variable as the base of default paths for module content. ANDROID_RUNTIME_ROOT will take over the responsibility. It remains a variable to unify host and device treatment. Some test methods (SetUpAndroidData, TearDownAndroidData SetUpAndroidRoot) have been renamed to clarify their purpose. Bug: 119935277 Test: build / treehugger Change-Id: I7c7de52911cbfa56cef90270425ed369176c4767
2018-12-03ART: ARM64: Pass ISA features to VIXL macroassembler. Artem Serov
VIXL macroassembler should be initialized properly to support Armv8.X features in order to emit corresponding instructions. Test: codegen_test.cc, relative_patcher_arm64_test. Test: test-art-host, test-art-target. Change-Id: I2f9e155c28b4d2252a3cfb19717f5d25824d5e11
2018-11-06Enable building art and tests with linux_bionic Alex Light
A linux_bionic built runtime can be created by modifying the $OUT_DIR/soong/soong.config json file to add a '"Host_bionic": true' entry and then running the following command: % m --skip-make $OUT_DIR/soong/host/linux_bionic-x86/<target-file> A script 'tools/build_linux_bionic_tests.sh' was also added that will build linux-bionic versions of host-test related files. Also modify tests so they can be run. Currently all run-tests pass when run on a linux_bionic host build. All gtests pass except for the following 9 tests: ArmVIXLAssemblerTest.VixlJniHelpers ArmVIXLAssemblerTest.VixlLoadFromOffset ArmVIXLAssemblerTest.VixlStoreToOffset DwarfTest.DebugFrame DwarfTest.DebugFrame64 DwarfTest.x86_64_RegisterMapping DwarfTest.DebugLine DwarfTest.DebugLineSpecialOpcodes DwarfTest.DebugInfo Since these tests must be run manually without the standard (makefile-based) testrunner it's not clear yet whether these failures are important or what must be done to fix them. Several tests had dependencies on the actual location of the libart library that needed to be fixed, these tests might as well. Test: ./tools/build_linux_bionic_tests.sh Test: ./test/testrunner/testrunner.py --no-build --host --64 --run-test-option=--bionic Test: find $OUT_DIR/soong/host/linux_bionic-x86/nativetest64 -mindepth 2 -type f | while read abc; do $abc; done | tee all-tests.txt Test: tail -n +0 -f all-tests.txt | grep FAILED Bug: 31559095 Bug: 118778408 Change-Id: I5fae4e54371e7410678619f18fcb54a3bd34e9b0
2018-10-24Add support for vex coding scheme in x86 assembler Shalini Salomi Bodapati
This patch adds support to emit VEX prefix which is needed to emit instructions namely andn, blsmsk, blsr, blsi on a cpu that has AVX2. Test: ./test.py --host --64, test-art-host-gtest Change-Id: I6b4902caf8560e4406c5053b142686ed28ba5404 Signed-off-by: Shalini Salomi Bodapati <shalini.salomi.bodapati@intel.com>
2018-10-22Cache the value of MterpShouldSwitchInterpreters() David Srbecky
Add field to the Thread object which stores the value instead (negated). Explicitly update the field when relevant state changes (which is rare). This speeds up golem interpreter benchmarks by 3.5% on average with some benchmarks up to 15% faster. Test: test.py -b -r --interpreter --host Change-Id: If2df0d3bf9e69ab50c30102b2648e997927c34d8
2018-09-25Merge "Revert^2 "ART: Refactor typedef to using"" Treehugger Robot
2018-09-20ART: Modernize counting-down loops Andreas Gampe
Preparation for readability-implicit-bool-conversion. Bug: 32619234 Test: WITH_TIDY=1 mmma art Change-Id: I7a6f9636d5f4537020f99e8cf8560f7f6b6b7ba0
2018-09-20Revert^2 "ART: Refactor typedef to using" Andreas Gampe
This reverts commit ee07743e03042c2ca36e0c9513847a9e7d2509f1. Reason for revert: fixed attributes. Bug: 32619234 Test: m test-art-host Test: m test-art-target-gtest-unstarted_runtime_test Change-Id: I6f0a775adfdf6ecd132b470f7c5446e949872e20
2018-09-20Revert "ART: Refactor typedef to using" Andreas Gampe
This reverts commit 9a20ff06f7ccee08a742c315ec6d351ab56ba1cd. Reason for revert: Attributes on the wrong side. Bug: 32619234 Change-Id: I8fd2abef619b22c02ccfbf5ae629339f1a60918b
2018-09-19ART: Refactor typedef to using Andreas Gampe
Add clang-tidy's modernize-use-using. Bug: 32619234 Test: WITH_TIDY=1 mmma art Change-Id: If50d37b5152af4270784e3cde7951292a9e19033
2018-09-07ART: Continue adding override annotations Andreas Gampe
Use Clang-tidy's modernize-use-override to add more annotations. Ignore inferred annotations on destructors. Bug: 32619234 Test: mmma art Change-Id: Ic432c928e398d44df9171e42db04ee19946e6887
2018-08-28Remove 'virtual' and 'override' qualifiers on final methods. Roland Levillain
Cpplint considers that 'virtual' and 'override' qualifers are redundant for methods declared 'final'. Test: mmma art Change-Id: If4de1e1fe306f2ee3db9534930b1d24abeaf9fe4
2018-08-28Remove superfluous 'virtual' specifiers in ART. Roland Levillain
Remove 'virtual' specifier on methods already bearing the 'override' specifier. Test: mmma art Change-Id: I114930969a5ca048d88de9ecd18e2c6403593e31
2018-08-28Use 'final' and 'override' specifiers directly in ART. Roland Levillain
Remove all uses of macros 'FINAL' and 'OVERRIDE' and replace them with 'final' and 'override' specifiers. Remove all definitions of these macros as well, which were located in these files: - libartbase/base/macros.h - test/913-heaps/heaps.cc - test/ti-agent/ti_macros.h ART is now using C++14; the 'final' and 'override' specifiers have been introduced in C++11. Test: mmma art Change-Id: I256c7758155a71a2940ef2574925a44076feeebf
2018-08-21Remove unnecessary indirection from MemMap. Vladimir Marko
Avoid plain MemMap pointers being passed around by changing the MemMap to moveable and return MemMap objects by value. Previously we could have a valid zero-size MemMap but this is now forbidden. MemMap::RemapAtEnd() is changed to avoid the explicit call to munmap(); mmap() with MAP_FIXED automatically removes old mappings for overlapping regions. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Test: Pixel 2 XL boots. Test: m test-art-target-gtest Test: testrunner.py --target --optimizing Change-Id: I12bd453c26a396edc20eb141bfd4dad20923f170
2018-07-19ART: Clean up unused using declarations Andreas Gampe
Make tidy happy, and enable checking. Test: mmma art Change-Id: I9e18e80b3f37dd2aeb8ecd1c25abe4d5cf2f1c45
2018-07-13Merge "Revert "Emit vector mulitply and accumulate instructions for x86."" Hans Boehm
2018-07-13Revert "Emit vector mulitply and accumulate instructions for x86." Hans Boehm
This reverts commit 61908880e6565acfadbafe93fa64de000014f1a6. Reason for revert: By failing to round multiply results, it does not follow Java rounding rules. Change-Id: Ic0ef08691bef266c9f8d91973e596e09ff3307c6
2018-07-10Don't use StringFactory.newEmptyString in compiled code Alex Light
When compiling debuggable code we would compile a new-instance String instruction into a StringFactory.newEmptyString invoke. This additional invoke could be observed using tracing and is inconsistent with the interpreter, where the string is simply allocated directly. In order to bring these two modes into alignment we added a new AllocStringObject quick entrypoint that will be used instead of the normal AllocObject<...> entrypoints when allocating a string. This entrypoint directly allocates a new string in the same manner the interpreter does. Needs next CL for test to work. Bug: 110884646 Test: ./test/testrunner/testrunner.py --host --runtime-option=-Xjitthreshold:0 --jit Test: Manual inspection of compiled code. Change-Id: I7b4b084bcf7dd9a23485c0e3cd2cd04a04b43d3d
2018-07-03Merge "ART: Do not use std::<container>::at()." Vladimir Marko
2018-07-03ART: Do not use std::<container>::at(). Vladimir Marko
These functions are specified as throwing std::out_of_range and we do not use exceptions. Test: m Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Change-Id: I67c365ed6d779c101a18b9f386c751c48ca76e16
2018-07-02Emit vector mulitply and accumulate instructions for x86. Gupta Kumar, Sanjiv
This patch adds a new cpu vaiant named kabylake and performs instruction simplification to generate VectorMulitplyAccumulate. Test: ./test.py --host --64 Change-Id: Ie6cc882dadf1322dd4d3ae49bfdb600b0c447765 Signed-off-by: Gupta Kumar, Sanjiv <sanjiv.kumar.gupta@intel.com>
2018-06-21Use HashSet<std::string> instead of unordered_set<>. Vladimir Marko
Change the default parameters for HashSet<std::string> to allow passing StringPiece as a key, avoiding an unnecessary allocation. Use the HashSet<std::string> instead of std::unordered_set<std::string>. Rename HashSet<> functions that mirror std::unordered_multiset<> to lower-case. Fix CompilerDriver::LoadImageClasses() to avoid using invalidated iterator. Test: m test-art-host-gtest Test: testrunner.py --host Change-Id: I7f8b82ee0b07befc5a0ee1c420b08a2068ad931e
2018-06-11ART: Adds an entrypoint for invoke-custom Orion Hodson
Add support for the compiler to call into the runtime for invoke-custom bytecodes. Bug: 35337872 Test: art/test.py --host -r -t 952 Test: art/test.py --target --64 -r -t 952 Test: art/test.py --target --32 -r -t 952 Change-Id: I821432e7e5248c91b8e1d36c3112974c34171803
2018-05-22Refactor runtime callee save frame info. Vladimir Marko
And avoid storing the info in Runtime. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing --jit Test: Pixel 2 XL boots. Test: testrunner.py --target --optimizing --jit Change-Id: Ib14853fc06c420753993e1f9e82a1b01f5e35e8c
2018-05-11ART: Compiler support for const-method-handle Orion Hodson
Implemented as a runtime call. Bug: 66890674 Test: art/test.py --target -r -t 979 Test: art/test.py --target --64 -r -t 979 Test: art/test.py --host -r -t 979 Change-Id: I67f461c819a7d528d7455afda8b4a59e9aed381c
2018-05-10ART: Compiler support for const-method-type Orion Hodson
Implemented as a runtime call. Bug: 66890674 Test: art/test.py --target -r -t 979 Test: art/test.py --target --64 -r -t 979 Test: art/test.py --host -r -t 979 Change-Id: I4b3d3969d455d0198cfe122eea8abd54e0ea20ee
2018-05-08Merge "MIPS: Skip output verification for assembler tests." Vladimir Marko
2018-05-04MIPS: Skip output verification for assembler tests. Vladimir Marko
These tests were taking too much time, skipping the output verification brings it down from ~60s to ~10s per test. Test: m test-art-host-gtest Bug: 73903608 Change-Id: Ifd55c8013dea92de631e7c033111959a794759f2
2018-05-04ARM: Remove VIXL dependency from ArmManagedRegister. Vladimir Marko
Also remove unnecesary DWARF includes. Motivation: Preparing to move JNI calling conventions to runtime/ to unify the GenericJNI frame creation with the JNI compiler. Test: Rely on TreeHugger. Change-Id: If8afc4a4fa41e41f0242962bb225b36633c1c153
2018-04-26Clean up include paths David Sehr
Remove runtime/globals.h and make clients point to the right globals.h (libartbase/base/globals.h). Also make within-libartbase includes relative rather than using base/, etc. Bug: 22322814 Test: make -j 40 checkbuild Change-Id: I99de63fc851d48946ab401e2369de944419041c7
2018-04-05Move remaining runtime/base stuff to libartbase David Sehr
Move the remainder of the Arena stuff, plus dumpable and runtime/*memory_region* to libartbase. More preparation to build profiling library. Bug: 22322814 Test: make -j 50 checkbuild Change-Id: Iaf26d310c89bc58846553281576c18102f5e4122
2018-04-04Separate Malloc and MemMap ArenaPools David Sehr
Make ArenaPool an abstract base class and leave MallocArenaPool implementation with it. This enables arena_allocator to be free of MemMap, Mutex, etc., in preparation to move the remaining collections out of runtime/base to libartbase/base. Bug: 22322814 Test: make -j 50 test-art-host build and boot Change-Id: Ief84dcbfb749165d9bc82000c6b8f96f93052422
2018-03-29Make Remove() atomic, as expected Hans Boehm
Bug: 31023171 Test: m -j28 test-art-host Change-Id: I0d9a4b19f1b307d98f01ec76a47e4748f713437c
2018-03-23ART: Simplify atomic.h Orion Hodson
Prefer std::atomic operations over wrappers in atomic.h. Exceptions are cases that relate to the Java data memory operations and CAS operations. Bug: 71621075 Test: art/test.py --host -j32 Test: art/test.py --target --64 -j4 Change-Id: I9a157e9dede852c1b2aa67d22e3e604a68a9ef1c
2018-03-19Move some remaining dex utilities David Sehr
There were several utilities related to building/walking/testing dex files that were not in libdexfile. This change consolidates these. Bug: 22322814 Test: make -j 50 test-art-host Change-Id: Id76e9179d03b8ec7d67f7e0f267121f54f0ec2e0
2018-03-08Merge "Saturation arithmetic instructions for X86 and X86_64." Treehugger Robot
2018-03-08Merge "MIPS: Use PCNT to implement VisitIntegerBitCount() and ↵ Treehugger Robot
VisitLongBitCount()"
2018-03-07Saturation arithmetic instructions for X86 and X86_64. Aart Bik
Rationale: Saturation arithmetic? It is coming! Bug: b/74026074 Test: assember_x86[_64]_test Change-Id: I6084161683c5f83ccf632a2ad0280913cec84931
2018-03-07MIPS: Use PCNT to implement VisitIntegerBitCount() and VisitLongBitCount() Lena Djokic
Test: ./testrunner.py --target --optimizing in QEMU Test: mma test-art-host-gtest Change-Id: I6ce5bdc86f951094f656c2f81ae8fc836d7a0b5c
2018-03-05Move most of runtime/base to libartbase/base David Sehr
Enforce the layering that code in runtime/base should not depend on runtime by separating it into libartbase. Some of the code in runtime/base depends on the Runtime class, so it cannot be moved yet. Also, some of the tests depend on CommonRuntimeTest, which itself needs to be factored (in a subsequent CL). Bug: 22322814 Test: make -j 50 checkbuild make -j 50 test-art-host Change-Id: I8b096c1e2542f829eb456b4b057c71421b77d7e2
2018-02-28Header library to remove dependence on runtime/ David Sehr
Add a new header library to remove libdexfile and others' dependence on runtime (typically runtime/base) includes in libdexfile. Also a small step to tease dexlayout and profman away from relying on these as well. Bug: 22322814 Test: make -j 50 checkbuild make -j 50 test-art-host-gtest Change-Id: I38e2fe399a75f4bc6318c77a71954c00ea73ec2b
2018-02-13x86/x86-64: Fix cmpw() for 9-16 bit immediates. Vladimir Marko
Test: assembler_x86_test assembler_x86_64_test Bug: 71853552 Change-Id: I0d05a5f461557122fffa89a1ba054886dd70ef12
2018-02-05Enable code item deduping Mathieu Chartier
Dedupe code items if they have the same contents, this is safe because of the fixed quickening logic. Removed duplicate code items in ManyMethods that caused the startup methods section to be empty in dex2oat_test. To avoid errors related to quickening and compilation of shared code items, quickening is currently disabled for shared code items. Bug: 63756964 Test: test-art-host Change-Id: I7c62eb746785d787c5269effd396f7be4859d3a6
2018-01-26Add addw support to x86 and x64. Nicolas Geoffray
Test: assembler_x86_64_test assembler_x86_test Change-Id: I2cfb815f15fa3df393bbeb4043ec208b3bdd9081
2018-01-22ART: Add entrypoint and intrinsic for Math.pow(). Vladimir Marko
MathBenchmarks.java#timePow results on taimen's little cores fixed at frequency 1401600 with forced JIT compilation: - before: - X32: 356.33 (@FastNative), 315.39 (@CriticalNative) - X64: 357.31 (@FastNative), 315.37 (@CriticalNative) - after (LICM defeats the benchmark): - X32: 2.88 - X64: 2.87 - after but with kAllSideEffects to prevent LICM: - X32: 275.42 - X64: 275.67 Test: Rely on TreeHugger. Bug: 70727450 Change-Id: Iaa31f70acabbd57c163cfeafe02eed67c1348861
2018-01-12Create an ART-independent DexFileLoader David Sehr
Opening DEX files should not rely on instantiating a runtime or having a large number of dependencies on runtime components. This CL makes DexFileLoader a stub class that is independent of ART, and introduces a subclass ArtDexFileLoader that contains the current implementations. Bug: 22322814 Test: make -j 50 test-art-host Change-Id: Ia6e92ae93c347057ea0c10455525239cbbe42c03
2018-01-08ARM: Replace arm::SetCc with vixl32::FlagsUpdate. Vladimir Marko
And delete obsolete test header file. Test: Rely on TreeHugger. Change-Id: I15858b8462198098f21956685a2ad77908b8a186
2018-01-08Merge "ARM: Fix breaking changes from recent VIXL update." Roland Levillain