summaryrefslogtreecommitdiff
path: root/runtime/gc/reference_processor.cc
diff options
context:
space:
mode:
author Nicolas Geoffray <ngeoffray@google.com> 2025-01-21 11:47:52 +0000
committer Nicolas Geoffray <ngeoffray@google.com> 2025-01-21 09:11:38 -0800
commitb30c5a0d84cd03ae465bda61ee41ddaec326b9d5 (patch)
tree1c099edff66d4df1c3654f0b615bec23cc72b3b2 /runtime/gc/reference_processor.cc
parent761ea222e35e0ffacb2149ce22a92b3c6a4bdf79 (diff)
Add new WellKnownClasses fields to avoid harcoded constants.
Test: test.py Change-Id: I3a065dd5582269792032df0c6446c3c4b6cd72be
Diffstat (limited to 'runtime/gc/reference_processor.cc')
-rw-r--r--runtime/gc/reference_processor.cc3
1 files changed, 1 insertions, 2 deletions
diff --git a/runtime/gc/reference_processor.cc b/runtime/gc/reference_processor.cc
index c799f5443b..2621629bb8 100644
--- a/runtime/gc/reference_processor.cc
+++ b/runtime/gc/reference_processor.cc
@@ -54,9 +54,8 @@ ReferenceProcessor::ReferenceProcessor()
static inline MemberOffset GetSlowPathFlagOffset(ObjPtr<mirror::Class> reference_class)
REQUIRES_SHARED(Locks::mutator_lock_) {
DCHECK(reference_class == GetClassRoot<mirror::Reference>());
- ArtField* field = reference_class->GetField(reference_class->NumFields() - 1);
+ ArtField* field = WellKnownClasses::java_lang_ref_Reference_slowPathEnabled;
DCHECK(field->IsStatic());
- DCHECK_STREQ(field->GetName(), "slowPathEnabled");
return field->GetOffset();
}