summaryrefslogtreecommitdiff
path: root/compiler/linker
AgeCommit message (Collapse)Author
2024-12-09Revert^2 "arm64: Store resolved MethodType-s in .bss." Almaz Mingaleev
This reverts commit fad4678f3ae48d84b7ed1c842b03a023e4f2cb37. Bug: 380651440 bug: 297147201 Test: atest CtsLibcoreOjTestCases on a redfin device flashed Test: with ab/12108082: test crashes w/o WriteBarrier line Test: and passes w/ it. Change-Id: Ibdfc090e3c2b693c1bb3b160a64c9f94448e18ec
2024-11-25Revert "arm64: Store resolved MethodType-s in .bss." Almaz Mingaleev
This reverts commit a687066b7043dbc1be8f85001eeb0f341cd25885. Reason for revert: Probably caused b/380651440 Change-Id: I249aef9b6e9687d1d191c31034a2c9d02e4ea23b
2024-11-06arm64: Store resolved MethodType-s in .bss. Almaz Mingaleev
Bug: 297147201 Test: art/test/testrunner/testrunner.py --target --64 --jit Test: art/test/testrunner/testrunner.py --target --64 Change-Id: Iecd5575e5eb0d161cbc338f63f29cb52b0c23177
2024-11-05Use .data.img.rel.ro for app image methods. Vladimir Marko
This should improve app startup as we can skip the target method resolution on the first call. For `invoke-direct` we should never go to the resolution trampoline for app image methods and for `invoke-static` we go to the trampoline only if the class is not yet visibly initialized and in that case we still save time as the target method is already known. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing --speed-profile Test: run-gtests.sh Test: testrunner.py --target --optimizing --speed-profile Bug: 38313278 Change-Id: I1fea5485264b433fe642c9d0092a5411813eb996
2024-05-07Faster `HLoadClass` for app image classes. Vladimir Marko
Add app image relocations for classes in the app image, similar to the existing relocations for boot image. This new load kind lets the compiled code avoid the null check and slow path. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing --speed-profile Test: run-test.sh Test: testrunner.py --target --optimizing --speed-profile Bug: 38313278 Change-Id: Iffd76fe9ac6b95c37c2781fd6257e1d5cd0790d0
2024-04-17Clean up target retrieval from `LinkerPatch`. Vladimir Marko
Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Bug: 38313278 Change-Id: I637680589ba6f483b746bce567870f6d896d9fde
2024-04-16Rename `.data.bimg.rel.ro` to `.data.img.rel.ro`. Vladimir Marko
Prepare for adding app image patches to the same section. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Bug: 38313278 Change-Id: Ib552f005b3a2859152d0de9fa6b2fcd48a0f3feb
2024-01-03Revert^2 "x86_64: Store resolved MethodType-s in .bss." Almaz Mingaleev
This reverts commit d014fd019e84471665ac02f2de285541009892cd. Reason for revert: fix codegen to do runtime call in JIT for now. Bug: 297147201 Test: ./art/test/testrunner/testrunner.py --host --64 --optimizing -b Test: ./art/test/testrunner/testrunner.py --jvm -b Test: ./art/test.py --host -b Test: ./art/test/testrunner/testrunner.py --host --64 --jit -b Change-Id: I0f01c8391b09659bb6195955ecd8f88159141872
2023-12-15Revert "x86_64: Store resolved MethodType-s in .bss." Almaz Mingaleev
This reverts commit a627c7e71a59135daab7f2fb8505d4873f61e4ac. Reason for revert: 979-const-method-handle fails. Can repro with ITERATIONS_FOR_JIT set to 120_000 and ./art/test/testrunner/testrunner.py --host --64 --jit --no-jvmti --debug --prebuild --checkjni --cms --no-relocate --ntrace --cdex-fast -b -t 979-const Change-Id: I653a83aa12f2c28b163e0d43dbc95b8e8a190436
2023-12-15x86_64: Store resolved MethodType-s in .bss. Almaz Mingaleev
Bug: 297147201 Test: ./art/test/testrunner/testrunner.py --host --64 --optimizing -b Test: ./art/test/testrunner/testrunner.py --jvm -b Test: ./art/test.py --host -b Change-Id: I4bc2478ff88b2002a60c7126c1a1c9201082e550
2023-05-22Use C++17's [[maybe_unused]] attribute in ART Stefano Cianciulli
Bug: 169680875 Test: mmm art Change-Id: Ic0cc320891c42b07a2b5520a584d2b62052e7235
2022-11-18Make remaining compiler/ symbols hidden. Vladimir Marko
And mark required symbols with EXPORT. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing --jit Change-Id: I1b4e3c1ef9006924456dc36ec906bf74b62adab4
2022-10-14ART: Speed up some gtests. Vladimir Marko
Avoid creating `Runtime` or create the `Runtime` with a boot image to make the test setup faster. Test: m test-art-host-gtest Test: run-gtests.sh Change-Id: I3f09de81491402442f1704d25bb06de995d8a3ca
2020-10-19Faster @CriticalNative for boot image. Vladimir Marko
The @CriticalNative call does not need the target method, so we can avoid one instruction on x86, x86-64 and arm64. The current approach for arm does not allow such optimization. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Test: aosp_blueline-userdebug boots. Test: run-gtests.sh Test: testrunner.py --target --64 --optimizing Bug: 112189621 Change-Id: I11b7e415be2697757cbb11c9cccf4058d1d72d7d
2020-09-30Faster access to unresolved classes from compiled code. Vladimir Marko
Add two new load kinds to LoadClass, similar to kBssEntry but using the access-checking entrypoint on the slow-path. One is used for classes that are in the literal package and the other for classes outside the literal package of the compiling class. Associate new .bss entries with these load kinds and update them from entrypoints based on the resolved class properties. If the resolved class is public, both types of entries can be updated, otherwise only the package local entry can be updated and only if the defining class loader of the class is the same as the caller's defining class loader (which is identical for all code in an oat file) because the run time access check for same package requires both class loader and literal package name match. Test: Additional tests in 727-checker-unresolved-class. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Test: aosp_blueline-userdebug boots. Test: run-gtests.sh Test: testrunner.py --target --optimizing Bug: 161898207 Change-Id: I281e06ac2825caf81c6d7ee3128af833abd39992
2020-07-27Replace "dummy" in libartbase/, libdexfile/, compiler/. Vladimir Marko
Test: m test-art-host-gtest Bug: 161336379 Change-Id: I5335b28b1f66cdec39500563385bda99c580454d
2020-06-11Clean up generated operator<<(os, enum). Vladimir Marko
Pass enums by value instead of const reference. Do not generate operator<< sources for headers that have no enums or no declarations of operator<<. Do not define the operator<< for flag enums; these were unused anyway. Add generated operator<< for some enums in nodes.h . Change the operator<< for ComparisonBias so that the graph visualizer can use it but do not use the generated operator<< yet as that would require changing checker tests. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Change-Id: Ifd4c455c2fa921a9668c966a13068d43b9c6e173
2019-05-23ARM/ARM64: Use trampolines for slow-path entrypoint calls. Vladimir Marko
This reduces the size of the generated code. We do this only for AOT compilation where we get the most benefit. Sizes of aosp_taimen-userdebug prebuilts: - before: arm/boot*.oat: 19624804 arm64/boot*.oat: 23265752 oat/arm64/services.odex: 22417968 - after: arm/boot*.oat: 19460500 (-160KiB) arm64/boot*.oat: 22957928 (-301KiB) oat/arm64/services.odex: 21957864 (-449KiB) Test: m test-art-host-gtest Test: aosp_taimen-userdebug boots. Test: run-gtests.sh Test: testrunner.py --target --optimizing Bug: 12607709 Change-Id: Ie9dbd1ba256173e4e439e8bbb8832a791965cbe6
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
2019-02-12Remove oat_patches from the DWARF writer. David Srbecky
We no longer use them. Test: test-art-host-gtest-dwarf_test Change-Id: Ie018d2314f028584edb398b6310a7284a0ec2069
2019-02-12Remove support for generating .eh_frame ELF section. David Srbecky
The eh_frame support was originally added because the old libunwind library didn't support debug_frame. The new libunwind supports debug_frame well, and since we have switched to it, we can remove the legacy code. The main advantage of debug_frame is that it can be compressed as part of mini-debug-info. I am somewhat preserving the .eh_frame_hdr binary search table (renamed as .debug_frame_hdr.android). Bug: 123621350 Test: Generated framework oat files are identical. Change-Id: I35b18895482f2176e02df07b086af7a1d40f90d5
2018-12-27ART: Refactor for bugprone-argument-comment Andreas Gampe
Handles compiler. Bug: 116054210 Test: WITH_TIDY=1 mmma art Change-Id: I5cdfe73c31ac39144838a2736146b71de037425e
2018-12-04Cleanup symbol add method in ElfBuilder. David Srbecky
Use deque to avoid reallocating the cached symbols. We never generate absolute symbols because gdb don't like them. Add helper method to add symbols as Elf_Sym. Test: build.oat is unchanged. Change-Id: Id8289a71a23cf602f3f9e3e2c2a26277faf937a9
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-07-25Merge "Generate unstripped .oat files in the symbols directory." Treehugger Robot
2018-07-17Generate unstripped .oat files in the symbols directory. David Srbecky
Test: Check the generated files with readelf. Bug: 70512966 Change-Id: Id31232f8b750281bdc170f356833a8d71e1b5796
2018-07-16Always produce PIC code for AOT compilation. Vladimir Marko
Change sharpening to use PIC load kinds for AOT compilation and add "Jit" to the direct addressing load kind names. Use PIC code also for the Integer.valueOf() intrinsic codegen. Remove all support for non-PIC linker patches. The dex2oat --compile-pic option is retained for now but ignored by the compiler. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Test: Pixel 2 XL boots. Test: testrunner.py --target --optimizing Bug: 77856493 Change-Id: I54d666f6522f160a1b6ece4045a15d19363acbb6
2018-06-29Implement Integer.valueOf() intrinsic for boot image. Vladimir Marko
And generate only one "boot image live objects" array rather than one per boot*.art file. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Test: Pixel 2 XL boots. Test: testrunner.py --target --optimizing Bug: 71526895 Change-Id: I23af7f47fea5150805f801cd2512f2d152ee5b73
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-12Move RelativePatcher from libart-compiler.so to dex2oat. Vladimir Marko
For AOSP master, aosp_taimen-userdebug: - before: /system/lib/libart-compiler.so: 2084640 /system/lib64/libart-compiler.so: 2921496 /bin/dex2oat: 528372 - after: /system/lib/libart-compiler.so: 2059264 (-24.8KiB) /system/lib64/libart-compiler.so: 2920856 (-640B) /bin/dex2oat: 550056 (+21.2KiB) Test: m Test: m test-art-host-gtest Bug: 77951326 Change-Id: I8687ab9e00049acc46a6d229e5121b36d5379737
2018-04-11Revert^2 "Compile link-time thunks in codegen." Vladimir Marko
The linker crash (the reason for revert) is flaky and maybe we shall not see it with this CL now that unrelated source code has changed. Test: Rely on TreeHugger Bug: 36141117 Bug: 77581732 This reverts commit 5806a9ec99b5494b511e84c74f494f0b3a8ebec5. Change-Id: I3a4a058847dff601681ba391abf45833424fa06d
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-04-04Revert "Compile link-time thunks in codegen." Vladimir Marko
Reason for revert: This caused clang linker crash in several branches. Bug: 77581732 This reverts commit c9dd2207dfdab42586b1d6a5e7f11cf2fcea3a7a. Change-Id: I1923809083cf41c4f19e3e60df03ae80517aaedb
2018-04-04Compile link-time thunks in codegen. Vladimir Marko
Prepare for experimenting with Baker read barrier marking introspection entrypoints for JIT. Test: m test-art-host-gtest Test: Compare compiled boot*.oat before and after (no diff). Test: Pixel 2 XL boots. Bug: 36141117 Change-Id: Idb413a31b158db4bf89a8707ea46dd167a06f110
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-09Merge "Retrieve String/Class references from .data.bimg.rel.ro." Vladimir Marko
2018-03-08Merge "Load ArtMethod* from .data.bimg.rel.ro entries." Vladimir Marko
2018-03-08Retrieve String/Class references from .data.bimg.rel.ro. Vladimir Marko
For PIC AOT-compiled app, use the .data.bimg.rel.ro to load the boot image String/Class references instead of using the mmapped boot image ClassTable and InternTable. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing --pictest --npictest Test: Pixel 2 XL boots. Test: testrunner.py --target --optimizing --pictest --npictest Bug: 71526895 Change-Id: Id5703229777aecb589a933a41f92e44d3ec02a3d
2018-03-08Load ArtMethod* from .data.bimg.rel.ro entries. Vladimir Marko
Introduce a new .data.bimg.rel.ro section in oat files where we store offsets of boot image objects from the beginning of the boot image. At runtime we relocate these entries using the actual boot image address to turn offsets to pointers. Use the .data.bimg.rel.ro to prepare the boot image methods used by HInvokeStaticOrDirect for PIC AOT app compilation. Loading the ArtMethod* from .data.bimg.rel.ro instead of the .bss avoids the initial call to the resolution trampoline. Test: Additional test in 522-checker-sharpening Test: m test-art-host-gtest Test: testrunner.py --host --optimizing --pictest --npictest Test: Pixel 2 XL boots. Test: testrunner.py --target --optimizing --pictest --npictest Bug: 71526895 Change-Id: Ie5f5b1f622704877b36730377146e59092e46c0c
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-21Merge "Remove the size of oatexec and oatdex dynamic symobls." David Srbecky
2018-02-21Remove the size of oatexec and oatdex dynamic symobls. David Srbecky
We use only the address of them so the size is irrelevant. The current size covers the whole section, which collides with all other symbols which really confuses native tools. Test: m test-art-host-gtest Change-Id: Iad4e3f0ba5dafdf43b3f20f499725c793d35acf6
2018-02-16Ensure local debug symbols are generated first. David Srbecky
This is what the spec says, and newer tools warn about it. I expect it is of little consequence otherwise. Test: Checkout output with readelf Change-Id: Icd358181f41304d3121a85f87b34e563b0e59073
2018-02-05Revert "Properly de-duplicate debug symbol names." David Srbecky
This is no longer needed with the current dex symbol resolution approach, so go back to naive name de-duplication to avoid paying the memory cost. This reverts commit d8f2702c2a56ac64bf8b69c831d566c4a38b88b8. Test: testrunner.py --host -t 137 Change-Id: Ia48ee5d45dda369455295893db151c7db563a79a
2018-01-19Refactor jit debugger interface and its ELF creation. David Srbecky
Make it possible to store more then one method per entry, and ref-count the number of live methods per entry. Test: m test-art-host-gtest Change-Id: I45d69185e85e47fbee88a8d1f549ede9875a3c0a
2018-01-15Properly de-duplicate debug symbol names. David Srbecky
The simple approach was good up till now, but the interpreter methods names are not near the compiled methods name, so use proper full map to ensure we do not store the same name twice. Bug: 71579677 Test: testrunner.py --host -t 137 Change-Id: I529a3b097ed20a68ad46454b47a8f8c3223f534d
2018-01-12Generate debug symbols for interpreted methods. David Srbecky
Add .symtab symbols for method bytecodes in the dex section (only if the full --generate-debug-info is enabled for now). Test: m test-art-host-gtest Test: testrunner.py -b --host --optimizing Change-Id: Ie90034c921484bc4ff27c5458da78690b629dd0b
2018-01-10Merge "Try to mmap vdex file within the address range of the ELF file." David Srbecky
2018-01-05Create dex subdirectory David Sehr
Move all the DexFile related source to a common subdirectory dex/ of runtime. Bug: 71361973 Test: make -j 50 test-art-host Change-Id: I59e984ed660b93e0776556308be3d653722f5223