From d6a595baf0f389a7eb29fa3d94390c18a29c28da Mon Sep 17 00:00:00 2001 From: Mathieu Chartier Date: Wed, 3 Aug 2016 18:51:34 -0700 Subject: [PATCH] Fix CC table lookup tests Only set the mark bits for baker barrier, not sure why this doesn't work for table lookup barrier yet. Bug: 30162165 Test: test-art-host with CC table lookup Change-Id: I4309ac22bfc0f8a5c9bf081365e3e38da43eee30 --- runtime/gc/collector/concurrent_copying-inl.h | 3 ++- runtime/mirror/object-inl.h | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/runtime/gc/collector/concurrent_copying-inl.h b/runtime/gc/collector/concurrent_copying-inl.h index 1a7cb36d6..fb774a4d1 100644 --- a/runtime/gc/collector/concurrent_copying-inl.h +++ b/runtime/gc/collector/concurrent_copying-inl.h @@ -166,7 +166,8 @@ inline mirror::Object* ConcurrentCopying::MarkFromReadBarrier(mirror::Object* fr } else { ret = Mark(from_ref); } - if (LIKELY(!rb_mark_bit_stack_full_ && ret->AtomicSetMarkBit(0, 1))) { + // Only set the mark bit for baker barrier. + if (kUseBakerReadBarrier && LIKELY(!rb_mark_bit_stack_full_ && ret->AtomicSetMarkBit(0, 1))) { // If the mark stack is full, we may temporarily go to mark and back to unmarked. Seeing both // values are OK since the only race is doing an unnecessary Mark. if (!rb_mark_bit_stack_->AtomicPushBack(ret)) { diff --git a/runtime/mirror/object-inl.h b/runtime/mirror/object-inl.h index 061bee1ad..0495c957c 100644 --- a/runtime/mirror/object-inl.h +++ b/runtime/mirror/object-inl.h @@ -149,7 +149,6 @@ inline Object* Object::GetReadBarrierPointer() { inline uint32_t Object::GetMarkBit() { #ifdef USE_READ_BARRIER - DCHECK(kUseBakerReadBarrier); return GetLockWord(false).MarkBitState(); #else LOG(FATAL) << "Unreachable"; -- 2.11.0