summaryrefslogtreecommitdiff
path: root/runtime/entrypoints_order_test.cc
diff options
context:
space:
mode:
author Vladimir Marko <vmarko@google.com> 2021-11-15 13:38:02 +0000
committer Vladimir Marko <vmarko@google.com> 2021-11-17 11:51:30 +0000
commit23cf32f278374b89d0acbec74a510b77d543bed8 (patch)
tree8d6eed696509a7a28fce2da09d8487954815d8ee /runtime/entrypoints_order_test.cc
parentbd95682d8a3ddb6f5e2ce1563d25e52ba2d823d7 (diff)
JNI: Faster mutator locking during transition.
Add mutator lock pointer to `Thread`. This makes retrieving the pointer faster on ARM and ARM64 and makes it accessible for JNI stubs if we decide to inline `JniMethodStart()` and `JniMethodEnd()`. Pass the lock level `kMutatorLock` explicitly from the `MutatorMutex` functions to let the compiler evaluate a lot of the conditions statically and avoid unnecessary code. Golem results for art-opt-cc (higher is better): linux-armv7 before after NativeDowncallStaticNormal 6.3694 7.2394 (+13.66%) NativeDowncallStaticNormal6 6.0663 6.8527 (+12.96%) NativeDowncallStaticNormalRefs6 5.7061 6.3945 (+12.06%) NativeDowncallVirtualNormal 5.7088 7.2081 (+26.26%) NativeDowncallVirtualNormal6 5.4563 6.7929 (+24.49%) NativeDowncallVirtualNormalRefs6 5.1595 6.3415 (+22.91%) linux-armv8 before after NativeDowncallStaticNormal 6.4229 7.0423 (+9.642%) NativeDowncallStaticNormal6 6.2651 6.8527 (+9.379%) NativeDowncallStaticNormalRefs6 5.8824 6.3976 (+8.760%) NativeDowncallVirtualNormal 6.2651 6.8527 (+9.379%) NativeDowncallVirtualNormal6 6.0663 6.6163 (+9.066%) NativeDowncallVirtualNormalRefs6 5.6630 6.1408 (+8.436%) There does not seem to be a measurable difference for x86 and x86-64. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Bug: 172332525 Change-Id: I2ad511a2fe7bac250549c43789cf3fb5e2de9e25
Diffstat (limited to 'runtime/entrypoints_order_test.cc')
-rw-r--r--runtime/entrypoints_order_test.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/runtime/entrypoints_order_test.cc b/runtime/entrypoints_order_test.cc
index 609f0811f4..c19e000d1e 100644
--- a/runtime/entrypoints_order_test.cc
+++ b/runtime/entrypoints_order_test.cc
@@ -126,7 +126,8 @@ class EntrypointsOrderTest : public CommonRuntimeTest {
sizeof(void*) * kNumRosAllocThreadLocalSizeBracketsInThread);
EXPECT_OFFSET_DIFFP(Thread, tlsPtr_, thread_local_alloc_stack_top, thread_local_alloc_stack_end,
sizeof(void*));
- EXPECT_OFFSET_DIFFP(Thread, tlsPtr_, thread_local_alloc_stack_end, held_mutexes, sizeof(void*));
+ EXPECT_OFFSET_DIFFP(Thread, tlsPtr_, thread_local_alloc_stack_end, mutator_lock, sizeof(void*));
+ EXPECT_OFFSET_DIFFP(Thread, tlsPtr_, mutator_lock, held_mutexes, sizeof(void*));
EXPECT_OFFSET_DIFFP(Thread, tlsPtr_, held_mutexes, flip_function,
sizeof(void*) * kLockLevelCount);
EXPECT_OFFSET_DIFFP(Thread, tlsPtr_, flip_function, method_verifier, sizeof(void*));