Jit64: Check for breakpoint without disabling block link

Small optimization. By not calling WriteExit, the block linking system
never finds out about the exit we're doing, saving us from having to
disable block linking.
This commit is contained in:
JosJuice 2022-12-24 12:59:02 +01:00
parent 54a6c4a90d
commit 0659827485
3 changed files with 9 additions and 7 deletions

View File

@ -799,11 +799,10 @@ void Jit64::Jit(u32 em_address, bool clear_cache_and_retry_on_failure)
if (m_enable_debugging)
{
// We can link blocks as long as we are not single stepping and there are no breakpoints here
// We can link blocks as long as we are not single stepping
EnableBlockLink();
EnableOptimization();
// Comment out the following to disable breakpoints (speed-up)
if (!jo.profile_blocks)
{
if (CPU::IsStepping())
@ -1099,10 +1098,6 @@ bool Jit64::DoJit(u32 em_address, JitBlock* b, u32 nextPC)
if (m_enable_debugging && breakpoints.IsAddressBreakPoint(op.address) && !CPU::IsStepping())
{
// Turn off block linking if there are breakpoints so that the Step Over command does not
// link this block.
jo.enableBlocklink = false;
gpr.Flush();
fpr.Flush();
@ -1114,7 +1109,11 @@ bool Jit64::DoJit(u32 em_address, JitBlock* b, u32 nextPC)
TEST(32, MatR(RSCRATCH), Imm32(0xFFFFFFFF));
FixupBranch noBreakpoint = J_CC(CC_Z);
WriteExit(op.address);
Cleanup();
MOV(32, PPCSTATE(npc), Imm32(op.address));
SUB(32, PPCSTATE(downcount), Imm32(js.downcountAmount));
JMP(asm_routines.dispatcher_exit, true);
SetJumpTarget(noBreakpoint);
}

View File

@ -205,8 +205,10 @@ void Jit64AsmRoutineManager::Generate()
J_CC(CC_Z, outerLoop);
// Landing pad for drec space
dispatcher_exit = GetCodePtr();
if (enable_debugging)
SetJumpTarget(dbg_exit);
ResetStack(*this);
if (m_stack_top)
{

View File

@ -19,6 +19,7 @@ struct CommonAsmRoutinesBase
const u8* dispatcher;
const u8* dispatcher_no_timing_check;
const u8* dispatcher_no_check;
const u8* dispatcher_exit;
const u8* do_timing;