Merge pull request #5501 from bylaws/finishloadwin

Windows/ImageTracker: Wire up LoadCache and EnableLoadedSection
This commit is contained in:
Tony Wasserka authored and GitHub committed 2026-07-06 14:58:01 +02:00
commit 57ca49dc5c
2 files changed
+13 -6

No files matched your search

+12 -5
View File
@@ -171,8 +171,8 @@ FEXCore::ExecutableFileSectionInfo ImageTracker::HandleImageMap(std::string_view
}
auto AOTImage = AOTImages.find(ID);
if (AOTImage != AOTImages.end()) {
// TODO: CodeCache::EnableLoadedSection
if (AOTImage != AOTImages.end() && AOTImage->second.CacheFile) {
CTX.GetCodeCache().EnableLoadedSection(nullptr, *AOTImage->second.CacheFile, ImageInfo->SectionInfo);
}
}
@@ -279,9 +279,16 @@ void ImageTracker::LoadAOTImages(MappedImageInfo& ImageInfo) {
UniqueId.resize(AnsiLength);
RtlUnicodeToMultiByteN(UniqueId.data(), AnsiLength, NULL, Info->FileName, Info->FileNameLength);
AOTImages[UniqueId] = {.Data = static_cast<std::byte*>(LoadAddress)};
// TODO: CodeCache::LoadCache, CodeCache::RegisterMappedCodeBuffer
LogMan::Msg::IFmt("Loaded cache: {}", UniqueId);
auto CacheSpan = std::span {static_cast<std::byte*>(LoadAddress), MappedSize};
auto MappedCache = CTX.GetCodeCache().LoadCache(CacheSpan, ImageInfo.Info, ImageInfo.SectionInfo.FileStartVA);
if (MappedCache) {
CTX.GetCodeCache().RegisterMappedCodeBuffer(*MappedCache);
AOTImages[UniqueId] = {.CacheFile = std::move(MappedCache)};
LogMan::Msg::IFmt("Loaded cache: {}", UniqueId);
} else {
NtUnmapViewOfSection(NtCurrentProcess(), LoadAddress);
LogMan::Msg::EFmt("Failed to load cache: {}", UniqueId);
}
}
}
}
+1 -1
View File
@@ -56,7 +56,7 @@ private:
};
struct AOTImageInfo {
std::byte* Data;
fextl::unique_ptr<FEXCore::MappedCodeCacheFile> CacheFile;
};
void LoadAOTImages(MappedImageInfo& Info);