diff options
author | 2024-05-02 15:40:47 +0100 | |
---|---|---|
committer | 2024-05-03 15:40:42 +0000 | |
commit | a4ac01044c50f4da02c40b8da5520d2eb65b41d9 (patch) | |
tree | cd19c2cf8a0422876df3d70327687229748bd77a /compiler/optimizing/optimizing_compiler.cc | |
parent | 721bbf2bfd6ffe689067df5657059925e038bb0d (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/optimizing/optimizing_compiler.cc')
-rw-r--r-- | compiler/optimizing/optimizing_compiler.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler/optimizing/optimizing_compiler.cc b/compiler/optimizing/optimizing_compiler.cc index 45d534a9ec..a75ac9239b 100644 --- a/compiler/optimizing/optimizing_compiler.cc +++ b/compiler/optimizing/optimizing_compiler.cc @@ -1183,14 +1183,14 @@ CompiledMethod* OptimizingCompiler::JniCompile(uint32_t access_flags, const CompilerOptions& compiler_options = GetCompilerOptions(); if (compiler_options.IsBootImage()) { ScopedObjectAccess soa(Thread::Current()); - ArtMethod* method = runtime->GetClassLinker()->LookupResolvedMethod( - method_idx, dex_cache.Get(), /*class_loader=*/ nullptr); + VariableSizedHandleScope handles(soa.Self()); + ScopedNullHandle<mirror::ClassLoader> class_loader; // null means boot class path loader. + ArtMethod* method = + runtime->GetClassLinker()->LookupResolvedMethod(method_idx, dex_cache, class_loader); // Try to compile a fully intrinsified implementation. Do not try to do this for // signature polymorphic methods as the InstructionBuilder cannot handle them; // and it would be useless as they always have a slow path for type conversions. if (method != nullptr && UNLIKELY(method->IsIntrinsic()) && !method->IsSignaturePolymorphic()) { - VariableSizedHandleScope handles(soa.Self()); - ScopedNullHandle<mirror::ClassLoader> class_loader; // null means boot class path loader. Handle<mirror::Class> compiling_class = handles.NewHandle(method->GetDeclaringClass()); DexCompilationUnit dex_compilation_unit( class_loader, |