summaryrefslogtreecommitdiffstats
path: root/runtime/mirror/art_field.h
diff options
context:
space:
mode:
authorHiroshi Yamauchi <yamauchi@google.com>2014-06-25 14:30:41 -0700
committerHiroshi Yamauchi <yamauchi@google.com>2014-06-27 15:09:19 -0700
commit4f1ebc2b86c8467d1ecb3ec655316e6d7ee8b8b5 (patch)
tree59a2e44c7dbe82811f56657c43d99f1111c75f26 /runtime/mirror/art_field.h
parent5703029de6c56c6f85b3ecbd4e2eee80e025772d (diff)
downloadart-4f1ebc2b86c8467d1ecb3ec655316e6d7ee8b8b5.zip
art-4f1ebc2b86c8467d1ecb3ec655316e6d7ee8b8b5.tar.gz
art-4f1ebc2b86c8467d1ecb3ec655316e6d7ee8b8b5.tar.bz2
Add read barriers to the constant roots.
This change makes it possible to concurrently scan the constant roots (the roots visited by Runtime::VisitConstantRoots()) such as the class of java.lang.Class by adding read barriers. Bug: 12687968 Change-Id: If1afea471c4e1093688d2db37b7f1fc2742edeef
Diffstat (limited to 'runtime/mirror/art_field.h')
-rw-r--r--runtime/mirror/art_field.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/runtime/mirror/art_field.h b/runtime/mirror/art_field.h
index 4858613..502cec7 100644
--- a/runtime/mirror/art_field.h
+++ b/runtime/mirror/art_field.h
@@ -23,6 +23,7 @@
#include "modifiers.h"
#include "object.h"
#include "object_callbacks.h"
+#include "read_barrier.h"
namespace art {
@@ -121,9 +122,11 @@ class MANAGED ArtField : public Object {
template<bool kTransactionActive>
void SetObj(Object* object, Object* new_value) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
- static Class* GetJavaLangReflectArtField() {
+ template<ReadBarrierOption kReadBarrierOption = kWithReadBarrier>
+ static Class* GetJavaLangReflectArtField() SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
DCHECK(java_lang_reflect_ArtField_ != nullptr);
- return java_lang_reflect_ArtField_;
+ return ReadBarrier::BarrierForRoot<mirror::Class, kReadBarrierOption>(
+ &java_lang_reflect_ArtField_);
}
static void SetClass(Class* java_lang_reflect_ArtField);