summaryrefslogtreecommitdiff
path: root/compiler/utils/jni_macro_assembler.cc
AgeCommit message (Collapse)Author
2024-02-12JNI: Keep previous LRT state in callee-save reg. Vladimir Marko
Golem results for art-opt-cc (higher is better): linux-armv7 (Odroid-C2) before after NativeDowncallStaticFast 21.622 21.923 (+1.395%) NativeDowncallStaticFast6 18.491 18.719 (+1.236%) NativeDowncallStaticFastRefs6 15.347 15.504 (+1.025%) NativeDowncallVirtualFast 20.741 21.319 (+2.787%) NativeDowncallVirtualFast6 18.953 19.183 (+1.218%) NativeDowncallVirtualFastRefs6 15.500 15.663 (+1.053%) NativeDowncallStaticNormal 14.620 14.757 (0.9495%) NativeDowncallStaticNormal6 13.120 13.235 (+0.8823%) NativeDowncallStaticNormalRefs6 11.454 11.538 (+0.7258%) NativeDowncallVirtualNormal 14.216 14.486 (+1.898%) NativeDowncallVirtualNormal6 13.347 13.466 (+0.8978%) NativeDowncallVirtualNormalRefs6 11.538 11.628 (+0.7752%) linux-armv7 (Raspberry Pi 4) before after NativeDowncallStaticFast 43.305 42.331 (-2.250%) NativeDowncallStaticFast6 35.608 37.369 (+4.945%) NativeDowncallStaticFastRefs6 31.390 31.793 (+1.285%) NativeDowncallVirtualFast 33.814 31.825 (-5.882%) NativeDowncallVirtualFast6 34.311 36.445 (+6.220%) NativeDowncallVirtualFastRefs6 31.762 32.419 (+2.069%) NativeDowncallStaticNormal 13.848 14.244 (+2.859%) NativeDowncallStaticNormal6 13.592 13.725 (+0.9804%) NativeDowncallStaticNormalRefs6 12.671 12.536 (-1.061%) NativeDowncallVirtualNormal 13.979 13.848 (-0.9397%) NativeDowncallVirtualNormal6 13.242 13.592 (+2.647%) NativeDowncallVirtualNormalRefs6 12.364 12.358 (-0.094%) linux-armv8 (Odroid-C2) before after NativeDowncallStaticFast 24.752 25.160 (+1.648%) NativeDowncallStaticFast6 22.571 22.908 (+1.494%) NativeDowncallStaticFastRefs6 19.183 19.183 (unchanged) NativeDowncallVirtualFast 21.622 22.244 (+2.879%) NativeDowncallVirtualFast6 21.319 21.934 (+2.887%) NativeDowncallVirtualFastRefs6 17.448 17.848 (+2.296%) NativeDowncallStaticNormal 17.048 17.250 (+1.183%) NativeDowncallStaticNormal6 15.992 16.161 (+1.054%) NativeDowncallStaticNormalRefs6 14.085 14.216 (+0.9314%) NativeDowncallVirtualNormal 15.504 15.826 (+2.077%) NativeDowncallVirtualNormal6 15.347 15.663 (+2.064%) NativeDowncallVirtualNormalRefs6 13.466 13.586 (+0.8859%) linux-armv8 (Raspberry Pi 4) before after NativeDowncallStaticFast 38.366 40.796 (+6.335%) NativeDowncallStaticFast6 38.347 40.419 (+5.405%) NativeDowncallStaticFastRefs6 31.636 32.528 (+2.820%) NativeDowncallVirtualFast 35.201 37.406 (+6.266%) NativeDowncallVirtualFast6 34.000 35.626 (+4.782%) NativeDowncallVirtualFastRefs6 27.201 27.201 (unchanged) NativeDowncallStaticNormal 14.808 15.107 (+2.024%) NativeDowncallStaticNormal6 14.955 14.428 (-3.526%) NativeDowncallStaticNormalRefs6 14.174 13.855 (-2.254%) NativeDowncallVirtualNormal 14.735 14.307 (-2.904%) NativeDowncallVirtualNormal6 14.244 14.385 (+0.9921%) NativeDowncallVirtualNormalRefs6 14.105 14.244 (+0.9823%) linux-ia32 before after NativeDowncallStaticFast 223.66 233.77 (+4.516%) NativeDowncallStaticFast6 159.76 163.92 (+2.602%) NativeDowncallStaticFastRefs6 137.16 141.72 (+3.324%) NativeDowncallVirtualFast 211.79 224.05 (+5.791%) NativeDowncallVirtualFast6 149.85 154.00 (+2.769%) NativeDowncallVirtualFastRefs6 132.17 136.93 (+3.603%) NativeDowncallStaticNormal 51.091 51.091 (unchanged) NativeDowncallStaticNormal6 45.680 45.703 (+0.0497%) NativeDowncallStaticNormalRefs6 44.732 45.161 (+0.9606%) NativeDowncallVirtualNormal 50.450 50.450 (unchanged) NativeDowncallVirtualNormal6 45.161 45.161 (unchanged) NativeDowncallVirtualNormalRefs6 44.125 44.147 (+0.496%) linux-x64 before after NativeDowncallStaticFast 173.07 181.05 (+4.611%) NativeDowncallStaticFast6 156.50 161.34 (+3.092%) NativeDowncallStaticFastRefs6 130.37 131.61 (+0.9499%) NativeDowncallVirtualFast 169.00 174.83 (+3.447%) NativeDowncallVirtualFast6 148.13 149.35 (+0.8243%) NativeDowncallVirtualFastRefs6 127.31 130.11 (+2.200%) NativeDowncallStaticNormal 47.952 47.952 (unchanged) NativeDowncallStaticNormal6 46.789 46.789 (unchanged) NativeDowncallStaticNormalRefs6 44.643 44.643 (unchanged) NativeDowncallVirtualNormal 47.358 47.358 (unchanged) NativeDowncallVirtualNormal6 45.703 45.680 (-0.0497%) NativeDowncallVirtualNormalRefs6 44.643 44.643 (unchanged) Test: m test-art-host-gtest Test: testrunner.py --host Test: run-gtests.sh Test: testrunner.py --target --optimizing Bug: 172332525 Change-Id: I9606412c658cae8b7583308facf5ba095a982349
2024-02-08Use register pair loads/stores in JNI stubs... Vladimir Marko
... on arm/arm64 for local reference frame manipulation. Golem results for art-opt-cc (higher is better): linux-armv7 (Odroid-C2) before after NativeDowncallStaticFast 21.622 21.622 (unchanged) NativeDowncallStaticFast6 18.500 18.491 (-0.0500%) NativeDowncallStaticFastRefs6 15.354 15.354 (unchanged) NativeDowncallVirtualFast 21.027 20.741 (-1.361%) NativeDowncallVirtualFast6 18.953 18.953 (unchanged) NativeDowncallVirtualFastRefs6 15.504 15.504 (unchanged) NativeDowncallStaticNormal 14.620 14.620 (unchanged) NativeDowncallStaticNormal6 13.120 13.120 (unchanged) NativeDowncallStaticNormalRefs6 11.454 11.454 (unchanged) NativeDowncallVirtualNormal 14.342 14.216 (-0.8823%) NativeDowncallVirtualNormal6 13.347 13.347 (unchanged) NativeDowncallVirtualNormalRefs6 11.538 11.544 (+0.0481%) linux-armv7 (Raspberry Pi 4) before after NativeDowncallStaticFast 41.937 41.564 (-0.8906%) NativeDowncallStaticFast6 33.234 35.608 (+7.144%) NativeDowncallStaticFastRefs6 30.527 31.469 (+3.085%) NativeDowncallVirtualFast 37.531 35.429 (-5.600%) NativeDowncallVirtualFast6 32.803 34.125 (+4.028%) NativeDowncallVirtualFastRefs6 30.500 31.500 (+3.279%) NativeDowncallStaticNormal 13.599 14.112 (+3.773%) NativeDowncallStaticNormal6 13.599 13.599 (unchanged) NativeDowncallStaticNormalRefs6 12.358 12.677 (+2.580%) NativeDowncallVirtualNormal 13.473 13.848 (+2.781%) NativeDowncallVirtualNormal6 13.235 13.242 (+0.0495%) NativeDowncallVirtualNormalRefs6 12.165 12.364 (+1.632%) linux-armv8 (Odroid-C2) before after NativeDowncallStaticFast 23.988 24.765 (+3.238%) NativeDowncallStaticFast6 21.923 22.571 (+2.955%) NativeDowncallStaticFastRefs6 18.719 19.183 (+2.480%) NativeDowncallVirtualFast 21.027 21.622 (+2.828%) NativeDowncallVirtualFast6 20.267 21.319 (+5.190%) NativeDowncallVirtualFastRefs6 16.683 17.448 (+4.583%) NativeDowncallStaticNormal 16.683 17.057 (+2.239%) NativeDowncallStaticNormal6 15.656 15.992 (+2.149%) NativeDowncallStaticNormalRefs6 13.958 14.085 (+0.9054) NativeDowncallVirtualNormal 15.196 15.504 (+2.026%) NativeDowncallVirtualNormal6 15.049 15.347 (+1.980%) NativeDowncallVirtualNormalRefs6 13.006 13.466 (+3.541%) linux-armv8 (Raspberry Pi 4) before after NativeDowncallStaticFast 36.482 38.366 (+5.164%) NativeDowncallStaticFast6 37.406 38.366 (+2.564%) NativeDowncallStaticFastRefs6 28.770 31.652 (+10.02%) NativeDowncallVirtualFast 34.000 35.201 (+3.532%) NativeDowncallVirtualFast6 33.251 34.000 (+2.254%) NativeDowncallVirtualFastRefs6 26.474 27.201 (+2.747%) NativeDowncallStaticNormal 14.237 14.606 (+2.592%) NativeDowncallStaticNormal6 14.244 14.948 (+4.942%) NativeDowncallStaticNormalRefs6 13.012 14.181 (+8.983%) NativeDowncallVirtualNormal 14.105 14.663 (+3.954%) NativeDowncallVirtualNormal6 13.979 14.735 (+5.406%) NativeDowncallVirtualNormalRefs6 13.725 14.244 (+3.775%) The Odroid-C2 results appear essentially unchanged for armv7 (with some minor regressions within noise) and only little better for armv8 (but still likely within noise). On the Raspberry Pi 4, there appears to be some improvement for armv7 and a decent improvement for armv8 but there is higher level of noise than on Odroid-C2. Results from this single run are not very conclusive but we expect to see a clear trend in the data after submission. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Test: run-gtest.sh Test: testrunner.py --target --optimizing Bug: 172332525 Change-Id: I01033950355c988c8a0e7ed6bdb6e585587dcfb4
2023-12-14riscv64: Fix wrong sign-extension for references. Vladimir Marko
Test: Modify kPreferredAllocSpaceBegin = 0x90000000, then testrunner.py --target --64 --ndebug --optimizing Bug: 283082089 Change-Id: Ifb82d616a0d9664a2e7f5f96a1a79ddce5862cdf
2023-06-29riscv64: Enable JNI compiler. Vladimir Marko
Implement the required `WriteCIE()`, fix a bug in the `art_jni_dlsym_lookup_critical_stub`, fix reference loads to be zero-extended and enable the JNI compiler for riscv64. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Test: run-gtests.sh Test: testrunner.py --target --64 --ndebug --prebuild --no-prebuild -t 178 Test: # Edit `run-test` to disable checker, then testrunner.py --target --64 --ndebug --cdex-none --optimizing # 7 tests fail (pre-existing failures): 004-StackWalk, 137-cfi, # 2042-reference-processing, 597-deopt-busy-loop, 629-vdex-speed, # 638-checker-inline-cache-intrinsic and 661-oat-writer-layout. Test: aosp_cf_riscv64_phone-userdebug boots without crashes. Bug: 283082089 Change-Id: Ifd47098b7428919b601dd22a130ad1bd51ae516d
2023-06-12Add jni macro assembler skeleton for riscv64. Lifang Xia
Note: Most functions are unimplemeted. Test: m test-art-host-gtest Bug: 283082089 Signed-off-by: Lifang Xia <lifang_xia@linux.alibaba.com> Signed-off-by: Wendong Wang <wangwd@xcvmbyte.com> Change-Id: Ifb0c6c15bd9e1159ea2c90edc306335ca634c1d8
2023-02-03riscv64: add missing UNUSED annotations. Ulya Trafimovich
The code compiles on other architectures that implement JNI compiler, because they use these variables. However the code won't compile for RISC-V as it falls into the default (unsupported) case. Test: lunch aosp_riscv64-userdebug && m dist Change-Id: I16010e806fe6c51fb0a7a20111e0d1feefde018c
2022-11-09Make compiler/utils/ symbols hidden. Vladimir Marko
Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Change-Id: I5e39375f16e0ff1372c35fda444a4ef33bf320bf
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
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
2017-11-02ART: Make InstructionSet an enum class and add kLast. Vladimir Marko
Adding InstructionSet::kLast shall make it easier to encode the InstructionSet in fewer bits using BitField<>. However, introducing `kLast` into the `art` namespace is not a good idea, so we change the InstructionSet to an enum class. This also uncovered a case of InstructionSet::kNone being erroneously used instead of vixl32::Condition::None(), so it's good to remove `kNone` from the `art` namespace. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Change-Id: I6fa6168dfba4ed6da86d021a69c80224f09997a6
2017-10-09Use ScopedArenaAllocator for register allocation. Vladimir Marko
Memory needed to compile the two most expensive methods for aosp_angler-userdebug boot image: BatteryStats.dumpCheckinLocked() : 25.1MiB -> 21.1MiB BatteryStats.dumpLocked(): 49.6MiB -> 42.0MiB This is because all the memory previously used by Scheduler is reused by the register allocator; the register allocator has a higher peak usage of the ArenaStack. And continue the "arena"->"allocator" renaming. Test: m test-art-host-gtest Test: testrunner.py --host Bug: 64312607 Change-Id: Idfd79a9901552b5147ec0bf591cb38120de86b01
2017-03-23MIPS64: Check for MSA presence in each MSA instruction Goran Jakovljevic
Test: mma test-art-host-gtest Change-Id: I123fe1e33de13af6a2b2a76f37f7ad23004a81c0
2016-11-29ARM: Fix JNI MacroAssembler after VIXL update. Artem Serov
This patch fixes an issue found here: https://android-review.googlesource.com/#/c/307532/ Also re-enables vixl MacroAssembler for arm. Test: export ART_USE_READ_BARRIER=true; export ART_HEAP_POISONING=true; \ m test-art-host Test: export ART_USE_READ_BARRIER=true; export ART_HEAP_POISONING=true; \ m test-art-target Test: dump-oat-boot with ART_USE_READ_BARRIER=true Change-Id: I03e3014fb250791db2d24a0ab1a76ca96384c332
2016-11-29Use non vixl arm macro assembler Mathieu Chartier
The VIXL one hits an assertion error for CC: external/vixl/src/aarch32/macro-assembler-aarch32.h:1386: void vixl::aarch32::MacroAssembler::Cmp(vixl::aarch32::Condition, vixl::aarch32::Register, const vixl::aarch32::Operand &): Assertion `!AliasesAvailableScratchRegister(rn)' failed. Fixes dump-oat-boot with CC. Test: test-art-target, N6P booting Change-Id: I781fe8c8c2d6cd8b246ee4509281d6c645c89a28
2016-08-25Merge "ARM: VIXL32: Switch JNI compiler to use VIXL Assembler." Treehugger Robot
2016-08-19Fix building tests with partial arch codegen support Colin Cross
Add conditionals around more code that is only used for codegen for specific architectures, and move a few more files into the architecture-specific codegen lists. Tests: ART_HOST_CODEGEN_ARCHS="x86_64 mips" m -j ART_TARGET_CODEGEN_ARCHS=svelte test-art-host Bug: 30928847 Change-Id: I0444d15e1cafe4c9b13ff78718c3b13b544270e7
2016-08-19ARM: VIXL32: Switch JNI compiler to use VIXL Assembler. Artem Serov
Change-Id: I9f9ef1a9c9c9eb796d52980916e56e841aa52a0f
2016-08-10Merge "ART: Extract JNI macro assembler for arm" Treehugger Robot
2016-08-09ART: Extract JNI macro assembler for arm Andreas Gampe
Extract the JNI assembler parts from the regular assembler. Change-Id: Ice39ffeb854f8651e93443dd69f4c9e0e802975c Test: m test-art-target (N6)
2016-08-08ART: Extract JNI macro assembler for arm64 Andreas Gampe
Extract the JNI assembler parts from the regular assembler. Change-Id: I0b0ad32e18f585b75e9da0237afe082c25a1d291 Test: m test-art-target (N9)
2016-08-08Merge "ART: Extract JNI macro assembler for x86" Treehugger Robot
2016-08-08ART: Extract JNI macro assembler for x86-64 Andreas Gampe
Extract the JNI assembler parts from the regular assembler. Test: m test-art-host Change-Id: I291fb76ad9232123b4c1992488ee81fec3c1db47
2016-08-08ART: Extract JNI macro assembler for x86 Andreas Gampe
Extract the JNI assembler parts from the regular assembler. Change-Id: I0b47af03ca12798f58dafec716a529eb0edf9649 Test: m test-art-host
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