Skip to content

Commit

Permalink
Jit64/JitArm64: Remove unnecessary code buffer parameter for DoJit()
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
lioncash committed May 18, 2018
1 parent 3a8a670 commit 9ad7d9f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions Source/Core/Core/PowerPC/Jit64/Jit.cpp
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/Core/PowerPC/Jit64/Jit.h
Expand Up @@ -46,7 +46,7 @@ class Jit64 : public Jitx86Base
// 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;
Expand Down
6 changes: 3 additions & 3 deletions Source/Core/Core/PowerPC/JitArm64/Jit.cpp
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/Core/PowerPC/JitArm64/Jit.h
Expand Up @@ -200,7 +200,7 @@ class JitArm64 : public JitBase, public Arm64Gen::ARM64CodeBlock, public CommonA
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();
Expand Down

0 comments on commit 9ad7d9f

Please sign in to comment.