diff options
author | Mathieu Chartier <mathieuc@google.com> | 2014-05-04 13:18:58 -0700 |
---|---|---|
committer | Mathieu Chartier <mathieuc@google.com> | 2014-05-05 15:46:09 -0700 |
commit | c56057e40938c587a74984651a510e320a8cb4fd (patch) | |
tree | 6595bb7aa27ecf91dc9121d25722b40dec803ee6 /runtime/jni_internal.h | |
parent | 0b8027003514c4fa6a850e5087076e991daaf4c3 (diff) | |
download | android_art-c56057e40938c587a74984651a510e320a8cb4fd.tar.gz android_art-c56057e40938c587a74984651a510e320a8cb4fd.tar.bz2 android_art-c56057e40938c587a74984651a510e320a8cb4fd.zip |
Add lockless SynchronizedGet for indirect reference table.
Used for decoding global references without holding locks.
Results on JniCallback:
Before: 615ms (3 samples).
After: 585ms (3 samples).
Change-Id: Ifcac8d0359cf658d87f695c6eb869d148af002e5
Diffstat (limited to 'runtime/jni_internal.h')
-rw-r--r-- | runtime/jni_internal.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/runtime/jni_internal.h b/runtime/jni_internal.h index ec911b204b..cdf3c47d2e 100644 --- a/runtime/jni_internal.h +++ b/runtime/jni_internal.h @@ -116,7 +116,8 @@ class JavaVMExt : public JavaVM { // JNI global references. ReaderWriterMutex globals_lock DEFAULT_MUTEX_ACQUIRED_AFTER; - IndirectReferenceTable globals GUARDED_BY(globals_lock); + // Not guarded by globals_lock since we sometimes use SynchronizedGet in Thread::DecodeJObject. + IndirectReferenceTable globals; Mutex libraries_lock DEFAULT_MUTEX_ACQUIRED_AFTER; Libraries* libraries GUARDED_BY(libraries_lock); |