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
diff --git a/runtime/gc/collector/concurrent_copying-inl.h b/runtime/gc/collector/concurrent_copying-inl.h
index 1a7cb36..fb774a4 100644
--- a/runtime/gc/collector/concurrent_copying-inl.h
+++ b/runtime/gc/collector/concurrent_copying-inl.h
@@ -166,7 +166,8 @@
} 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 061bee1..0495c95 100644
--- a/runtime/mirror/object-inl.h
+++ b/runtime/mirror/object-inl.h
@@ -149,7 +149,6 @@
inline uint32_t Object::GetMarkBit() {
#ifdef USE_READ_BARRIER
- DCHECK(kUseBakerReadBarrier);
return GetLockWord(false).MarkBitState();
#else
LOG(FATAL) << "Unreachable";