From b30c5a0d84cd03ae465bda61ee41ddaec326b9d5 Mon Sep 17 00:00:00 2001 From: Nicolas Geoffray Date: Tue, 21 Jan 2025 11:47:52 +0000 Subject: Add new WellKnownClasses fields to avoid harcoded constants. Test: test.py Change-Id: I3a065dd5582269792032df0c6446c3c4b6cd72be --- runtime/gc/reference_processor.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'runtime/gc/reference_processor.cc') 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 reference_class) REQUIRES_SHARED(Locks::mutator_lock_) { DCHECK(reference_class == GetClassRoot()); - 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(); } -- cgit v1.2.3-59-g8ed1b