diff options
author | 2021-11-17 13:16:35 +0000 | |
---|---|---|
committer | 2021-11-22 15:28:02 +0000 | |
commit | c17656bcf477e57d59ff051037c96994fd0ac8f2 (patch) | |
tree | 78704cdca54c7437a34c9ca4b9da27ed6e9c0f4d /runtime/entrypoints/quick/quick_entrypoints.h | |
parent | 53296a7ed4ccf1cccfb32ed9da3aae90bc8b7ff2 (diff) |
JNI: Rewrite locking for synchronized methods.
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
Diffstat (limited to 'runtime/entrypoints/quick/quick_entrypoints.h')
-rw-r--r-- | runtime/entrypoints/quick/quick_entrypoints.h | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/runtime/entrypoints/quick/quick_entrypoints.h b/runtime/entrypoints/quick/quick_entrypoints.h index 377a63ee41..cf5c697b76 100644 --- a/runtime/entrypoints/quick/quick_entrypoints.h +++ b/runtime/entrypoints/quick/quick_entrypoints.h @@ -55,35 +55,19 @@ struct PACKED(4) QuickEntryPoints { // JNI entrypoints. // TODO: NO_THREAD_SAFETY_ANALYSIS due to different control paths depending on fast JNI. extern void JniMethodStart(Thread* self) NO_THREAD_SAFETY_ANALYSIS HOT_ATTR; -extern void JniMethodStartSynchronized(jobject to_lock, Thread* self) - NO_THREAD_SAFETY_ANALYSIS HOT_ATTR; extern void JniMethodEnd(Thread* self) NO_THREAD_SAFETY_ANALYSIS HOT_ATTR; -extern void JniMethodEndSynchronized(jobject locked, Thread* self) - NO_THREAD_SAFETY_ANALYSIS HOT_ATTR; extern mirror::Object* JniMethodEndWithReference(jobject result, Thread* self) NO_THREAD_SAFETY_ANALYSIS HOT_ATTR; -extern mirror::Object* JniMethodEndWithReferenceSynchronized(jobject result, - jobject locked, - Thread* self) - NO_THREAD_SAFETY_ANALYSIS HOT_ATTR; extern mirror::Object* JniDecodeReferenceResult(jobject result, Thread* self) NO_THREAD_SAFETY_ANALYSIS HOT_ATTR; // JNI entrypoints when monitoring entry/exit. extern void JniMonitoredMethodStart(Thread* self) NO_THREAD_SAFETY_ANALYSIS HOT_ATTR; -extern void JniMonitoredMethodStartSynchronized(jobject to_lock, Thread* self) - NO_THREAD_SAFETY_ANALYSIS HOT_ATTR; extern void JniMonitoredMethodEnd(Thread* self) NO_THREAD_SAFETY_ANALYSIS HOT_ATTR; -extern void JniMonitoredMethodEndSynchronized(jobject locked, Thread* self) - NO_THREAD_SAFETY_ANALYSIS HOT_ATTR; extern mirror::Object* JniMonitoredMethodEndWithReference(jobject result, Thread* self) NO_THREAD_SAFETY_ANALYSIS HOT_ATTR; -extern mirror::Object* JniMonitoredMethodEndWithReferenceSynchronized(jobject result, - jobject locked, - Thread* self) - NO_THREAD_SAFETY_ANALYSIS HOT_ATTR; extern "C" mirror::String* artStringBuilderAppend(uint32_t format, @@ -93,6 +77,8 @@ extern "C" mirror::String* artStringBuilderAppend(uint32_t format, extern "C" void artReadBarrierJni(ArtMethod* method) REQUIRES_SHARED(Locks::mutator_lock_) HOT_ATTR; +extern "C" void artUnlockObjectFromJni(mirror::Object* locked, Thread* self) + REQUIRES_SHARED(Locks::mutator_lock_) HOT_ATTR; // Read barrier entrypoints. // |