Remove `ArtField::GetOffsetDCheck()`.
Similar to the `ArtField::GetAccessFlagsDCheck()` removed in
https://android-review.googlesource.com/1982826 ,
remove the `ArtField::GetOffsetDCheck()` as the read barrier
when retrieving the declaring class may be undesirable in
some contexts and the check provides very little value.
Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing
Bug: 181943478
Change-Id: I57e1c13855a1ce4f5fb3e1fe3e5187e3f794cea7
diff --git a/runtime/art_field.cc b/runtime/art_field.cc
index be5ac8c..c248bf7 100644
--- a/runtime/art_field.cc
+++ b/runtime/art_field.cc
@@ -67,8 +67,4 @@
return result;
}
-void ArtField::GetOffsetDCheck() {
- CHECK(GetDeclaringClass()->IsResolved());
-}
-
} // namespace art
diff --git a/runtime/art_field.h b/runtime/art_field.h
index 0484622..e2a88e4 100644
--- a/runtime/art_field.h
+++ b/runtime/art_field.h
@@ -87,9 +87,6 @@
// Offset to field within an Object.
MemberOffset GetOffset() REQUIRES_SHARED(Locks::mutator_lock_) {
- if (kIsDebugBuild) {
- GetOffsetDCheck();
- }
return MemberOffset(offset_);
}
@@ -239,8 +236,6 @@
ObjPtr<mirror::Class> ProxyFindSystemClass(const char* descriptor)
REQUIRES_SHARED(Locks::mutator_lock_);
- void GetOffsetDCheck() REQUIRES_SHARED(Locks::mutator_lock_);
-
GcRoot<mirror::Class> declaring_class_;
uint32_t access_flags_ = 0;