summaryrefslogtreecommitdiff
path: root/compiler/jni/quick/calling_convention.h
AgeCommit message (Collapse)Author
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
2024-03-08Pass only shorty to `ArtQuickJniCompileMethod()`. Vladimir Marko
Passing a `dex_file` and `method_idx` makes testing unnecessarily difficult. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Bug: 288983053 Change-Id: Ice79423ec568e254547acd4448fb82e2ad11b79c
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-06-27riscv64: Implement JNI compiler for normal native. Vladimir Marko
Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Test: run-gtests.sh Bug: 283082089 Change-Id: I2d6e8d029a74004076b6d514205a147ce1145f03
2022-11-16Make compiler/jni/ symbols hidden. Vladimir Marko
Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Change-Id: I04dc99e1491219442ba128f57a08112ae4783b92
2022-11-04Update method exit hooks from JITed code to not use Stack visitor Mythri Alle
Using NthCallerStackVisitor is expensive since that involves decoding method header and other tasks that are reasonably expensive especially when called on every method exit. When calling method exit hooks from JITed code a lot of this information like the frame_size, calling method are already known and can be directly passed to the method exit hook instead of computing them. Locally this change improves the performance by 70% on debuggable-cc config of golem benchmarks. Bug: 253232638 Test: art/test.py Change-Id: I3a1d80748c6d85e5fa1d3bd4aec0b29962ba0156
2021-12-14JNI: Inline fast-path for `JniMethodEnd()`. Vladimir Marko
Golem results for art-opt-cc (higher is better): linux-ia32 before after NativeDowncallStaticNormal 46.766 51.016 (+9.086%) NativeDowncallStaticNormal6 42.268 45.748 (+8.235%) NativeDowncallStaticNormalRefs6 41.355 44.776 (+8.272%) NativeDowncallVirtualNormal 46.361 52.527 (+13.30%) NativeDowncallVirtualNormal6 41.812 45.206 (+8.118%) NativeDowncallVirtualNormalRefs6 40.500 44.169 (+9.059%) (The NativeDowncallVirtualNormal result for x86 is skewed by one extra good run as Golem reports the best result in the summary. Using the second best and most frequent result 50.5, the improvement is only around 8.9%.) linux-x64 before after NativeDowncallStaticNormal 44.169 47.976 (+8.620%) NativeDowncallStaticNormal6 43.198 46.836 (+8.423%) NativeDowncallStaticNormalRefs6 38.481 44.687 (+16.13%) NativeDowncallVirtualNormal 43.672 47.405 (+8.547%) NativeDowncallVirtualNormal6 42.268 45.726 (+8.182%) NativeDowncallVirtualNormalRefs6 41.355 44.687 (+8.057%) (The NativeDowncallStaticNormalRefs6 result for x86-64 is a bit inflated because recent results jump between ~38.5 and ~40.5. If we take the latter as the baseline, the improvements is only around 10.3%.) linux-armv7 before after NativeDowncallStaticNormal 10.659 14.620 (+37.16%) NativeDowncallStaticNormal6 9.8377 13.120 (+33.36%) NativeDowncallStaticNormalRefs6 8.8714 11.454 (+29.11%) NativeDowncallVirtualNormal 10.511 14.349 (+36.51%) NativeDowncallVirtualNormal6 9.9701 13.347 (+33.87%) NativeDowncallVirtualNormalRefs6 8.9241 11.454 (+28.35%) linux-armv8 before after NativeDowncallStaticNormal 10.608 16.329 (+53.93%) NativeDowncallStaticNormal6 10.179 15.347 (+50.76%) NativeDowncallStaticNormalRefs6 9.2457 13.705 (+48.23%) NativeDowncallVirtualNormal 9.9850 14.903 (+49.25%) NativeDowncallVirtualNormal6 9.9206 14.757 (+48.75%) NativeDowncallVirtualNormalRefs6 8.8235 12.789 (+44.94%) Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Test: run-gtests.sh Test: testrunner.py --target --optimizing Bug: 172332525 Change-Id: Ie144bc4f7f82be95790ea7d3123b81a3b6bfa603
2021-11-23Revert^2 "JNI: Rewrite locking for synchronized methods." Vladimir Marko
This reverts commit 02e0eb7eef35b03ae9eed60f02c889a6be400de9. Reason for revert: Fixed the arm64 UNLOCK_OBJECT_FAST_PATH macro to use the correct label for one branch to slow path. Change-Id: I311687e877c54229af1613db2928e47b3ef0b6f2 Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Test: run-gtests.sh Test: testrunner.py --target --optimizing Bug: 172332525
2021-11-23Revert "JNI: Rewrite locking for synchronized methods." Vladimir Marko
This reverts commit c17656bcf477e57d59ff051037c96994fd0ac8f2. Reason for revert: Broke tests. At least the arm64 macro UNLOCK_OBJECT_FAST_PATH uses an incorrect label for one branch to slow path. Bug: 172332525 Bug: 207408813 Change-Id: I6764dcfcba3b3d780fc13a66d6e676a3e3946a0f
2021-11-22JNI: Rewrite locking for synchronized methods. Vladimir Marko
Lock and unlock in dedicated entrypoints instead of the `JniMethodStart*()` and `JniMethodEnd*()` entrypoints. Update x86 and x86-64 lock/unlock entrypoints to use the same checks as arm and arm64. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Test: run-gtests.sh Test: testrunner.py --target --optimizing Bug: 172332525 Change-Id: I82b5af211aa22479f8b0eec7f3a50bc92ec87eca
2021-11-02Revert^2 "JNI: Remove `JniMethodFast{Start,End}()`." Vladimir Marko
This reverts commit 2ca0900e98d826644960eefeb8a21c84850c9e04. Reason for revert: Fixed instrumentation for suspend check from JNI stub, added a commented-out DCHECK() and a test. The commented-out DCHECK() was correctly catching the bug with the original submission but it also exposed deeper issues with the instrumentation framework, so we cannot fully enable it - bug 204766614 has been filed for this. Original message: Inline suspend check from `GoToRunnableFast()` to JNI stubs. The only remaining code in `JniMethodFast{Start,End}()` is a debug mode check that the method is @FastNative, so remove the call altogether as we prefer better performance over the debug mode check. Replace `JniMethodFastEndWithReference()` with a simple `JniDecodeReferenceResult()`. Golem results for art-opt-cc (higher is better): linux-ia32 before after NativeDowncallStaticFast 149.00 226.77 (+52.20%) NativeDowncallStaticFast6 107.39 140.29 (+30.63%) NativeDowncallStaticFastRefs6 104.50 130.54 (+24.92%) NativeDowncallVirtualFast 147.28 207.09 (+40.61%) NativeDowncallVirtualFast6 106.39 136.93 (+28.70%) NativeDowncallVirtualFastRefs6 104.50 130.54 (+24.92%) linux-x64 before after NativeDowncallStaticFast 133.10 173.50 (+30.35%) NativeDowncallStaticFast6 109.12 135.73 (+24.39%) NativeDowncallStaticFastRefs6 105.29 127.18 (+20.79%) NativeDowncallVirtualFast 127.74 167.66 (+31.25%) NativeDowncallVirtualFast6 106.39 128.12 (+20.42%) NativeDowncallVirtualFastRefs6 105.29 127.18 (+20.79%) linux-armv7 before after NativeDowncallStaticFast 18.058 21.622 (+19.74%) NativeDowncallStaticFast6 14.903 17.057 (+14.45%) NativeDowncallStaticFastRefs6 13.006 14.620 (+12.41%) NativeDowncallVirtualFast 17.848 21.027 (+17.81%) NativeDowncallVirtualFast6 15.196 17.439 (+14.76%) NativeDowncallVirtualFastRefs6 12.897 14.764 (+14.48%) linux-armv8 before after NativeDowncallStaticFast 19.183 23.610 (+23.08%) NativeDowncallStaticFast6 16.161 19.183 (+18.71%) NativeDowncallStaticFastRefs6 13.235 15.041 (+13.64%) NativeDowncallVirtualFast 17.839 20.741 (+16.26%) NativeDowncallVirtualFast6 15.500 18.272 (+17.88%) NativeDowncallVirtualFastRefs6 12.481 14.209 (+13.84%) Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Test: run-gtests.sh Test: testrunner.py --target --optimizing Test: testrunner.py --host --jit --no-image Test: testrunner.py --host --optimizing --debuggable -t 2005 Bug: 172332525 Bug: 204766614 Change-Id: I9cc7583fc11c457a53fe2d1a24a8befc0f36410d
2021-10-19Revert "JNI: Remove `JniMethodFast{Start,End}()`." Vladimir Marko
This reverts commit 64d6e187f19ed670429652020561887e6b220216. Reason for revert: Breaks no-image JIT run tests (flaky). Bug: 172332525 Change-Id: I7813d89283eff0f6266318d3fb02d1257471798d
2021-10-19JNI: Remove `JniMethodFast{Start,End}()`. Vladimir Marko
Inline suspend check from `GoToRunnableFast()` to JNI stubs. The only remaining code in `JniMethodFast{Start,End}()` is a debug mode check that the method is @FastNative, so remove the call altogether as we prefer better performance over the debug mode check. Replace `JniMethodFastEndWithReference()` with a simple `JniDecodeReferenceResult()`. Golem results for art-opt-cc (higher is better): linux-ia32 before after NativeDowncallStaticFast 149.00 226.77 (+52.20%) NativeDowncallStaticFast6 107.39 140.29 (+30.63%) NativeDowncallStaticFastRefs6 104.50 130.54 (+24.92%) NativeDowncallVirtualFast 147.28 207.09 (+40.61%) NativeDowncallVirtualFast6 106.39 136.93 (+28.70%) NativeDowncallVirtualFastRefs6 104.50 130.54 (+24.92%) linux-x64 before after NativeDowncallStaticFast 133.10 173.50 (+30.35%) NativeDowncallStaticFast6 109.12 135.73 (+24.39%) NativeDowncallStaticFastRefs6 105.29 127.18 (+20.79%) NativeDowncallVirtualFast 127.74 167.66 (+31.25%) NativeDowncallVirtualFast6 106.39 128.12 (+20.42%) NativeDowncallVirtualFastRefs6 105.29 127.18 (+20.79%) linux-armv7 before after NativeDowncallStaticFast 18.058 21.622 (+19.74%) NativeDowncallStaticFast6 14.903 17.057 (+14.45%) NativeDowncallStaticFastRefs6 13.006 14.620 (+12.41%) NativeDowncallVirtualFast 17.848 21.027 (+17.81%) NativeDowncallVirtualFast6 15.196 17.439 (+14.76%) NativeDowncallVirtualFastRefs6 12.897 14.764 (+14.48%) linux-armv8 before after NativeDowncallStaticFast 19.183 23.610 (+23.08%) NativeDowncallStaticFast6 16.161 19.183 (+18.71%) NativeDowncallStaticFastRefs6 13.235 15.041 (+13.64%) NativeDowncallVirtualFast 17.839 20.741 (+16.26%) NativeDowncallVirtualFast6 15.500 18.272 (+17.88%) NativeDowncallVirtualFastRefs6 12.481 14.209 (+13.84%) Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Test: run-gtests.sh Test: testrunner.py --target --optimizing Bug: 172332525 Change-Id: I680aaeaa0c1a55796271328180e9d4ed7d89c0b8
2021-10-11Inline IRT frame push/pop into JNI stubs. Vladimir Marko
Golem results for art-opt-cc (higher is better): linux-ia32 before after NativeDowncallStaticNormal 25.704 26.839 (+4.414%) NativeDowncallStaticNormal6 23.857 25.086 (+5.152%) NativeDowncallStaticNormalRefs6 23.704 25.248 (+6.513%) NativeDowncallVirtualNormal 25.578 27.000 (+5.560%) NativeDowncallVirtualNormal6 23.704 24.925 (+5.153%) NativeDowncallVirtualNormalRefs6 23.704 25.074 (+5.870%) NativeDowncallStaticFast 100.65 149.13 (+48.17%) NativeDowncallStaticFast6 78.304 107.39 (+37.71%) NativeDowncallStaticFastRefs6 76.962 104.45 (+35.71%) NativeDowncallVirtualFast 100.40 147.28 (+46.69%) NativeDowncallVirtualFast6 79.302 106.34 (+34.10%) NativeDowncallVirtualFastRef26 76.617 103.29 (+34.82%) linux-x64 before after NativeDowncallStaticNormal 26.083 26.987 (+3.465%) NativeDowncallStaticNormal6 24.606 25.411 (+3.271%) NativeDowncallStaticNormalRefs6 24.150 25.086 (+3.877%) NativeDowncallVirtualNormal 25.743 26.812 (+4.156%) NativeDowncallVirtualNormal6 24.294 25.248 (+3.927%) NativeDowncallVirtualNormalRefs6 23.857 25.086 (+5.152%) NativeDowncallStaticFast 109.95 133.10 (+21.06%) NativeDowncallStaticFast6 90.274 109.12 (+20.87%) NativeDowncallStaticFastRefs6 87.282 105.29 (+20.63%) NativeDowncallVirtualFast 104.00 127.55 (+22.65%) NativeDowncallVirtualFast6 88.191 106.73 (+21.02%) NativeDowncallVirtualFastRef26 85.530 102.09 (+19.36%) linux-armv7 before after NativeDowncallStaticNormal 6.1148 6.3694 (+4.316%) NativeDowncallStaticNormal6 5.6845 5.9026 (+3.837%) NativeDowncallStaticNormalRefs6 5.4054 5.6022 (+3.641%) NativeDowncallVirtualNormal 5.4726 5.7088 (+4.316%) NativeDowncallVirtualNormal6 5.1789 5.3685 (+3.660%) NativeDowncallVirtualNormalRefs6 4.9140 5.0902 (+3.586%) NativeDowncallStaticFast 16.683 18.058 (+8.239%) NativeDowncallStaticFast6 13.951 14.896 (+6.770%) NativeDowncallStaticFastRefs6 12.279 13.006 (+5.919%) NativeDowncallVirtualFast 16.161 17.848 (+10.44%) NativeDowncallVirtualFast6 14.085 15.196 (+7.892%) NativeDowncallVirtualFastRef26 12.089 12.897 (+6.683%) linux-armv8 before after NativeDowncallStaticNormal 6.0663 6.4229 (+5.879%) NativeDowncallStaticNormal6 5.7252 6.0437 (+5.563%) NativeDowncallStaticNormalRefs6 5.3114 5.5814 (+5.082%) NativeDowncallVirtualNormal 5.8795 6.2651 (+6.558%) NativeDowncallVirtualNormal6 5.6232 5.9494 (+5.801%) NativeDowncallVirtualNormalRefs6 5.1862 5.4429 (+4.948%) NativeDowncallStaticFast 17.638 19.183 (+8.760%) NativeDowncallStaticFast6 14.903 16.161 (+8.438%) NativeDowncallStaticFastRefs6 12.475 13.235 (+6.094%) NativeDowncallVirtualFast 15.826 17.848 (+12.78%) NativeDowncallVirtualFast6 14.064 15.504 (+10.24%) NativeDowncallVirtualFastRef26 11.628 12.475 (+7.285%) Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Test: run-gtests.sh Test: testrunner.py --target --optimizing Bug: 172332525 Change-Id: I5ecfa7a661f08ab63dd2a75d666e1c1b9121935f
2021-03-23JNI: Use callee-save register for IRT cookie. Vladimir Marko
Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Test: run-gtests.sh Test: testrunner.py --target --optimizing Bug: 172332525 Change-Id: I6a91d86fd31ff33882b41646aae9fcccc157d638
2021-02-23Do not create HandleScope for JNI transitions. Vladimir Marko
We previously crated a HandleScope in the JNI transition frame to hold references passed as jobject (jclass, etc.) to the native function and these references were actually spilled twice during the transition. We now construct the jobject as a pointer to the reference spilled in the reserved out vreg area in the caller's frame. And the jclass for static methods is just a pointer to the method's declaring class. This reduces the amount of work required in the JNI transition, both on entry (in compiled stubs) and exit (in JniMethodEnd*). Some additional work is required when GC visits references of a native method as we need to walk over the method's shorty which was unnecessary for a HandleScope. Also fix Thread::InitStackHwm() to calculate correct stack size needed by the new Thread::IsJniTransitionReference(). The results for StringToBytesBenchmark on blueline little cores running at fixed frequency 1420800 are approximately arm64 (medians from 3 runs) before after timeGetBytesAscii EMPTY 447.33 436.86 timeGetBytesIso88591 EMPTY 440.52 431.13 timeGetBytesUtf8 EMPTY 432.31 409.82 arm (medians from 3 runs) before after timeGetBytesAscii EMPTY 500.53 490.87 timeGetBytesIso88591 EMPTY 496.45 495.30 timeGetBytesUtf8 EMPTY 488.84 472.68 Test: m test-art-host-gtest Test: testrunner.py --host Test: testrunner.py --host --gcstress Test: testrunner.py --host --jit-on-first-use Test: testrunner.py --host --jit-on-first-use --gcstress Test: run-gtests.sh Test: testrunner.py --target --optimizing Test: boots. Bug: 172332525 Change-Id: I658f9d87071587b3e89f31c65feca976a11e9cc2
2020-06-19Direct calls to @CriticalNative methods. Vladimir Marko
Emit direct calls from compiled managed code to the native code registered with the method, avoiding the JNI stub. Golem results: art-opt-cc x86 x86-64 arm arm64 NativeDowncallStaticCritical +12.5% +62.5% +75.9% +41.7% NativeDowncallStaticCritical6 +55.6% +87.5% +72.1% +35.3% art-opt x86 x86-64 arm arm64 NativeDowncallStaticCritical +28.6% +85.6% +76.4% +38.4% NativeDowncallStaticCritical6 +44.6% +44.6% +74.6% +32.2% Test: Covered by 178-app-image-native-method. Test: m test-art-host-gtest Test: testrunner.py --host --debuggable --ndebuggable \ --optimizing --jit --jit-on-first-use Test: run-gtests.sh Test: testrunner.py --target --optimizing Test: testrunner.py --target --debuggable --ndebuggable \ --optimizing --jit --jit-on-first-use -t 178 Test: aosp_cf_x86_phone-userdebug boots. Test: aosp_cf_x86_phone-userdebug/jitzygote boots. Bug: 112189621 Change-Id: I8b37da51e8fe0b7bc513bb81b127fe0416068866
2020-03-02Move entry spills determination to JNI compiler. Vladimir Marko
The calling convention no longer describes entry spills as spilling is the JNI compiler's responsibility. This allows future improvements, such as spilling registers directly to the HandleScope or outgoing stack args. Remove the notion of interprocedural scratch register from calling conventions and let assemblers deal with all scratch register uses. The remaining JNI assembler APIs that take scratch registers are currently unused and can be removed. Also fix a bug in disassembly comparison for tests; the contents of two files were considered identical if the second one just contained additional data. This change fully preserves the generated code and adds TODO comments where doing so results in weird or suboptimal code. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Test: Prebuilt boot image is unchanged. Test: aosp_taimen-userdebug boots. Bug: 12189621 Change-Id: Ic26a670276920313cd907a6eda8d982cf0abfd81
2020-01-16jni: Do not create a managed frame for @CriticalNative. Vladimir Marko
Omit managed frame for @CriticalNative methods, do not check for exceptions and and make a tail call when possible. Pass the method pointer in a hidden argument to prepare for implementing late binding for @CriticalNative methods. This changes only the JNI compiler, Generic JNI shall be updated in a separate change. Performance improvements reported by Golem (art-opt-cc): x86 x86-64 arm arm64 NativeDowncallStaticCritical6 +17% +50% +88% +139% NativeDowncallStaticCritical +37% +32% +103% +216% Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Test: aosp_taimen-userdebug boots. Test: run-gtests.sh Test: testrunner.py --target --optimizing Bug: 112189621 Change-Id: I5758c8f478627f2eee8f615b4537a907c211b9f8
2019-01-09ART: Remove instruction_set.h from thread.h Andreas Gampe
Move the function definitions relying on it to the -inl. Some follow-up transitive-include cleanup, as well as some more forward-declarations. Bug: 119869270 Test: mmma art Change-Id: I820f395e6cb8343a4bb9bf02da271fbec067109f
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
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
2016-10-06jni: Add @CriticalNative support for MIPS32/MIPS64 Goran Jakovljevic
Test: lunch aosp_mips-eng && make Test: lunch aosp_mips64-eng && make Test: mma -j2 test-art-target on CI20 and QEMU Bug: 31743474 Change-Id: Ic73c384c4b187cdeb610b1a8e39a4d54d5be1481
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-09-09jni: Add @CriticalNative optimization to speed up JNI transitions Igor Murashkin
Change-Id: I963059ac3a72dd8e6a867596c356d7062deb6da7
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-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
2015-08-12Remove unnecessary `explicit` qualifiers on constructors. Roland Levillain
Change-Id: Id12e392ad50f66a6e2251a68662b7959315dc567
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-01-30ART: Change x86 long param ABI (Quick/JNI/Opt) Mark Mendell
Ensure that we don't pass a long parameter across the last register and the stack: skip the register and allocate it only on the stack. This was requested to simplify the optimizing compiler code generation for x86. Optimizing (Baseline) compiler support for x86 longs: - Remove QuickParameter from Location, as there are no longer any uses of it. Bump oat.h version because we changed an ABI again. I changed IsParamALong() to return false for argument 0 (this argument). I am not sure why it differed from all other tests. I have not tested on ARM. I followed Nicolas's suggestions for setting the value of kSplitPairAcrossRegisterAndStack for different architectures. Change-Id: I2f16b33c1dac58dd4f4f503e9c2309d845f5fb7a Signed-off-by: Mark Mendell <mark.p.mendell@intel.com>
2014-07-15Break apart header files. Ian Rogers
Create libart-gtest for common runtime and compiler gtest routines. Rename CompilerCallbacksImpl that is quick compiler specific. Rename trace clock source constants to not use the overloaded profiler term. Change-Id: I4aac4bdc7e7850c68335f81e59a390133b54e933
2014-05-29ART: Use StackReference in Quick Stack Frame Andreas Gampe
The method reference at the bottom of a quick frame is a stack reference and not a native pointer. This is important for 64b architectures, where the notions do not coincide. Change key methods to have StackReference<mirror::ArtMethod>* parameter instead of mirror::ArtMethod**. Make changes to invoke stubs for 64b archs, change the frame setup for JNI code (both generic JNI and compilers), tie up loose ends. Tested on x86 and x86-64 with host tests. On x86-64, tests succeed with jni compiler activated. x86-64 QCG was not tested. Tested on ARM32 with device tests. Fix ARM64 not saving x19 (used for wSUSPEND) on upcalls. Tested on ARM64 in interpreter-only + generic-jni mode. Fix ARM64 JNI Compiler to work with the CL. Tested on ARM64 in interpreter-only + jni compiler. Change-Id: I77931a0cbadd04d163b3eb8d6f6a6f8740578f13
2014-05-13Add Handle/HandleScope and delete SirtRef. Mathieu Chartier
Delete SirtRef and replaced it with Handle. Handles are value types which wrap around StackReference*. Renamed StackIndirectReferenceTable to HandleScope. Added a scoped handle wrapper which wraps around an Object** and restores it in its destructor. Renamed Handle::get -> Get. Bug: 8473721 Change-Id: Idbfebd4f35af629f0f43931b7c5184b334822c7a
2014-05-01ART: aarch64 jni compiler needs to extend small return types Andreas Gampe
As aarch64 calling convention does not mandate extension on return values anymore and leaves the upper bits undefined, the jni compiler needs to sign- or zero-extend the returned values when necessary. As three architectures need extension now, refactor this fact into a flag into a virtual method. Add tests to JniTest that exercise the required extension. Change-Id: Idebb7c4dedebb852e58ade63e1c2b1eeced23104
2014-04-10AArch64: Jni compiler fixes Serban Constantinescu
This patch fixes some of the issues with the ARM64 assembler and JNI compiler. The JNI compiler is not enabled by default, yet. To enable, change line 1884 in compiler/driver/compiler_driver.cc, removing kArm64 from the GenericJNI list. The compiler passes all tests in jni_compiler_test. Also change the common_compiler_test instruction-set-features logic. We allow tests when the build-time features are a subset of the runtime features. Dex2oat cross-compiling is now working. A 32b version of dex2oat should be able to compile correctly. Change-Id: I51d1c24f2c75d4397a11c54724a8b277ff3b3df8 Signed-off-by: Serban Constantinescu <serban.constantinescu@arm.com>
2014-04-10art: Use SIRT::GetAlignedSirtSizeTarget in calling convention Dmitry Petrochenko
Calculate frame size based on SIRT::GetAlignedSirtSizeTarget existing method. Make offset functions pointer-size-dependent for cross-compiling. Add a test to check whether our computations are correct. Change-Id: Ic66daf6f9908890eda906bdcbbc4444c4fef614f Signed-off-by: Dmitry Petrochenko <dmitry.petrochenko@intel.com>
2014-04-01Calling convention support for cross 64/32 compilation. Ian Rogers
Add REX support for x86-64 operands. Change-Id: I093ae26fb8c111d54b8c72166f054984564c04c6
2014-04-01art: Make calling convention immune to SIRT structure change Dmitry Petrochenko
Introduce stack_indirect_reference_table::referencesOffset and rely on it in calling convention to avoid issues if SIRT structure change. Change-Id: Icc0c5c5b1313173df2ee519ab8934183074fdfb6 Signed-off-by: Dmitry Petrochenko <dmitry.petrochenko@intel.com>
2014-03-28x86_64: JNI compiler Dmitry Petrochenko
Passed all tests from jni_compiler_test and art/test on host with jni_copiler. Incoming argument spill is enabled, entry_spills refactored. Now each entry spill contains data type size (4 or 8) and offset which should be used for spill. Assembler REX support implemented in opcodes used in JNI compiler. Please note, JNI compiler is not enabled by default yet (see compiler_driver.cc:1875). Change-Id: I5fd19cca72122b197aec07c3708b1e80c324be44 Signed-off-by: Dmitry Petrochenko <dmitry.petrochenko@intel.com>
2013-07-29Move assembler out of runtime into compiler/utils. Ian Rogers
Other directory layout bits of clean up. There is still work to separate quick and portable in some files (e.g. argument visitor, proxy..). Change-Id: If8fecffda8ba5c4c47a035f0c622c538c6b58351
2013-07-17Fix multiple inclusion guards to match new pathnames Brian Carlstrom
Change-Id: Id7735be1d75bc315733b1773fba45c1deb8ace43
2013-07-12Create separate Android.mk for main build targets Brian Carlstrom
The runtime, compiler, dex2oat, and oatdump now are in seperate trees to prevent dependency creep. They can now be individually built without rebuilding the rest of the art projects. dalvikvm and jdwpspy were already this way. Builds in the art directory should behave as before, building everything including tests. Change-Id: Ic6b1151e5ed0f823c3dd301afd2b13eb2d8feb81