From bbd2fd080e3039e8e7432f735545e5250907ccae Mon Sep 17 00:00:00 2001 From: Lioncash Date: Mon, 4 Jun 2018 15:35:06 -0400 Subject: [PATCH] DSPEmitter: Make m_unresolved_jumps private By making the jitted function a private static function of DSPEmitter, we can allow access to data members within the context of the function without making them public overall. This finally makes all data members for the x64 DSP emitter private. --- Source/Core/Core/DSP/Jit/x64/DSPEmitter.cpp | 2 +- Source/Core/Core/DSP/Jit/x64/DSPEmitter.h | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Source/Core/Core/DSP/Jit/x64/DSPEmitter.cpp b/Source/Core/Core/DSP/Jit/x64/DSPEmitter.cpp index afc29800b8..a3649f2754 100644 --- a/Source/Core/Core/DSP/Jit/x64/DSPEmitter.cpp +++ b/Source/Core/Core/DSP/Jit/x64/DSPEmitter.cpp @@ -365,7 +365,7 @@ void DSPEmitter::Compile(u16 start_addr) JMP(m_return_dispatcher, true); } -static void CompileCurrent(DSPEmitter& emitter) +void DSPEmitter::CompileCurrent(DSPEmitter& emitter) { emitter.Compile(g_dsp.pc); diff --git a/Source/Core/Core/DSP/Jit/x64/DSPEmitter.h b/Source/Core/Core/DSP/Jit/x64/DSPEmitter.h index 369da3ae37..4c4efdd4e6 100644 --- a/Source/Core/Core/DSP/Jit/x64/DSPEmitter.h +++ b/Source/Core/Core/DSP/Jit/x64/DSPEmitter.h @@ -205,9 +205,11 @@ public: void madd(UDSPInstruction opc); void msub(UDSPInstruction opc); - std::array, MAX_BLOCKS> m_unresolved_jumps; - private: + // The emitter emits calls to this function. It's present here + // within the class itself to allow access to member variables. + static void CompileCurrent(DSPEmitter& emitter); + void WriteBranchExit(); void WriteBlockLink(u16 dest); @@ -307,6 +309,8 @@ private: std::vector m_block_links; Block m_block_link_entry; + std::array, MAX_BLOCKS> m_unresolved_jumps; + u16 m_cycles_left = 0; // The index of the last stored ext value (compile time).