diff options
author | Hiroshi Yamauchi <yamauchi@google.com> | 2014-05-29 12:16:04 -0700 |
---|---|---|
committer | Hiroshi Yamauchi <yamauchi@google.com> | 2014-05-29 12:37:49 -0700 |
commit | 196851b634a5bfdd8ab3fb59a320e550b21b0f4d (patch) | |
tree | f9fca2858b6213163d358c2eb2b2f88aa88a027b /runtime/jni_internal.h | |
parent | ea0b6e284cab12eed88eebf6aa19e6292af57389 (diff) | |
download | art-196851b634a5bfdd8ab3fb59a320e550b21b0f4d.zip art-196851b634a5bfdd8ab3fb59a320e550b21b0f4d.tar.gz art-196851b634a5bfdd8ab3fb59a320e550b21b0f4d.tar.bz2 |
Add read barriers for the weak roots in the JNI weak globals.
Bug: 12687968
Change-Id: Ic265a0e162e8cc9edc4ab7fa34f8afd5ce968d08
Diffstat (limited to 'runtime/jni_internal.h')
-rw-r--r-- | runtime/jni_internal.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/runtime/jni_internal.h b/runtime/jni_internal.h index 7e76e11..4072da4 100644 --- a/runtime/jni_internal.h +++ b/runtime/jni_internal.h @@ -129,6 +129,9 @@ class JavaVMExt : public JavaVM { // TODO: Make the other members of this class also private. // JNI weak global references. Mutex weak_globals_lock_ DEFAULT_MUTEX_ACQUIRED_AFTER; + // Since weak_globals_ contain weak roots, be careful not to + // directly access the object references in it. Use Get() with the + // read barrier enabled. IndirectReferenceTable weak_globals_ GUARDED_BY(weak_globals_lock_); bool allow_new_weak_globals_ GUARDED_BY(weak_globals_lock_); ConditionVariable weak_globals_add_condition_ GUARDED_BY(weak_globals_lock_); |