summaryrefslogtreecommitdiffstats
path: root/compiler/image_writer.cc
diff options
context:
space:
mode:
authorHiroshi Yamauchi <yamauchi@google.com>2014-03-31 15:14:47 -0700
committerHiroshi Yamauchi <yamauchi@google.com>2014-03-31 17:40:21 -0700
commit624468cd401cc1ac0dd70c746301e0788a597759 (patch)
treeb21c389d43e25c3d95208c9d2f3f1bc81355a4e5 /compiler/image_writer.cc
parentcfd5acf281b0c509f86b13d73c6a8dfa3ea9922c (diff)
downloadart-624468cd401cc1ac0dd70c746301e0788a597759.zip
art-624468cd401cc1ac0dd70c746301e0788a597759.tar.gz
art-624468cd401cc1ac0dd70c746301e0788a597759.tar.bz2
Make the support code for read barriers a bit more general.
Add an option for Baker in addition to Brooks. Bug: 12687968 Change-Id: I8a31db817ff6686c72951b6534f588228e270b11
Diffstat (limited to 'compiler/image_writer.cc')
-rw-r--r--compiler/image_writer.cc12
1 files changed, 7 insertions, 5 deletions
diff --git a/compiler/image_writer.cc b/compiler/image_writer.cc
index 6824183..0405198 100644
--- a/compiler/image_writer.cc
+++ b/compiler/image_writer.cc
@@ -610,11 +610,13 @@ class FixupVisitor {
void ImageWriter::FixupObject(Object* orig, Object* copy) {
DCHECK(orig != nullptr);
DCHECK(copy != nullptr);
- if (kUseBrooksPointer) {
- orig->AssertSelfBrooksPointer();
- // Note the address 'copy' isn't the same as the image address of 'orig'.
- copy->SetBrooksPointer(GetImageAddress(orig));
- DCHECK_EQ(copy->GetBrooksPointer(), GetImageAddress(orig));
+ if (kUseBakerOrBrooksReadBarrier) {
+ orig->AssertReadBarrierPointer();
+ if (kUseBrooksReadBarrier) {
+ // Note the address 'copy' isn't the same as the image address of 'orig'.
+ copy->SetReadBarrierPointer(GetImageAddress(orig));
+ DCHECK_EQ(copy->GetReadBarrierPointer(), GetImageAddress(orig));
+ }
}
FixupVisitor visitor(this, copy);
orig->VisitReferences<true /*visit class*/>(visitor, visitor);