Add read barrier comments for ArtField::IsProxyField().
Also use the same formulation for ArtMethod::IsProxyMethod()
and use the ArtField::IsProxyField() where appropriate, thus
avoiding some read barriers.
Test: Rely on TreeHugger.
Bug: 119486698
Change-Id: Ie71de0e4d163ecde2ebac55d27b46a8ca51859bf
diff --git a/runtime/art_method-inl.h b/runtime/art_method-inl.h
index e28ffa2..a81c7e2 100644
--- a/runtime/art_method-inl.h
+++ b/runtime/art_method-inl.h
@@ -316,8 +316,8 @@
inline bool ArtMethod::IsProxyMethod() {
DCHECK(!IsRuntimeMethod()) << "ArtMethod::IsProxyMethod called on a runtime method";
- // Avoid read barrier since the from-space version of the class will have the correct proxy class
- // flags since they are constant for the lifetime of the class.
+ // No read barrier needed, we're reading the constant declaring class only to read
+ // the constant proxy flag. See ReadBarrierOption.
return GetDeclaringClass<kWithoutReadBarrier>()->IsProxyClass();
}