JitBase: Remove use of the JIT global in Dispatch() and JitTrampoline()

Trims down a few more uses of the global variable by just passing the
JIT instance we're dispatching or trampolining with as a parameter.
This commit is contained in:
Lioncash
2018-03-20 00:28:55 -04:00
parent 5a4b59c4d1
commit e0165a62da
6 changed files with 31 additions and 12 deletions

View File

@ -12,9 +12,14 @@
JitBase* g_jit;
void JitTrampoline(u32 em_address)
const u8* JitBase::Dispatch(JitBase& jit)
{
g_jit->Jit(em_address);
return jit.GetBlockCache()->Dispatch();
}
void JitTrampoline(JitBase& jit, u32 em_address)
{
jit.Jit(em_address);
}
u32 Helper_Mask(u8 mb, u8 me)

View File

@ -116,7 +116,7 @@ public:
JitBase();
~JitBase() override;
static const u8* Dispatch() { return g_jit->GetBlockCache()->Dispatch(); }
static const u8* Dispatch(JitBase& jit);
virtual JitBaseBlockCache* GetBlockCache() = 0;
virtual void Jit(u32 em_address) = 0;
@ -127,7 +127,7 @@ public:
virtual bool HandleStackFault() { return false; }
};
void JitTrampoline(u32 em_address);
void JitTrampoline(JitBase& jit, u32 em_address);
// Merged routines that should be moved somewhere better
u32 Helper_Mask(u8 mb, u8 me);