summaryrefslogtreecommitdiff
path: root/compiler/jni/jni_compiler_test.cc
diff options
context:
space:
mode:
author Vladimir Marko <vmarko@google.com> 2021-03-23 16:32:52 +0000
committer Vladimir Marko <vmarko@google.com> 2021-10-11 11:56:59 +0000
commitd95a1f2ecf322d21ae98bfb7affe0070ddb9bc08 (patch)
tree8fc5fe8370ec051289a34cde7bf3dc5fc7a1ca7f /compiler/jni/jni_compiler_test.cc
parent507a729e51588f7fa4eac7579d54ce7c96804349 (diff)
Inline IRT frame push/pop into JNI stubs.
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
Diffstat (limited to 'compiler/jni/jni_compiler_test.cc')
-rw-r--r--compiler/jni/jni_compiler_test.cc35
1 files changed, 10 insertions, 25 deletions
diff --git a/compiler/jni/jni_compiler_test.cc b/compiler/jni/jni_compiler_test.cc
index dc5304ccf0..e3d0abb7d3 100644
--- a/compiler/jni/jni_compiler_test.cc
+++ b/compiler/jni/jni_compiler_test.cc
@@ -411,24 +411,20 @@ class JniCompilerTest : public CommonCompilerTest {
}
};
- static uint32_t JniMethodStartSynchronizedOverride(jobject to_lock, Thread* self);
- static void JniMethodEndSynchronizedOverride(uint32_t saved_local_ref_cookie,
- jobject locked,
- Thread* self);
+ static void JniMethodStartSynchronizedOverride(jobject to_lock, Thread* self);
+ static void JniMethodEndSynchronizedOverride(jobject locked, Thread* self);
static mirror::Object* JniMethodEndWithReferenceSynchronizedOverride(
jobject result,
- uint32_t saved_local_ref_cookie,
jobject locked,
Thread* self);
- using StartSynchronizedType = uint32_t (*)(jobject, Thread*);
- using EndSynchronizedType = void (*)(uint32_t, jobject, Thread*);
- using EndWithReferenceSynchronizedType = mirror::Object* (*)(jobject, uint32_t, jobject, Thread*);
+ using StartSynchronizedType = void (*)(jobject, Thread*);
+ using EndSynchronizedType = void (*)(jobject, Thread*);
+ using EndWithReferenceSynchronizedType = mirror::Object* (*)(jobject, jobject, Thread*);
static StartSynchronizedType jni_method_start_synchronized_original_;
static EndSynchronizedType jni_method_end_synchronized_original_;
static EndWithReferenceSynchronizedType jni_method_end_with_reference_synchronized_original_;
- static uint32_t saved_local_ref_cookie_;
static jobject locked_object_;
bool check_generic_jni_;
@@ -441,35 +437,24 @@ JniCompilerTest::StartSynchronizedType JniCompilerTest::jni_method_start_synchro
JniCompilerTest::EndSynchronizedType JniCompilerTest::jni_method_end_synchronized_original_;
JniCompilerTest::EndWithReferenceSynchronizedType
JniCompilerTest::jni_method_end_with_reference_synchronized_original_;
-uint32_t JniCompilerTest::saved_local_ref_cookie_;
jobject JniCompilerTest::locked_object_;
-uint32_t JniCompilerTest::JniMethodStartSynchronizedOverride(jobject to_lock, Thread* self) {
+void JniCompilerTest::JniMethodStartSynchronizedOverride(jobject to_lock, Thread* self) {
locked_object_ = to_lock;
- uint32_t cookie = jni_method_start_synchronized_original_(to_lock, self);
- saved_local_ref_cookie_ = cookie;
- return cookie;
+ jni_method_start_synchronized_original_(to_lock, self);
}
-void JniCompilerTest::JniMethodEndSynchronizedOverride(uint32_t saved_local_ref_cookie,
- jobject locked,
- Thread* self) {
- EXPECT_EQ(saved_local_ref_cookie_, saved_local_ref_cookie);
+void JniCompilerTest::JniMethodEndSynchronizedOverride(jobject locked, Thread* self) {
EXPECT_EQ(locked_object_, locked);
- jni_method_end_synchronized_original_(saved_local_ref_cookie, locked, self);
+ jni_method_end_synchronized_original_(locked, self);
}
mirror::Object* JniCompilerTest::JniMethodEndWithReferenceSynchronizedOverride(
jobject result,
- uint32_t saved_local_ref_cookie,
jobject locked,
Thread* self) {
- EXPECT_EQ(saved_local_ref_cookie_, saved_local_ref_cookie);
EXPECT_EQ(locked_object_, locked);
- return jni_method_end_with_reference_synchronized_original_(result,
- saved_local_ref_cookie,
- locked,
- self);
+ return jni_method_end_with_reference_synchronized_original_(result, locked, self);
}
// Test the normal compiler and normal generic JNI only.