diff --git a/Source/Core/Core/PowerPC/Jit64IL/JitIL.cpp b/Source/Core/Core/PowerPC/Jit64IL/JitIL.cpp index 85c8b12cc0..a5fe9ee470 100644 --- a/Source/Core/Core/PowerPC/Jit64IL/JitIL.cpp +++ b/Source/Core/Core/PowerPC/Jit64IL/JitIL.cpp @@ -639,7 +639,7 @@ const u8* JitIL::DoJit(u32 em_address, PPCAnalyst::CodeBuffer* code_buf, JitBloc ibuild.EmitBreakPointCheck(ibuild.EmitIntConst(ops[i].address)); } - JitILTables::CompileInstruction(ops[i]); + JitILTables::CompileInstruction(*this, ops[i]); if (jo.memcheck && (opinfo->flags & FL_LOADSTORE)) { diff --git a/Source/Core/Core/PowerPC/Jit64IL/JitIL_Tables.cpp b/Source/Core/Core/PowerPC/Jit64IL/JitIL_Tables.cpp index b496148a6b..ab69cc5283 100644 --- a/Source/Core/Core/PowerPC/Jit64IL/JitIL_Tables.cpp +++ b/Source/Core/Core/PowerPC/Jit64IL/JitIL_Tables.cpp @@ -378,26 +378,25 @@ static GekkoOPTemplate table63_2[] = { namespace JitILTables { -void CompileInstruction(PPCAnalyst::CodeOp& op) +void CompileInstruction(JitIL& jit, PPCAnalyst::CodeOp& op) { - JitIL* jitil = (JitIL*)g_jit; - (jitil->*dynaOpTable[op.inst.OPCD])(op.inst); + (jit.*dynaOpTable[op.inst.OPCD])(op.inst); GekkoOPInfo* info = op.opinfo; if (info) { #ifdef OPLOG if (!strcmp(info->opname, OP_TO_LOG)) // "mcrfs" { - rsplocations.push_back(g_jit.js.compilerPC); + rsplocations.push_back(jit.js.compilerPC); } #endif info->compileCount++; - info->lastUse = g_jit->js.compilerPC; + info->lastUse = jit.js.compilerPC; } else { PanicAlert("Tried to compile illegal (or unknown) instruction %08x, at %08x", op.inst.hex, - g_jit->js.compilerPC); + jit.js.compilerPC); } } diff --git a/Source/Core/Core/PowerPC/Jit64IL/JitIL_Tables.h b/Source/Core/Core/PowerPC/Jit64IL/JitIL_Tables.h index f207cd0680..89c0b766e4 100644 --- a/Source/Core/Core/PowerPC/Jit64IL/JitIL_Tables.h +++ b/Source/Core/Core/PowerPC/Jit64IL/JitIL_Tables.h @@ -4,6 +4,8 @@ #pragma once +class JitIL; + namespace PPCAnalyst { struct CodeOp; @@ -11,6 +13,6 @@ struct CodeOp; namespace JitILTables { -void CompileInstruction(PPCAnalyst::CodeOp& op); +void CompileInstruction(JitIL& jit, PPCAnalyst::CodeOp& op); void InitTables(); }