summaryrefslogtreecommitdiffstats
path: root/compiler/image_writer.cc
diff options
context:
space:
mode:
authorHiroshi Yamauchi <yamauchi@google.com>2014-01-31 13:35:49 -0800
committerHiroshi Yamauchi <yamauchi@google.com>2014-02-25 13:56:48 -0800
commit9d04a20bde1b1855cefc64aebc1a44e253b1a13b (patch)
tree85b8315677c3d6545ac6c8b27db7cb00b82e68b7 /compiler/image_writer.cc
parent0f8aa6b38f204ccacd3ac12bb844e628cec2215b (diff)
downloadart-9d04a20bde1b1855cefc64aebc1a44e253b1a13b.zip
art-9d04a20bde1b1855cefc64aebc1a44e253b1a13b.tar.gz
art-9d04a20bde1b1855cefc64aebc1a44e253b1a13b.tar.bz2
(Experimental) Add Brooks pointers.
This feature is disabled by default. Verified that the Brooks pointers are installed correctly by using the CMS/SS collectors. Change-Id: Ia9be9814ab6e29169ac85edc4792ce8c81d552a9
Diffstat (limited to 'compiler/image_writer.cc')
-rw-r--r--compiler/image_writer.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler/image_writer.cc b/compiler/image_writer.cc
index c8447be..aa16885 100644
--- a/compiler/image_writer.cc
+++ b/compiler/image_writer.cc
@@ -583,6 +583,12 @@ void ImageWriter::FixupObject(Object* orig, Object* copy) {
DCHECK(orig != NULL);
DCHECK(copy != NULL);
copy->SetClass<kVerifyNone>(down_cast<Class*>(GetImageAddress(orig->GetClass())));
+ if (kUseBrooksPointer) {
+ orig->AssertSelfBrooksPointer();
+ // Note the address 'copy' isn't the same as the image address of 'orig'.
+ copy->SetBrooksPointer(GetImageAddress(orig));
+ DCHECK(copy->GetBrooksPointer() == GetImageAddress(orig));
+ }
// TODO: special case init of pointers to malloc data (or removal of these pointers)
if (orig->IsClass<kVerifyNone>()) {
FixupClass(orig->AsClass<kVerifyNone>(), down_cast<Class*>(copy));