Replace the bool kDoReadBarrier template parameter with an enum.
Fix one kDoReadBarrier/kIsVolatile mixup in an Object::GetFieldObject
call.
Bug: 12687968
Change-Id: I896b1137b21a20c0504abd2bf3fe6f83805f3300
diff --git a/runtime/read_barrier-inl.h b/runtime/read_barrier-inl.h
index ea2f830..88e2f8f 100644
--- a/runtime/read_barrier-inl.h
+++ b/runtime/read_barrier-inl.h
@@ -23,17 +23,18 @@
namespace art {
-template <typename MirrorType, bool kDoReadBarrier>
+template <typename MirrorType, ReadBarrierOption kReadBarrierOption>
inline MirrorType* ReadBarrier::Barrier(
mirror::Object* obj, MemberOffset offset, mirror::HeapReference<MirrorType>* ref_addr) {
// Unused for now.
UNUSED(obj);
UNUSED(offset);
UNUSED(ref_addr);
- if (kDoReadBarrier && kUseBakerReadBarrier) {
+ const bool with_read_barrier = kReadBarrierOption == kWithReadBarrier;
+ if (with_read_barrier && kUseBakerReadBarrier) {
// To be implemented.
return ref_addr->AsMirrorPtr();
- } else if (kDoReadBarrier && kUseBrooksReadBarrier) {
+ } else if (with_read_barrier && kUseBrooksReadBarrier) {
// To be implemented.
return ref_addr->AsMirrorPtr();
} else {