diff options
author | 2023-01-06 12:06:13 +0000 | |
---|---|---|
committer | 2023-01-16 12:14:00 +0000 | |
commit | ae12f96965dd1fb1cf5fefb0188b749e921ba88b (patch) | |
tree | 802eb68fb823189f39cb1d7e57ed9e035568f4b9 /runtime/entrypoints/entrypoint_utils-inl.h | |
parent | e52e4fb74e9f13009af4ffbfb2e5103ce035a94b (diff) |
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
Diffstat (limited to 'runtime/entrypoints/entrypoint_utils-inl.h')
-rw-r--r-- | runtime/entrypoints/entrypoint_utils-inl.h | 4 |
1 files changed, 4 insertions, 0 deletions
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<mirror::Object>* 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); |