SaveState: Only rehash functions in code a load changed

Every load hashed all known functions again, for the replacement hooks:
2.4-6 ms, about half the load. Functions in module code the load left as
it was keep their hash, so only the rest is hashed now (0.5-1 ms). The
code is compared on every load for this, not only with a JIT.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Henrik RydgårdandClaude Opus 5.5 committed 2026-10-19 20:18:46 +02:00
1 parent a62aa69986
commit f45f4d5c85
5 files changed
+43 -8

No files matched your search

+2 -3
View File
@@ -235,13 +235,12 @@ int g_screenshotFailures;
if (p.mode == p.MODE_READ) {
hookedOps = Replacement_GetHookedOps();
RestoreReplacedInstructions(0, 0xFFFFFFFF);
if (MIPSComp::jit) {
codeCompare.ranges = __KernelModuleCodeRanges();
}
codeCompare.ranges = __KernelModuleCodeRanges();
}
Memory::DoState(p, &codeCompare);
if (p.mode == p.MODE_READ) {
Replacement_RepairStaleHookOps(hookedOps);
__KernelModuleSetUnchangedCodeOnLoad(codeCompare.unchanged);
currentMIPS->KeepJitBlocksOnNextLoad(std::move(codeCompare.unchanged));
}