Refactor conditional uses of ReadBarrier::AssertToSpaceInvariant.
Test: m test-art-host
Bug: 12687968
Change-Id: Idf7de149bc0d0dcfc9efe01918aa026754f9070d
diff --git a/runtime/interpreter/shadow_frame.h b/runtime/interpreter/shadow_frame.h
index 6903af2..80fdadb 100644
--- a/runtime/interpreter/shadow_frame.h
+++ b/runtime/interpreter/shadow_frame.h
@@ -188,9 +188,7 @@
const uint32_t* vreg_ptr = &vregs_[i];
ref = reinterpret_cast<const StackReference<mirror::Object>*>(vreg_ptr)->AsMirrorPtr();
}
- if (kUseReadBarrier) {
- ReadBarrier::AssertToSpaceInvariant(ref);
- }
+ ReadBarrier::MaybeAssertToSpaceInvariant(ref);
if (kVerifyFlags & kVerifyReads) {
VerifyObject(ref);
}
@@ -256,9 +254,7 @@
if (kVerifyFlags & kVerifyWrites) {
VerifyObject(val);
}
- if (kUseReadBarrier) {
- ReadBarrier::AssertToSpaceInvariant(val);
- }
+ ReadBarrier::MaybeAssertToSpaceInvariant(val);
uint32_t* vreg = &vregs_[i];
reinterpret_cast<StackReference<mirror::Object>*>(vreg)->Assign(val);
if (HasReferenceArray()) {