summaryrefslogtreecommitdiff
path: root/runtime/gc/reference_processor.cc
diff options
context:
space:
mode:
author Hiroshi Yamauchi <yamauchi@google.com> 2014-05-09 12:21:15 -0700
committer Hiroshi Yamauchi <yamauchi@google.com> 2014-05-09 12:21:15 -0700
commitbfff21aaa05d4fce39481cf7899f7639eb7fd66d (patch)
tree489efb8743f63ccb1e45197f4ae4c6e67cb9c1c4 /runtime/gc/reference_processor.cc
parent25023c744c4388a6459b21cc3babf8c602b024a2 (diff)
Reference::GetReferent() calls by GC should not trigger read barriers.
Otherwise, GC's reference processing would turn all referents alive via read barriers, which is incorrect. Bug: 12687968 Change-Id: I1463365981d55fa74a7bb207dd4a16aeec007f8b
Diffstat (limited to 'runtime/gc/reference_processor.cc')
-rw-r--r--runtime/gc/reference_processor.cc3
1 files changed, 1 insertions, 2 deletions
diff --git a/runtime/gc/reference_processor.cc b/runtime/gc/reference_processor.cc
index 188b6b3f1a..c37f516255 100644
--- a/runtime/gc/reference_processor.cc
+++ b/runtime/gc/reference_processor.cc
@@ -172,7 +172,7 @@ void ReferenceProcessor::DelayReferenceReferent(mirror::Class* klass, mirror::Re
IsMarkedCallback is_marked_callback, void* arg) {
// klass can be the class of the old object if the visitor already updated the class of ref.
DCHECK(klass->IsReferenceClass());
- mirror::Object* referent = ref->GetReferent();
+ mirror::Object* referent = ref->GetReferent<kWithoutReadBarrier>();
if (referent != nullptr) {
mirror::Object* forward_address = is_marked_callback(referent, arg);
// Null means that the object is not currently marked.
@@ -219,4 +219,3 @@ void ReferenceProcessor::EnqueueClearedReferences() {
} // namespace gc
} // namespace art
-