From 3ee31890d35bf4741f283dc76ac004a93acc9897 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sun, 22 Jan 2017 05:14:19 -0500 Subject: [PATCH] Jit64_Tables: Eliminate usages of the JIT global --- Source/Core/Core/PowerPC/Jit64/Jit.cpp | 2 +- Source/Core/Core/PowerPC/Jit64/Jit64_Tables.cpp | 9 ++++----- Source/Core/Core/PowerPC/Jit64/Jit64_Tables.h | 4 +++- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Source/Core/Core/PowerPC/Jit64/Jit.cpp b/Source/Core/Core/PowerPC/Jit64/Jit.cpp index 580bab2577..fb54ebd006 100644 --- a/Source/Core/Core/PowerPC/Jit64/Jit.cpp +++ b/Source/Core/Core/PowerPC/Jit64/Jit.cpp @@ -857,7 +857,7 @@ const u8* Jit64::DoJit(u32 em_address, PPCAnalyst::CodeBuffer* code_buf, JitBloc fpr.BindToRegister(reg, true, false); } - Jit64Tables::CompileInstruction(ops[i]); + Jit64Tables::CompileInstruction(*this, ops[i]); if (jo.memcheck && (opinfo->flags & FL_LOADSTORE)) { diff --git a/Source/Core/Core/PowerPC/Jit64/Jit64_Tables.cpp b/Source/Core/Core/PowerPC/Jit64/Jit64_Tables.cpp index fec19e92ab..7981d7e333 100644 --- a/Source/Core/Core/PowerPC/Jit64/Jit64_Tables.cpp +++ b/Source/Core/Core/PowerPC/Jit64/Jit64_Tables.cpp @@ -360,21 +360,20 @@ static GekkoOPTemplate table63_2[] = { namespace Jit64Tables { -void CompileInstruction(PPCAnalyst::CodeOp& op) +void CompileInstruction(Jit64& jit, PPCAnalyst::CodeOp& op) { - Jit64* jit64 = (Jit64*)g_jit; - (jit64->*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; } } diff --git a/Source/Core/Core/PowerPC/Jit64/Jit64_Tables.h b/Source/Core/Core/PowerPC/Jit64/Jit64_Tables.h index a36d0c5156..8daa24f360 100644 --- a/Source/Core/Core/PowerPC/Jit64/Jit64_Tables.h +++ b/Source/Core/Core/PowerPC/Jit64/Jit64_Tables.h @@ -4,6 +4,8 @@ #pragma once +class Jit64; + namespace PPCAnalyst { struct CodeOp; @@ -11,6 +13,6 @@ struct CodeOp; namespace Jit64Tables { -void CompileInstruction(PPCAnalyst::CodeOp& op); +void CompileInstruction(Jit64& jit, PPCAnalyst::CodeOp& op); void InitTables(); }