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:
1 parent
7b0fdb52cd
commit
755bd2c445
15 files changed
+258
-261
No files matched your search
@@ -190,13 +190,9 @@ namespace JitInterface
|
||||
}
|
||||
#endif
|
||||
}
|
||||
bool IsInCodeSpace(u8 *ptr)
|
||||
bool HandleFault(uintptr_t access_address, SContext* ctx)
|
||||
{
|
||||
return jit->IsInCodeSpace(ptr);
|
||||
}
|
||||
const u8 *BackPatch(u8 *codePtr, u32 em_address, void *ctx)
|
||||
{
|
||||
return jit->BackPatch(codePtr, em_address, ctx);
|
||||
return jit->HandleFault(access_address, ctx);
|
||||
}
|
||||
|
||||
void ClearCache()
|
||||
|
||||
Reference in new issue
Block a user