From 9ad7d9ff87fc75416dc77abb0abb465faad9f9cb Mon Sep 17 00:00:00 2001 From: Lioncash Date: Fri, 18 May 2018 16:50:20 -0400 Subject: [PATCH] Jit64/JitArm64: Remove unnecessary code buffer parameter for DoJit() This function in both JITs is only ever called by passing the JIT's code buffer into it. Given this is already accessible, since the functions are part of the respective JIT class, we can just remove this parameter. This also cleans up accesses with the new code buffer, as we don't need to do janky looking dereference-then-index expressions. --- Source/Core/Core/PowerPC/Jit64/Jit.cpp | 6 +++--- Source/Core/Core/PowerPC/Jit64/Jit.h | 2 +- Source/Core/Core/PowerPC/JitArm64/Jit.cpp | 6 +++--- Source/Core/Core/PowerPC/JitArm64/Jit.h | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Source/Core/Core/PowerPC/Jit64/Jit.cpp b/Source/Core/Core/PowerPC/Jit64/Jit.cpp index 52d0adc361..e6c3baf9cf 100644 --- a/Source/Core/Core/PowerPC/Jit64/Jit.cpp +++ b/Source/Core/Core/PowerPC/Jit64/Jit.cpp @@ -637,11 +637,11 @@ void Jit64::Jit(u32 em_address) } JitBlock* b = blocks.AllocateBlock(em_address); - DoJit(em_address, &code_buffer, b, nextPC); + DoJit(em_address, b, nextPC); blocks.FinalizeBlock(*b, jo.enableBlocklink, code_block.m_physical_addresses); } -const u8* Jit64::DoJit(u32 em_address, PPCAnalyst::CodeBuffer* code_buf, JitBlock* b, u32 nextPC) +const u8* Jit64::DoJit(u32 em_address, JitBlock* b, u32 nextPC) { js.firstFPInstructionFound = false; js.isLastInstruction = false; @@ -741,7 +741,7 @@ const u8* Jit64::DoJit(u32 em_address, PPCAnalyst::CodeBuffer* code_buf, JitBloc // Translate instructions for (u32 i = 0; i < code_block.m_num_instructions; i++) { - PPCAnalyst::CodeOp& op = (*code_buf)[i]; + PPCAnalyst::CodeOp& op = code_buffer[i]; js.compilerPC = op.address; js.op = &op; diff --git a/Source/Core/Core/PowerPC/Jit64/Jit.h b/Source/Core/Core/PowerPC/Jit64/Jit.h index ce8de7509b..1cf1726185 100644 --- a/Source/Core/Core/PowerPC/Jit64/Jit.h +++ b/Source/Core/Core/PowerPC/Jit64/Jit.h @@ -46,7 +46,7 @@ public: // Jit! void Jit(u32 em_address) override; - const u8* DoJit(u32 em_address, PPCAnalyst::CodeBuffer* code_buf, JitBlock* b, u32 nextPC); + const u8* DoJit(u32 em_address, JitBlock* b, u32 nextPC); BitSet32 CallerSavedRegistersInUse() const; BitSet8 ComputeStaticGQRs(const PPCAnalyst::CodeBlock&) const; diff --git a/Source/Core/Core/PowerPC/JitArm64/Jit.cpp b/Source/Core/Core/PowerPC/JitArm64/Jit.cpp index 93a027c515..ab690b3cb3 100644 --- a/Source/Core/Core/PowerPC/JitArm64/Jit.cpp +++ b/Source/Core/Core/PowerPC/JitArm64/Jit.cpp @@ -578,11 +578,11 @@ void JitArm64::Jit(u32) } JitBlock* b = blocks.AllocateBlock(em_address); - DoJit(em_address, &code_buffer, b, nextPC); + DoJit(em_address, b, nextPC); blocks.FinalizeBlock(*b, jo.enableBlocklink, code_block.m_physical_addresses); } -void JitArm64::DoJit(u32 em_address, PPCAnalyst::CodeBuffer* code_buf, JitBlock* b, u32 nextPC) +void JitArm64::DoJit(u32 em_address, JitBlock* b, u32 nextPC) { if (em_address == 0) { @@ -651,7 +651,7 @@ void JitArm64::DoJit(u32 em_address, PPCAnalyst::CodeBuffer* code_buf, JitBlock* // Translate instructions for (u32 i = 0; i < code_block.m_num_instructions; i++) { - PPCAnalyst::CodeOp& op = (*code_buf)[i]; + PPCAnalyst::CodeOp& op = code_buffer[i]; js.compilerPC = op.address; js.op = &op; diff --git a/Source/Core/Core/PowerPC/JitArm64/Jit.h b/Source/Core/Core/PowerPC/JitArm64/Jit.h index b2fbf4d6fb..eaceffb0e1 100644 --- a/Source/Core/Core/PowerPC/JitArm64/Jit.h +++ b/Source/Core/Core/PowerPC/JitArm64/Jit.h @@ -200,7 +200,7 @@ private: void SafeLoadToReg(u32 dest, s32 addr, s32 offsetReg, u32 flags, s32 offset, bool update); void SafeStoreFromReg(s32 dest, u32 value, s32 regOffset, u32 flags, s32 offset); - void DoJit(u32 em_address, PPCAnalyst::CodeBuffer* code_buf, JitBlock* b, u32 nextPC); + void DoJit(u32 em_address, JitBlock* b, u32 nextPC); void DoDownCount(); void Cleanup();