CompilerOptions::~CompilerOptions() { // Everything done by member destructors. // The definitions of classes forward-declared in the header have now been #included.
}
bool CompilerOptions::IsImageClass(TypeReference type_ref, size_t array_dim) const {
DCHECK(type_ref.dex_file != nullptr);
DCHECK_LT(type_ref.index, type_ref.dex_file->NumTypeIds()); if (array_dim == kInferArrayDim) {
std::string_view descriptor = type_ref.dex_file->GetTypeDescriptorView(type_ref.TypeIndex());
array_dim = descriptor.find_first_not_of('[');
DCHECK_NE(array_dim, std::string_view::npos); if (array_dim != 0u) {
descriptor.remove_prefix(array_dim); // Use descriptor-based lookup without searching for the `TypeId` in the dex file. return image_classes_.Contains(type_ref.dex_file, descriptor, array_dim);
}
} else {
DCHECK(!type_ref.dex_file->GetTypeDescriptorView(type_ref.TypeIndex()).starts_with('['));
} return image_classes_.Contains(type_ref, array_dim);
}
bool CompilerOptions::IsNoPreloadClass(Handle<mirror::Class> klass) const
REQUIRES_SHARED(Locks::mutator_lock_) { if (ignore_preloaded_classes_) { // Search for the class in the "classes-no-preload" profile section.
CHECK(profile_compilation_info_ != nullptr); const ArenaSet<dex::TypeIndex>* classes_no_preload =
profile_compilation_info_->GetClassesNoPreload(klass->GetDexFile()); return (classes_no_preload == nullptr)
? false
: classes_no_preload->find(klass->GetDexTypeIndex()) != classes_no_preload->end();
} else { // Search for the class in the preloaded-classes file. // TODO(b/383506474): deprecate this and rely only on the profile. return preloaded_classes_.find(klass->PrettyDescriptor()) == preloaded_classes_.end();
}
}
bool CompilerOptions::ShouldCompileWithClinitCheck(ArtMethod* method) const { if (method != nullptr &&
Runtime::Current()->IsAotCompiler() &&
method->IsStatic() &&
!method->IsConstructor() && // Compiled code for native methods never do a clinit check, so we may put the resolution // trampoline for native methods. This means that it's possible post zygote fork for the // entry to be dirtied. We could resolve this by either: // - Make these methods use the generic JNI entrypoint, but that's not // desirable for a method that is in the profile. // - Ensure the declaring class of such native methods are always in the // preloaded-classes list. // - Emit the clinit check in the compiled code of native methods.
!method->IsNative()) {
ScopedObjectAccess soa(Thread::Current());
ObjPtr<mirror::Class> cls = method->GetDeclaringClass<kWithoutReadBarrier>(); return cls->IsInBootImageAndNotInPreloadedClasses();
} returnfalse;
}
} // namespace art
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.12 Sekunden
(vorverarbeitet am 2026-06-29)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.