summaryrefslogtreecommitdiffstats
path: root/runtime/read_barrier.h
diff options
context:
space:
mode:
authorHiroshi Yamauchi <yamauchi@google.com>2014-06-18 13:47:35 -0700
committerHiroshi Yamauchi <yamauchi@google.com>2014-06-20 11:23:58 -0700
commitea2e1bd713ca8295ba4fcd01e77a3ce532ea61e4 (patch)
treed41be4b08041c5a2b1af626d8cdf6b69280723d5 /runtime/read_barrier.h
parent241fd1192dfc0f7322660343179f9fc0591ed9ff (diff)
downloadart-ea2e1bd713ca8295ba4fcd01e77a3ce532ea61e4.zip
art-ea2e1bd713ca8295ba4fcd01e77a3ce532ea61e4.tar.gz
art-ea2e1bd713ca8295ba4fcd01e77a3ce532ea61e4.tar.bz2
Add more read barriers for JNI roots.
To make it possible to concurrently scan the JNI global roots (that is, the roots visited by JavaVMExt::VisitRoots()), add read barriers to the indirect reference table and the reference table. Also, add read barriers to the jmethodID/jfieldID decode routines (ScopedObjectAccessAlreadyRunnable::DecodeField/DecodeMethod) so that we can concurrently handle (encoded) fields and methods. Bug: 12687968 Change-Id: I3df4e4e622a572ff0ea8d44b2dc70a4d6b3ba058
Diffstat (limited to 'runtime/read_barrier.h')
-rw-r--r--runtime/read_barrier.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/runtime/read_barrier.h b/runtime/read_barrier.h
index 451d13c..ed5db4e 100644
--- a/runtime/read_barrier.h
+++ b/runtime/read_barrier.h
@@ -33,11 +33,15 @@ namespace mirror {
class ReadBarrier {
public:
+ // It's up to the implementation whether the given field gets
+ // updated whereas the return value must be an updated reference.
template <typename MirrorType, ReadBarrierOption kReadBarrierOption = kWithReadBarrier>
ALWAYS_INLINE static MirrorType* Barrier(
mirror::Object* obj, MemberOffset offset, mirror::HeapReference<MirrorType>* ref_addr)
SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
+ // It's up to the implementation whether the given root gets updated
+ // whereas the return value must be an updated reference.
template <typename MirrorType, ReadBarrierOption kReadBarrierOption = kWithReadBarrier>
ALWAYS_INLINE static MirrorType* BarrierForRoot(MirrorType** root)
SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);