Lines Matching defs:oat_file

48 #include "oat_file.h"
660 const OatFile* ClassLinker::RegisterOatFile(const OatFile* oat_file) {
664 CHECK_NE(oat_file, oat_files_[i]) << oat_file->GetLocation();
667 VLOG(class_linker) << "Registering " << oat_file->GetLocation();
668 oat_files_.push_back(oat_file);
669 return oat_file;
674 OatFile* oat_file = space->ReleaseOatFile();
675 CHECK_EQ(RegisterOatFile(oat_file), oat_file);
677 return *oat_file;
690 for (const OatFile* oat_file : oat_files_) {
691 DCHECK(oat_file != nullptr);
694 if (oat_file->GetLocation() != oat_location) {
699 const OatFile::OatDexFile* oat_dex_file = oat_file->GetOatDexFile(dex_location,
713 // oat_file - the oat file to load from
716 // generated - whether or not the oat_file existed before or was just (re)generated
719 static bool LoadMultiDexFilesFromOatFile(const OatFile* oat_file,
725 if (oat_file == nullptr) {
752 const OatFile::OatDexFile* oat_dex_file = oat_file->GetOatDexFile(next_name, nullptr, false);
759 oat_file->GetLocation().c_str());
783 << "dex_location=" << next_name << " oat_location=" << oat_file->GetLocation().c_str()
893 const OatFile* oat_file = open_oat_file.release(); // Avoid deleting it.
896 RegisterOatFile(oat_file);
899 return oat_file->IsExecutable();
967 std::unique_ptr<OatFile> oat_file(OatFile::Open(oat_location, oat_location, nullptr,
970 if (oat_file.get() == nullptr) {
980 uint32_t actual_image_oat_checksum = oat_file->GetOatHeader().GetImageFileLocationOatChecksum();
989 uint32_t actual_image_oat_offset = oat_file->GetOatHeader().GetImageFileLocationOatDataBegin();
997 int32_t actual_patch_delta = oat_file->GetOatHeader().GetImagePatchDelta();
1005 const OatFile::OatDexFile* oat_dex_file = oat_file->GetOatDexFile(dex_location,
1022 return oat_file.release();
1039 std::unique_ptr<OatFile> oat_file(OatFile::Open(oat_location, oat_location, nullptr,
1042 if (oat_file.get() == nullptr) {
1049 return oat_file.release();
1052 bool ClassLinker::VerifyOatImageChecksum(const OatFile* oat_file,
1068 return oat_file->GetOatHeader().GetImageFileLocationOatChecksum() == image_oat_checksum;
1071 bool ClassLinker::VerifyOatChecksums(const OatFile* oat_file,
1099 const OatHeader& oat_header = oat_file->GetOatHeader();
1105 oat_file->GetLocation().c_str(),
1106 oat_file->GetOatHeader().GetImageFileLocationOatChecksum(),
1107 oat_file->GetOatHeader().GetImageFileLocationOatDataBegin(),
1108 oat_file->GetOatHeader().GetImagePatchDelta(),
1114 bool ClassLinker::VerifyOatAndDexFileChecksums(const OatFile* oat_file,
1119 if (!VerifyOatChecksums(oat_file, instruction_set, error_msg)) {
1123 const OatFile::OatDexFile* oat_dex_file = oat_file->GetOatDexFile(dex_location,
1127 oat_file->GetLocation().c_str(), dex_location, dex_location_checksum);
1128 for (const OatFile::OatDexFile* oat_dex_file : oat_file->GetOatDexFiles()) {
1130 oat_file->GetLocation().c_str(),
1139 oat_file->GetLocation().c_str(),
1147 bool ClassLinker::VerifyOatWithDexFile(const OatFile* oat_file,
1151 CHECK(oat_file != nullptr);
1158 const OatFile::OatDexFile* oat_dex_file = oat_file->GetOatDexFile(dex_location, nullptr);
1161 "dex file '%s': %s", oat_file->GetLocation().c_str(), dex_location,
1167 bool verified = VerifyOatAndDexFileChecksums(oat_file, dex_location, *dex_location_checksum,
1172 dex_file.reset(oat_file->GetOatDexFile(dex_location,
1187 std::unique_ptr<const OatFile> oat_file(OpenOatFileFromDexLocation(dex_location_str, isa,
1192 if (oat_file.get() == nullptr) {
1196 } else if (oat_file->IsExecutable() &&
1197 !VerifyOatWithDexFile(oat_file.get(), dex_location,
1200 "'%s': %s", oat_file->GetLocation().c_str(), dex_location,
1203 } else if (!oat_file->IsExecutable() &&
1205 !VerifyOatImageChecksum(oat_file.get(), isa)) {
1208 oat_file->GetLocation().c_str(), dex_location));
1211 return oat_file.release();
1218 const OatFile* oat_file = oat_files_[i];
1219 DCHECK(oat_file != nullptr);
1220 if (oat_file->GetLocation() == oat_location) {
1221 return oat_file;
1476 int32_t ClassLinker::GetRequiredDelta(const OatFile* oat_file, InstructionSet isa) {
1489 const OatHeader& oat_header = oat_file->GetOatHeader();
1493 bool ClassLinker::CheckOatFile(const OatFile* oat_file, InstructionSet isa,
1519 const OatHeader& oat_header = oat_file->GetOatHeader();
1552 const OatFile* oat_file = FindOpenedOatFileFromOatLocation(oat_location);
1553 if (oat_file != nullptr) {
1554 return oat_file;
1591 OatFile& oat_file = GetImageOatFile(space);
1592 CHECK_EQ(oat_file.GetOatHeader().GetImageFileLocationOatChecksum(), 0U);
1593 CHECK_EQ(oat_file.GetOatHeader().GetImageFileLocationOatDataBegin(), 0U);
1594 const char* image_file_location = oat_file.GetOatHeader().
1597 portable_resolution_trampoline_ = oat_file.GetOatHeader().GetPortableResolutionTrampoline();
1598 quick_resolution_trampoline_ = oat_file.GetOatHeader().GetQuickResolutionTrampoline();
1599 portable_imt_conflict_trampoline_ = oat_file.GetOatHeader().GetPortableImtConflictTrampoline();
1600 quick_imt_conflict_trampoline_ = oat_file.GetOatHeader().GetQuickImtConflictTrampoline();
1601 quick_generic_jni_trampoline_ = oat_file.GetOatHeader().GetQuickGenericJniTrampoline();
1602 quick_to_interpreter_bridge_trampoline_ = oat_file.GetOatHeader().GetQuickToInterpreterBridge();
1617 CHECK_EQ(oat_file.GetOatHeader().GetDexFileCount(),
1623 const OatFile::OatDexFile* oat_dex_file = oat_file.GetOatDexFile(dex_file_location.c_str(),
1625 CHECK(oat_dex_file != nullptr) << oat_file.GetLocation() << " " << dex_file_location;
1630 << " from within oat file " << oat_file.GetLocation()