From ae12f96965dd1fb1cf5fefb0188b749e921ba88b Mon Sep 17 00:00:00 2001 From: Nicolas Geoffray Date: Fri, 6 Jan 2023 12:06:13 +0000 Subject: Refactor code aroud method resolution. - Make unresolved AOT entrypoints use the tls cache - Remove duplicate code - Inline method access checks logic in its only use. - Fix in ClassLinker::ResolveMethodWithoutInvokeType() by calling shared helper. Test: test.py Change-Id: I1f42b5d0ac1dcd9c5eb483db9c5c5eefc9b2f4d1 --- runtime/entrypoints/entrypoint_utils-inl.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'runtime/entrypoints/entrypoint_utils-inl.h') diff --git a/runtime/entrypoints/entrypoint_utils-inl.h b/runtime/entrypoints/entrypoint_utils-inl.h index 91163f4139..cbe754337c 100644 --- a/runtime/entrypoints/entrypoint_utils-inl.h +++ b/runtime/entrypoints/entrypoint_utils-inl.h @@ -519,6 +519,7 @@ ArtMethod* FindMethodToCall(Thread* self, ArtMethod* caller, ObjPtr* this_object, const Instruction& inst, + bool only_lookup_tls_cache, /*out*/ bool* string_init) REQUIRES_SHARED(Locks::mutator_lock_) { PointerSize pointer_size = Runtime::Current()->GetClassLinker()->GetImagePointerSize(); @@ -526,6 +527,9 @@ ArtMethod* FindMethodToCall(Thread* self, // Try to find the method in thread-local cache. size_t tls_value = 0u; if (!self->GetInterpreterCache()->Get(self, &inst, &tls_value)) { + if (only_lookup_tls_cache) { + return nullptr; + } DCHECK(!self->IsExceptionPending()); // NterpGetMethod can suspend, so save this_object. StackHandleScope<1> hs(self); -- cgit v1.2.3-59-g8ed1b