diff options
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/image_writer.cc | 6 | ||||
| -rw-r--r-- | compiler/image_writer.h | 3 | ||||
| -rw-r--r-- | compiler/optimizing/code_generator_arm64.cc | 2 |
3 files changed, 9 insertions, 2 deletions
diff --git a/compiler/image_writer.cc b/compiler/image_writer.cc index 7a34683bb5..c787dc59cd 100644 --- a/compiler/image_writer.cc +++ b/compiler/image_writer.cc @@ -39,6 +39,7 @@ #include "gc/accounting/card_table-inl.h" #include "gc/accounting/heap_bitmap.h" #include "gc/accounting/space_bitmap-inl.h" +#include "gc/collector/concurrent_copying.h" #include "gc/heap.h" #include "gc/space/large_object_space.h" #include "gc/space/space-inl.h" @@ -1823,6 +1824,11 @@ void ImageWriter::CopyAndFixupObject(Object* obj) { const auto it = saved_hashcode_map_.find(obj); dst->SetLockWord(it != saved_hashcode_map_.end() ? LockWord::FromHashCode(it->second, 0u) : LockWord::Default(), false); + if (kUseBakerReadBarrier && gc::collector::ConcurrentCopying::kGrayDirtyImmuneObjects) { + // Treat all of the objects in the image as marked to avoid unnecessary dirty pages. This is + // safe since we mark all of the objects that may reference non immune objects as gray. + CHECK(dst->AtomicSetMarkBit(0, 1)); + } FixupObject(obj, dst); } diff --git a/compiler/image_writer.h b/compiler/image_writer.h index 626a975aa6..7d13656b54 100644 --- a/compiler/image_writer.h +++ b/compiler/image_writer.h @@ -217,8 +217,7 @@ class ImageWriter FINAL { // uint32 = typeof(lockword_) // Subtract read barrier bits since we want these to remain 0, or else it may result in DCHECK // failures due to invalid read barrier bits during object field reads. - static const size_t kBinShift = BitSizeOf<uint32_t>() - kBinBits - - LockWord::kReadBarrierStateSize; + static const size_t kBinShift = BitSizeOf<uint32_t>() - kBinBits - LockWord::kGCStateSize; // 111000.....0 static const size_t kBinMask = ((static_cast<size_t>(1) << kBinBits) - 1) << kBinShift; diff --git a/compiler/optimizing/code_generator_arm64.cc b/compiler/optimizing/code_generator_arm64.cc index f3a09fd09f..bccde49a3a 100644 --- a/compiler/optimizing/code_generator_arm64.cc +++ b/compiler/optimizing/code_generator_arm64.cc @@ -609,6 +609,8 @@ class ReadBarrierMarkSlowPathARM64 : public SlowPathCodeARM64 { DCHECK_NE(obj_.reg(), LR); DCHECK_NE(obj_.reg(), WSP); DCHECK_NE(obj_.reg(), WZR); + // WIP0 is used by the slow path as a temp, it can not be the object register. + DCHECK_NE(obj_.reg(), IP0); DCHECK(0 <= obj_.reg() && obj_.reg() < kNumberOfWRegisters) << obj_.reg(); // "Compact" slow path, saving two moves. // |