Performance improvements by removing a DMB and inlining.
Correct the version of CAS used by Mutex::Lock to be acquire and not release.
Don't do a memory barrier in thread transitions when there is already a
barrier associated with the mutator lock.
Force inlining of the hot thread and shared lock code, heavily used by down
calls and JNI.
Force inlining of mirror routines that are used by runtime support and hot.
Performance was measured and improved using perf and maps.
Change-Id: I012580e337143236d8b6d06c1e270183ae51083c
diff --git a/src/oat/runtime/oat_support_entrypoints.h b/src/oat/runtime/oat_support_entrypoints.h
index a08a584..ee59df4 100644
--- a/src/oat/runtime/oat_support_entrypoints.h
+++ b/src/oat/runtime/oat_support_entrypoints.h
@@ -141,6 +141,26 @@
void (*pThrowStackOverflowFromCode)(void*);
};
+// JNI entrypoints.
+extern void* FindNativeMethod(Thread* thread) LOCKS_EXCLUDED(Locks::mutator_lock_);
+extern uint32_t JniMethodStart(Thread* self)
+ UNLOCK_FUNCTION(Locks::mutator_lock_) __attribute__ ((hot));
+extern uint32_t JniMethodStartSynchronized(jobject to_lock, Thread* self)
+ UNLOCK_FUNCTION(Locks::mutator_lock_) __attribute__ ((hot));
+extern void JniMethodEnd(uint32_t saved_local_ref_cookie, Thread* self)
+ SHARED_LOCK_FUNCTION(Locks::mutator_lock_) __attribute__ ((hot));
+extern void JniMethodEndSynchronized(uint32_t saved_local_ref_cookie, jobject locked,
+ Thread* self)
+ SHARED_LOCK_FUNCTION(Locks::mutator_lock_) __attribute__ ((hot));
+extern mirror::Object* JniMethodEndWithReference(jobject result, uint32_t saved_local_ref_cookie,
+ Thread* self)
+ SHARED_LOCK_FUNCTION(Locks::mutator_lock_) __attribute__ ((hot));
+
+extern mirror::Object* JniMethodEndWithReferenceSynchronized(jobject result,
+ uint32_t saved_local_ref_cookie,
+ jobject locked, Thread* self)
+ SHARED_LOCK_FUNCTION(Locks::mutator_lock_) __attribute__ ((hot));
+
// Initialize an entry point data structure.
void InitEntryPoints(EntryPoints* points);