OatFileAssistantContext::OatFileAssistantContext(Runtime* runtime)
: OatFileAssistantContext(std::make_unique<OatFileAssistantContext::RuntimeOptions>(
OatFileAssistantContext::RuntimeOptions{
.image_locations = runtime->GetImageLocations(),
.boot_class_path = runtime->GetBootClassPath(),
.boot_class_path_locations = runtime->GetBootClassPathLocations(),
.boot_class_path_files = !runtime->GetBootClassPathFiles().empty() ?
runtime->GetBootClassPathFiles() :
std::optional<ArrayRef<File>>(),
.deny_art_apex_data_files = runtime->DenyArtApexDataFiles(),
.sdk_version = runtime->GetSdkVersion(),
})) { // Fetch boot image info from the runtime.
std::vector<BootImageInfo>& boot_image_info_list =
boot_image_info_list_by_isa_[kRuntimeQuickCodeISA]; for (const ImageSpace* image_space : runtime->GetHeap()->GetBootImageSpaces()) { // We only need the checksum of the first component for each boot image. They are in image // spaces that have a non-zero component count. if (image_space->GetComponentCount() > 0) {
BootImageInfo& boot_image_info = boot_image_info_list.emplace_back();
boot_image_info.component_count = image_space->GetComponentCount();
ImageSpace::AppendImageChecksum(image_space->GetComponentCount(),
image_space->GetImageHeader().GetImageChecksum(),
&boot_image_info.checksum);
}
}
// Fetch BCP checksums from the runtime.
size_t bcp_index = 0;
std::vector<std::string>* current_bcp_checksums = nullptr; const std::vector<const DexFile*>& bcp_dex_files = runtime->GetClassLinker()->GetBootClassPath(); for (size_t i = 0; i < bcp_dex_files.size();) {
uint32_t checksum = DexFileLoader::GetMultiDexChecksum(bcp_dex_files, &i);
DCHECK_LT(bcp_index, runtime_options_->boot_class_path.size());
current_bcp_checksums = &bcp_checksums_by_index_[bcp_index++];
DCHECK_NE(current_bcp_checksums, nullptr);
current_bcp_checksums->push_back(StringPrintf("/%08x", checksum));
}
DCHECK_EQ(bcp_index, runtime_options_->boot_class_path.size());
// Fetch APEX versions from the runtime.
apex_versions_ = runtime->GetApexVersions();
}
std::string error_msg; if (!layout.LoadFromSystem(isa, /*allow_in_memory_compilation=*/false, &error_msg)) { // At this point, `layout` contains nothing.
VLOG(oat) << "Some error occurred when loading boot images for oat file validation: "
<< error_msg; // Create an empty entry so that we don't have to retry when the function is called again. return boot_image_info_list_by_isa_[isa];
}
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.