From a4ac01044c50f4da02c40b8da5520d2eb65b41d9 Mon Sep 17 00:00:00 2001 From: Santiago Aboy Solanes Date: Thu, 2 May 2024 15:40:47 +0100 Subject: 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 --- compiler/optimizing/optimizing_compiler.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'compiler/optimizing/optimizing_compiler.cc') 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 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 class_loader; // null means boot class path loader. Handle compiling_class = handles.NewHandle(method->GetDeclaringClass()); DexCompilationUnit dex_compilation_unit( class_loader, -- cgit v1.2.3-59-g8ed1b