summaryrefslogtreecommitdiff
path: root/compiler/optimizing
diff options
context:
space:
mode:
author Nicolas Geoffray <ngeoffray@google.com> 2023-05-04 08:36:04 +0000
committer Nicolas Geoffray <ngeoffray@google.com> 2023-05-04 11:50:40 +0000
commitbe726b5fb9fa19e9731faa6cacd747efbde9d5b9 (patch)
tree29fc5d7fd3acba9a758b8e4fd63bc1af88212314 /compiler/optimizing
parent5c909cbb1fe34ec7f0775864650e1c86710023b9 (diff)
Reland "Support FastVerify with speed-profile."
This reverts commit 4297f22d902cf156e14c330147215d5f2fa9bd7f. Bug: 279728780 Reason for revert: Resolve classes in inliner. Change-Id: I4f93ac5d195eb2f473ec50fe7cc70881dcddee6f
Diffstat (limited to 'compiler/optimizing')
-rw-r--r--compiler/optimizing/inliner.cc6
-rw-r--r--compiler/optimizing/reference_type_propagation.cc11
2 files changed, 12 insertions, 5 deletions
diff --git a/compiler/optimizing/inliner.cc b/compiler/optimizing/inliner.cc
index 443392ba28..59d6c7f66d 100644
--- a/compiler/optimizing/inliner.cc
+++ b/compiler/optimizing/inliner.cc
@@ -702,12 +702,14 @@ HInliner::InlineCacheType HInliner::GetInlineCacheAOT(
// Walk over the class descriptors and look up the actual classes.
// If we cannot find a type we return kInlineCacheMissingTypes.
ClassLinker* class_linker = caller_compilation_unit_.GetClassLinker();
+ Thread* self = Thread::Current();
for (const dex::TypeIndex& type_index : dex_pc_data.classes) {
const DexFile* dex_file = caller_compilation_unit_.GetDexFile();
const char* descriptor = pci->GetTypeDescriptor(dex_file, type_index);
- ObjPtr<mirror::ClassLoader> class_loader = caller_compilation_unit_.GetClassLoader().Get();
- ObjPtr<mirror::Class> clazz = class_linker->LookupResolvedType(descriptor, class_loader);
+ ObjPtr<mirror::Class> clazz =
+ class_linker->FindClass(self, descriptor, caller_compilation_unit_.GetClassLoader());
if (clazz == nullptr) {
+ self->ClearException(); // Clean up the exception left by type resolution.
VLOG(compiler) << "Could not find class from inline cache in AOT mode "
<< invoke_instruction->GetMethodReference().PrettyMethod()
<< " : "
diff --git a/compiler/optimizing/reference_type_propagation.cc b/compiler/optimizing/reference_type_propagation.cc
index 6d4fdf3a55..3a5cceed9a 100644
--- a/compiler/optimizing/reference_type_propagation.cc
+++ b/compiler/optimizing/reference_type_propagation.cc
@@ -539,9 +539,14 @@ void ReferenceTypePropagation::RTPVisitor::UpdateReferenceTypeInfo(HInstruction*
DCHECK_EQ(instr->GetType(), DataType::Type::kReference);
ScopedObjectAccess soa(Thread::Current());
- ObjPtr<mirror::DexCache> dex_cache = FindDexCacheWithHint(soa.Self(), dex_file, hint_dex_cache_);
- ObjPtr<mirror::Class> klass = Runtime::Current()->GetClassLinker()->LookupResolvedType(
- type_idx, dex_cache, dex_cache->GetClassLoader());
+ StackHandleScope<2> hs(soa.Self());
+ Handle<mirror::DexCache> dex_cache =
+ hs.NewHandle(FindDexCacheWithHint(soa.Self(), dex_file, hint_dex_cache_));
+ Handle<mirror::ClassLoader> loader = hs.NewHandle(dex_cache->GetClassLoader());
+ ObjPtr<mirror::Class> klass = Runtime::Current()->GetClassLinker()->ResolveType(
+ type_idx, dex_cache, loader);
+ DCHECK_EQ(klass == nullptr, soa.Self()->IsExceptionPending());
+ soa.Self()->ClearException(); // Clean up the exception left by type resolution if any.
SetClassAsTypeInfo(instr, klass, is_exact);
}