summaryrefslogtreecommitdiff
path: root/compiler/dex/inline_method_analyser.cc
diff options
context:
space:
mode:
author Santiago Aboy Solanes <solanes@google.com> 2024-05-02 15:40:47 +0100
committer Treehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com> 2024-05-03 15:40:42 +0000
commita4ac01044c50f4da02c40b8da5520d2eb65b41d9 (patch)
treecd19c2cf8a0422876df3d70327687229748bd77a /compiler/dex/inline_method_analyser.cc
parent721bbf2bfd6ffe689067df5657059925e038bb0d (diff)
Workaround for b/336842546
Resolve the type if it hasn't been resolved before. Also, change to use Handles instead of ObjPtr since ResolveType can potentially suspend. Bug: 336842546 Bug: 73760543 Test: art/test/testrunner/testrunner.py --host --64 --optimizing -b Change-Id: I8ad77e63d6d9cc76fee8aac88742d4a4b678abf5
Diffstat (limited to 'compiler/dex/inline_method_analyser.cc')
-rw-r--r--compiler/dex/inline_method_analyser.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/compiler/dex/inline_method_analyser.cc b/compiler/dex/inline_method_analyser.cc
index 85cf83c099..0567fe12c8 100644
--- a/compiler/dex/inline_method_analyser.cc
+++ b/compiler/dex/inline_method_analyser.cc
@@ -147,8 +147,11 @@ ArtMethod* GetTargetConstructor(ArtMethod* method, const Instruction* invoke_dir
accessor.RegistersSize() - accessor.InsSize());
}
uint32_t method_index = invoke_direct->VRegB_35c();
+ StackHandleScope<2> hs(Thread::Current());
+ Handle<mirror::DexCache> h_dex_cache = hs.NewHandle(method->GetDexCache());
+ Handle<mirror::ClassLoader> h_class_loader = hs.NewHandle(method->GetClassLoader());
ArtMethod* target_method = Runtime::Current()->GetClassLinker()->LookupResolvedMethod(
- method_index, method->GetDexCache(), method->GetClassLoader());
+ method_index, h_dex_cache, h_class_loader);
if (kIsDebugBuild && target_method != nullptr) {
CHECK(!target_method->IsStatic());
CHECK(target_method->IsConstructor());