From 70a1d92d9fbd75da7f1108fccdda1c0997d594ff Mon Sep 17 00:00:00 2001 From: Tony Wasserka Date: Mon, 8 Sep 2025 16:27:59 +0200 Subject: [PATCH] CodeCache: Drop ComputeCodeMapId member function --- FEXCore/Source/Interface/Context/Context.h | 2 -- FEXCore/Source/Interface/Core/CodeCache.cpp | 16 ---------------- FEXCore/include/FEXCore/Core/CodeCache.h | 8 -------- .../LinuxSyscalls/SyscallsSMCTracking.cpp | 1 - 4 files changed, 27 deletions(-) diff --git a/FEXCore/Source/Interface/Context/Context.h b/FEXCore/Source/Interface/Context/Context.h index c9e9a1625..9592d77a0 100644 --- a/FEXCore/Source/Interface/Context/Context.h +++ b/FEXCore/Source/Interface/Context/Context.h @@ -79,8 +79,6 @@ public: ContextImpl& CTX; bool IsGeneratingCache = false; - fextl::string ComputeCodeMapId(std::string_view Filename) override; - void LoadData(Core::InternalThreadState&, std::byte* MappedCacheFile, const ExecutableFileSectionInfo&) override; bool SaveData(Core::InternalThreadState&, int TargetFD, const ExecutableFileSectionInfo&, uint64_t SerializedBaseAddress) override; diff --git a/FEXCore/Source/Interface/Core/CodeCache.cpp b/FEXCore/Source/Interface/Core/CodeCache.cpp index 98441d2b3..c6d86d5e0 100644 --- a/FEXCore/Source/Interface/Core/CodeCache.cpp +++ b/FEXCore/Source/Interface/Core/CodeCache.cpp @@ -1,5 +1,4 @@ // SPDX-License-Identifier: MIT -#include #include #include @@ -7,8 +6,6 @@ #include -#include - namespace FEXCore { ExecutableFileInfo::~ExecutableFileInfo() = default; @@ -45,17 +42,4 @@ void CodeCache::PostCompileCode(FEXCore::Core::InternalThreadState& Thread, void } } -fextl::string CodeCache::ComputeCodeMapId(std::string_view Filename) { - auto base_filename = FHU::Filesystem::GetFilename(Filename); - if (!base_filename.empty()) { - auto filename_hash = XXH3_64bits(Filename.data(), Filename.size()); - - return fextl::fmt::format("{}-{:016x}-{}{}{}", base_filename, filename_hash, - (CTX.Config.SMCChecks == FEXCore::Config::CONFIG_SMC_FULL) ? 'S' : 's', CTX.Config.TSOEnabled ? 'T' : 't', - CTX.Config.ABILocalFlags ? 'L' : 'l'); - } - - return nullptr; -} - } // namespace FEXCore::Context diff --git a/FEXCore/include/FEXCore/Core/CodeCache.h b/FEXCore/include/FEXCore/Core/CodeCache.h index 2f2ca50ea..3a16fbeaa 100644 --- a/FEXCore/include/FEXCore/Core/CodeCache.h +++ b/FEXCore/include/FEXCore/Core/CodeCache.h @@ -37,14 +37,6 @@ class AbstractCodeCache { public: virtual ~AbstractCodeCache() = default; - /** - * Computes a unique identifier for the referenced binary file to be used for - * generating the code map. - * This identifier is independent of FEX build/runtime configuration and - * stable across FEX updates. - */ - virtual fextl::string ComputeCodeMapId(std::string_view Filename) = 0; - /** * Loads a code cache from mapped memory and appends it to the current Core state. * TODO: Optionally recompiles all contained code blocks at runtime for validation. diff --git a/Source/Tools/LinuxEmulation/LinuxSyscalls/SyscallsSMCTracking.cpp b/Source/Tools/LinuxEmulation/LinuxSyscalls/SyscallsSMCTracking.cpp index 6d4a09b4f..1bebc4df8 100644 --- a/Source/Tools/LinuxEmulation/LinuxSyscalls/SyscallsSMCTracking.cpp +++ b/Source/Tools/LinuxEmulation/LinuxSyscalls/SyscallsSMCTracking.cpp @@ -380,7 +380,6 @@ void SyscallHandler::TrackMmap(FEXCore::Core::InternalThreadState* Thread, uint6 if (Inserted) { Resource->MappedFile = fextl::make_unique(); Resource->MappedFile->Filename = fextl::string(Tmp, PathLength); - Resource->MappedFile->FileId = CTX->GetCodeCache().ComputeCodeMapId(Resource->MappedFile->Filename); Resource->Iterator = Iter; } }