summaryrefslogtreecommitdiff
path: root/compiler/utils/assembler.h
AgeCommit message (Collapse)Author
2025-01-27Add a one-pass baseline compiler for arm64. Nicolas Geoffray
Currently handles 50% of methods by supporting methods that: - don't branch - don't have try/catch - don't have float/double - <= 8 registers - opcodes are const/invokes/iget/iput/const-string/new-instance/checkcast. Cost of compilation is 10 times less than current baseline compiler. Performance of generated code: jit-baseline-cc configuration shows no impact on go/lem Test: test.py Change-Id: I8c99b8a8a7552c09c900c5c3e831e8897aef73e5
2024-03-26Rename enums.h/.cc to pointer_size.h/.cc. Santiago Aboy Solanes
It was the only enum in the file Bug: 329378408 Test: art/test/testrunner/testrunner.py --host --64 --optimizing -b Change-Id: If0e385324afa3685f648135ba9b60e6bc79ba0ed
2023-06-21Remove CodeAllocator and the extra copy of generated code. Nicolas Geoffray
The code used to copy the final generated code twice: from assembler to CodeAllocator, and then to CodeAllocator to SwapAllocator/JitMemory. The assemblers never depended on the exact location of the generated code, so just drop that feature. Test: test.py Change-Id: I8dc82e4926097092b9aac336a5a5d40f79dc62ca
2023-05-22Use C++17's [[maybe_unused]] attribute in ART Stefano Cianciulli
Bug: 169680875 Test: mmm art Change-Id: Ic0cc320891c42b07a2b5520a584d2b62052e7235
2022-11-09Make compiler/utils/ symbols hidden. Vladimir Marko
Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Change-Id: I5e39375f16e0ff1372c35fda444a4ef33bf320bf
2021-06-22ART: Fix for no-opt debug (-O0) builds Stelios Ioannou
Currently, the build process of debug builds with no optimization fails due to missing symbol definitions. For example, it throws errors like the following one: ld.lld: error: undefined symbol: art::gc::collector::MarkSweep::MarkStackTask<false>::kMaxSize This patch changes the missing symbols from constants to constant expressions as a way to fix those issues. The optimized builds get away with this issue because the values are optimized to be inlined and not referenced. The code at https://godbolt.org/z/3oYKoPzGj depicts similar behaviour. Additionally, there are comments describing why this issue occurs. Test: ART_DEBUG_OPT_FLAG="-O0" art/tools/buildbot-build.sh --host Change-Id: I66b5cfc885dfdfc82e3e4008b1e40fd68c19c999
2021-06-03Factor out arch-independent ScaleFactor definition. Ulya Trafimovich
Bug: 65872996 Test: m test-art-host-gtest Test: art/test.py --host -r --optimizing Change-Id: I27763286847b45a5a3a493c3dba48418575b3eb6
2020-07-24Update language to comply with Android’s inclusive language guidance Ian Pedowitz
See https://source.android.com/setup/contribute/respectful-code for reference Bug: 161896447 Bug: 161850439 Bug: 161336379 Test: m -j checkbuild cts docs tests Change-Id: I32d869c274a5d9a3dac63221e25874fe685d38c4
2020-02-26Remove MIPS support from libelffile. Vladimir Marko
Test: m Change-Id: I01e6c6abb845baa4763929f5b9b6b3b36ac0e8b0
2020-02-13Remove MIPS support from JNI/trampoline compiler. Vladimir Marko
Also remove MIPS assembler/disassembler support. Test: aosp_taimen-userdebug boots. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Bug: 147346243 Change-Id: Id736074b97cd04987a7902741828b119508df1c0
2019-03-20Create libelffile library for ELF file manipulation. David Srbecky
Move some of our tooling to library to make it reusable. Remove MIPS support from the ELF builder. This is slightly easier than making it independent of the runtime. Bug: 110133331 Test: test.py -b --host Change-Id: I93343808d0e27ee8e1117e713a2503e8179fc245
2018-12-27ART: Refactor for bugprone-argument-comment Andreas Gampe
Handles compiler. Bug: 116054210 Test: WITH_TIDY=1 mmma art Change-Id: I5cdfe73c31ac39144838a2736146b71de037425e
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-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-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
2017-12-07ART: Replace base/logging with android-base/logging Andreas Gampe
Replace wherever possible. ART's base/logging is now mainly VLOG and initialization code that is unnecessary to pull in and makes changes to verbose logging more painful than they have to be. Test: m test-art-host Change-Id: I3e3a4672ba5b621e57590a526c7d1c8b749e4f6e
2017-10-11Use ScopedArenaAllocator for building HGraph. Vladimir Marko
Memory needed to compile the two most expensive methods for aosp_angler-userdebug boot image: BatteryStats.dumpCheckinLocked() : 21.1MiB -> 20.2MiB BatteryStats.dumpLocked(): 42.0MiB -> 40.3MiB This is because all the memory previously used by the graph builder is reused by later passes. And finish the "arena"->"allocator" renaming; make renamed allocator pointers that are members of classes const when appropriate (and make a few more members around them const). Test: m test-art-host-gtest Test: testrunner.py --host Bug: 64312607 Change-Id: Ia50aafc80c05941ae5b96984ba4f31ed4c78255e
2017-10-06ART: Use ScopedArenaAllocator for pass-local data. Vladimir Marko
Passes using local ArenaAllocator were hiding their memory usage from the allocation counting, making it difficult to track down where memory was used. Using ScopedArenaAllocator reveals the memory usage. This changes the HGraph constructor which requires a lot of changes in tests. Refactor these tests to limit the amount of work needed the next time we change that constructor. Test: m test-art-host-gtest Test: testrunner.py --host Test: Build with kArenaAllocatorCountAllocations = true. Bug: 64312607 Change-Id: I34939e4086b500d6e827ff3ef2211d1a421ac91a
2016-09-14Move ArrayRef to runtime/base David Brazdil
Will be used in upcoming CLs regarding VDEX and VerifierDeps. Test: m test-art-host Change-Id: I68e611a4a52246c2bdf45eab7c61f3212908afd4
2016-08-30MIPS32: Fill branch delay slots Alexey Frunze
Test: booted MIPS32 in QEMU Test: test-art-host-gtest Test: test-art-target-gtest Test: test-art-target-run-test-optimizing on CI20 Change-Id: I727e80753395ab99fff004cb5d2e0a06409150d7
2016-08-05ART: Extract macro assembler Andreas Gampe
Extract macro assembler functionality used by the JNI compiler from the assembler interface. Templatize the new interface so that type safety ensures correct usage. Change-Id: Idb9f56e5b87e43ee6a7378853d8a9f01abe156b2 Test: m test-art-host
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-05-19Clean up JNI calling convention callee saves. Vladimir Marko
Precalculate callee saves at compile time and return them as ArrayRef<> instead of keeping then in a std::vector<>. Change-Id: I4fd7d2bbf6138dc31b0fe8554eac35b0777ec9ef
2016-04-20Thumb2: Fix EmitJumpTables() to extend buffer only if needed. Vladimir Marko
Bug: 28256882 Change-Id: I15227535c0fcb73c04b0b05160852c4b1bebee49
2016-04-14Fix CFI fixups for long branches on MIPS. Vladimir Marko
Change-Id: Ibc078e6dc5d7ef423c6a3db855f19f1426e0ea5a
2016-04-13Move Assemblers to the Arena. Vladimir Marko
And clean up some APIs to return std::unique_ptr<> instead of raw pointers that don't communicate ownership. Change-Id: I3017302307a0253d661240750298802fb0d9585e
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
2015-11-04Delay emitting CFI PC adjustments until after Thumb2/Mips fixup. Vladimir Marko
On Mips also take into account out-of-order CFI data emitted from EmitBranches(). Change-Id: I03b0b0b4c2b1ea31a02699ef5fa1c55aa42c23c3
2015-10-30ART: Arm32 packed-switch jump tables Andreas Gampe
Add jump table support to the thumb2 assembler. Jump tables are a collection of labels for the case targets, and an anchor label denoting the position of the jump. Use the jump table support to implement packed-switch support for arm32. Add tests for BindTrackedLabel and JumpTable to the thumb2 assembler test. Bug: 24092914 Change-Id: I5c84f193dfebf9e07f48678efc8bd151bb1410dd
2015-10-15Use ATTRIBUTE_UNUSED more. Roland Levillain
Use it in lieu of UNUSED(), which had some incorrect uses. Change-Id: If247dce58b72056f6eea84968e7196f0b5bef4da
2015-10-06MIPS: Assemblers changes needed for optimizing compiler Goran Jakovljevic
Also add assembler tests for MIPS32. Change-Id: I3ab1fba7f3b06eb3b5058861946d675494a30775
2015-09-17ART: Refactor intrinsics slow-paths Andreas Gampe
Refactor slow paths so that there is a default implementation for common cases (only arm64 with vixl is special). Write a generic intrinsic slow-path that can be reused for the specific architectures. Move helper functions into CodeGenerator so that they are accessible. Change-Id: Ibd788dce432601c6a9f7e6f13eab31f28dcb8550
2015-08-26X86: Assembler support for near labels Mark Mendell
The optimizing compiler uses 32 bit relative jumps for all forward jumps, just in case the offset is too large to fit in one byte. Some of the generated code knows that the jumps will in fact fit. Add a 'NearLabel' class to the x86 and x86_64 assemblers. This will be used to generate known short forward branches. Add jecxz/jrcxz instructions, which only handle a short offset. They will be used for intrinsics. Add tests for the new instructions and NearLabel. Change-Id: I11177f36394d35d63b32364b0e6289ee6d97de46 Signed-off-by: Mark Mendell <mark.p.mendell@intel.com>
2015-07-01Implement heap poisoning in ART's Optimizing compiler. Roland Levillain
- Instrument ARM, ARM64, x86 and x86-64 code generators. - Note: To turn heap poisoning on in Optimizing, set the environment variable `ART_HEAP_POISONING' to "true" before compiling ART. Bug: 12687968 Change-Id: Ib3120b38cf805a8a50207a314b9ccc90c8d93740
2015-06-22Opt compiler: Add disassembly to the '.cfg' output. Alexandre Rames
This is automatically added to the '.cfg' output when using the usual `--dump-cfg` option. Change-Id: I864bfc3a8299c042e72e451cc7730ad8271e4deb
2015-06-17Revert "Revert "ART: Implement literal pool for arm, fix branch fixup."" Vladimir Marko
This reverts commit fbeb4aede0ddc5b1e6a5a3a40cc6266fe8518c98. Adjust block label positions. Bad catch block labels were the reason for the revert. Change-Id: Ia6950d639d46b9da6b07f3ade63ab46d03d63310
2015-06-16Revert "ART: Implement literal pool for arm, fix branch fixup." Vladimir Marko
This reverts commit f38caa68cce551fb153dff37d01db518e58ed00f. Change-Id: Id88b82cc949d288cfcdb3c401b96f884b777fc40 Reason: broke the tests.
2015-06-15ART: Implement literal pool for arm, fix branch fixup. Vladimir Marko
Change-Id: Iecc91418bb4ee1c957f42fefb737d0ee2ba960e7
2015-05-29Move mirror::ArtMethod to native Mathieu 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 nullptr Mathieu Chartier
Also fixed some lines that were too long, and a few other minor details. Change-Id: I6efba5fb6e03eb5d0a300fddb2a75bf8e2f175cb
2015-04-08Implement CFI for JNI. David Srbecky
CFI is necessary for stack unwinding in gdb, lldb, and libunwind. Change-Id: I37eb7973f99a6975034cf0e699e138c3a9aba10f
2015-04-07Remove the old CFI infrastructure. David Srbecky
Change-Id: I12a17a8a1c39ffccaa499c328ebac36e4d74dc4e
2015-01-15ART: Allow to compile interpret-only mips64 files Andreas Gampe
Include enough infrastructure to allow cross-compiling for mips64, interpret-only. This includes the instruction-set-features, frame size info and utils assembler. Also add a disassembler for oatdump, and support in patchoat. Note: the runtime cannot run mips64, yet. Change-Id: Id106581fa76b478984741c62a8a03be0f370d992
2014-12-22ART: Swap-space in the compiler Andreas 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-11-13Instruction set features for ARM64, MIPS and X86. Ian Rogers
Also, refactor how feature strings are handled so they are additive or subtractive. Make MIPS have features for FPU 32-bit and MIPS v2. Use in the quick compiler rather than #ifdefs that wouldn't have worked in cross-compilation. Add SIMD features for x86/x86-64 proposed in: https://android-review.googlesource.com/#/c/112370/ Bug: 18056890 Change-Id: Ic88ff84a714926bd277beb74a430c5c7d5ed7666
2014-11-04ART: More warnings Andreas Gampe
Enable -Wno-conversion-null, -Wredundant-decls and -Wshadow in general, and -Wunused-but-set-parameter for GCC builds. Change-Id: I81bbdd762213444673c65d85edae594a523836e5
2014-11-03Remove -Wno-unused-parameter and -Wno-sign-promo from base cflags. Ian Rogers
Fix associated errors about unused paramenters and implict sign conversions. For sign conversion this was largely in the area of enums, so add ostream operators for the effected enums and fix tools/generate-operator-out.py. Tidy arena allocation code and arena allocated data types, rather than fixing new and delete operators. Remove dead code. Change-Id: I5b433e722d2f75baacfacae4d32aef4a828bfe1b
2014-10-23ART: optimizing compiler: initial support for ARM64. Alexandre Rames
The ARM64 port uses VIXL for code generation, to which it defers work like label binding and branch resolving, register type coherency checking, and immediate values handling. Change-Id: I0a44508c0c991f472a63e67b3469cdd878fe1a68 Signed-off-by: Serban Constantinescu <serban.constantinescu@arm.com> Signed-off-by: Alexandre Rames <alexandre.rames@arm.com>
2014-10-09stdint types all the way! Ian Rogers
Change-Id: I4e4ef3a2002fc59ebd9097087f150eaf3f2a7e08
2014-08-05Emit CFI for x86 & x86_64 JNI compiler. Tong Shen
Now for host-side x86 & x86_64 ART, we are able to get complete stacktrace with even mixed C/C++ & Java stack frames. Testing: 1. art/test/run-test --host --gdb [--64] --no-relocate 005 2. In gdb, run 'b art::Class_classForName' which is implementation of a Java native method, then 'r' 3. In gdb, run 'bt'. You should see stack frames down to main() Change-Id: I2d17e9aa0f6d42d374b5362a15ea35a2fce96302