diff options
Diffstat (limited to 'compiler/optimizing/sharpening.cc')
-rw-r--r-- | compiler/optimizing/sharpening.cc | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/compiler/optimizing/sharpening.cc b/compiler/optimizing/sharpening.cc index cb9edc0127..1fd76f7029 100644 --- a/compiler/optimizing/sharpening.cc +++ b/compiler/optimizing/sharpening.cc @@ -275,18 +275,15 @@ HLoadClass::LoadKind HSharpening::ComputeLoadClassKind( } HLoadClass::LoadKind load_kind = codegen->GetSupportedLoadClassKind(desired_load_kind); - // If we cannot reference this class due to .bss requirements, we're forced to bail. if (!IsSameDexFile(load_class->GetDexFile(), *dex_compilation_unit.GetDexFile())) { - if (load_kind == HLoadClass::LoadKind::kRuntimeCall) { - return HLoadClass::LoadKind::kInvalid; - } - - if (load_kind == HLoadClass::LoadKind::kBssEntry || + if (load_kind == HLoadClass::LoadKind::kRuntimeCall || + load_kind == HLoadClass::LoadKind::kBssEntry || load_kind == HLoadClass::LoadKind::kBssEntryPublic || load_kind == HLoadClass::LoadKind::kBssEntryPackage) { - if (!codegen->GetCompilerOptions().WithinOatFile(&load_class->GetDexFile())) { - return HLoadClass::LoadKind::kInvalid; - } + // We actually cannot reference this class, we're forced to bail. + // We cannot reference this class with Bss, as the entrypoint will lookup the class + // in the caller's dex file, but that dex file does not reference the class. + return HLoadClass::LoadKind::kInvalid; } } return load_kind; |