mirror of
https://github.com/FEX-Emu/FEX.git
synced 2026-10-06 09:00:17 +02:00
Merge pull request #5501 from bylaws/finishloadwin
Windows/ImageTracker: Wire up LoadCache and EnableLoadedSection
This commit is contained in:
2 files changed
+13
-6
No files matched your search
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ private:
|
||||
};
|
||||
|
||||
struct AOTImageInfo {
|
||||
std::byte* Data;
|
||||
fextl::unique_ptr<FEXCore::MappedCodeCacheFile> CacheFile;
|
||||
};
|
||||
|
||||
void LoadAOTImages(MappedImageInfo& Info);
|
||||
|
||||
Reference in new issue
Block a user