mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
Reorganize backpatching a bit. Untested on ARM.
Rather than *MemTools.cpp checking whether the address is in the emulated range itself (which, as of the next commit, doesn't cover every kind of access the JIT might want to intercept) and doing PC replacement, they just pass the access address and context to jit->HandleFault, which does the rest itself. Because SContext is now in JitInterface, I wanted JitBackpatch.h (which defines it) to be lightweight, so I moved TrampolineCache and associated x64{Analyzer,Emitter} dependencies into its own file. I hate adding new files in three places, two of which are MSVC... While I'm at it, edit a misleading comment.
This commit is contained in:
@ -7,6 +7,7 @@
|
||||
#include <string>
|
||||
#include "Common/ChunkFile.h"
|
||||
#include "Core/PowerPC/CPUCoreBase.h"
|
||||
#include "Core/PowerPC/JitCommon/JitBackpatch.h"
|
||||
|
||||
namespace JitInterface
|
||||
{
|
||||
@ -20,8 +21,7 @@ namespace JitInterface
|
||||
void WriteProfileResults(const std::string& filename);
|
||||
|
||||
// Memory Utilities
|
||||
bool IsInCodeSpace(u8 *ptr);
|
||||
const u8 *BackPatch(u8 *codePtr, u32 em_address, void *ctx);
|
||||
bool HandleFault(uintptr_t access_address, SContext* ctx);
|
||||
|
||||
// used by JIT to read instructions
|
||||
u32 Read_Opcode_JIT(const u32 _Address);
|
||||
|
Reference in New Issue
Block a user