summaryrefslogtreecommitdiff
path: root/compiler/linker/linker_patch.h
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
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
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-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
2018-12-27ART: Refactor for bugprone-argument-comment Andreas Gampe
Handles compiler. Bug: 116054210 Test: WITH_TIDY=1 mmma art Change-Id: I5cdfe73c31ac39144838a2736146b71de037425e
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-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-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-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
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-09-20Refactor compiled_method.h . Vladimir Marko
Move LinkerPatch to compiler/linker/linker_patch.h . Move SrcMapElem to compiler/debug/src_map_elem.h . Introduce compiled_method-inl.h to reduce the number of `#include`s in compiled_method.h . Test: m test-art-host-gtest Test: testrunner.py --host Change-Id: Id211cdf94a63ad265bf4709f1a5e06dffbe30f64