Disable block linking while debugger stepping or if there are breakpoints
This commit is contained in:
parent
d0a3bb7650
commit
290e1bed37
|
@ -174,13 +174,8 @@ bool Jit64::HandleFault(uintptr_t access_address, SContext* ctx)
|
||||||
void Jit64::Init()
|
void Jit64::Init()
|
||||||
{
|
{
|
||||||
jo.optimizeStack = true;
|
jo.optimizeStack = true;
|
||||||
jo.enableBlocklink = true;
|
EnableBlockLink();
|
||||||
if (SConfig::GetInstance().m_LocalCoreStartupParameter.bJITNoBlockLinking ||
|
|
||||||
SConfig::GetInstance().m_LocalCoreStartupParameter.bMMU)
|
|
||||||
{
|
|
||||||
// TODO: support block linking with MMU
|
|
||||||
jo.enableBlocklink = false;
|
|
||||||
}
|
|
||||||
jo.fpAccurateFcmp = SConfig::GetInstance().m_LocalCoreStartupParameter.bFPRF;
|
jo.fpAccurateFcmp = SConfig::GetInstance().m_LocalCoreStartupParameter.bFPRF;
|
||||||
jo.optimizeGatherPipe = true;
|
jo.optimizeGatherPipe = true;
|
||||||
jo.fastInterrupts = false;
|
jo.fastInterrupts = false;
|
||||||
|
@ -521,11 +516,19 @@ const u8* Jit64::DoJit(u32 em_address, PPCAnalyst::CodeBuffer *code_buf, JitBloc
|
||||||
|
|
||||||
if (SConfig::GetInstance().m_LocalCoreStartupParameter.bEnableDebugging)
|
if (SConfig::GetInstance().m_LocalCoreStartupParameter.bEnableDebugging)
|
||||||
{
|
{
|
||||||
|
// We can link blocks as long as we are not single stepping and there are no breakpoints here
|
||||||
|
EnableBlockLink();
|
||||||
|
|
||||||
// Comment out the following to disable breakpoints (speed-up)
|
// Comment out the following to disable breakpoints (speed-up)
|
||||||
if (!Profiler::g_ProfileBlocks)
|
if (!Profiler::g_ProfileBlocks)
|
||||||
{
|
{
|
||||||
if (GetState() == CPU_STEPPING)
|
if (GetState() == CPU_STEPPING)
|
||||||
|
{
|
||||||
blockSize = 1;
|
blockSize = 1;
|
||||||
|
|
||||||
|
// Do not link this block to other blocks While single stepping
|
||||||
|
jo.enableBlocklink = false;
|
||||||
|
}
|
||||||
Trace();
|
Trace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -715,6 +718,9 @@ const u8* Jit64::DoJit(u32 em_address, PPCAnalyst::CodeBuffer *code_buf, JitBloc
|
||||||
|
|
||||||
if (SConfig::GetInstance().m_LocalCoreStartupParameter.bEnableDebugging && breakpoints.IsAddressBreakPoint(ops[i].address) && GetState() != CPU_STEPPING)
|
if (SConfig::GetInstance().m_LocalCoreStartupParameter.bEnableDebugging && breakpoints.IsAddressBreakPoint(ops[i].address) && GetState() != CPU_STEPPING)
|
||||||
{
|
{
|
||||||
|
// Turn off block linking if there are breakpoints so that the Step Over command does not link this block.
|
||||||
|
jo.enableBlocklink = false;
|
||||||
|
|
||||||
gpr.Flush();
|
gpr.Flush();
|
||||||
fpr.Flush();
|
fpr.Flush();
|
||||||
|
|
||||||
|
@ -856,3 +862,14 @@ u32 Jit64::CallerSavedRegistersInUse()
|
||||||
}
|
}
|
||||||
return result & ABI_ALL_CALLER_SAVED;
|
return result & ABI_ALL_CALLER_SAVED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Jit64::EnableBlockLink()
|
||||||
|
{
|
||||||
|
jo.enableBlocklink = true;
|
||||||
|
if (SConfig::GetInstance().m_LocalCoreStartupParameter.bJITNoBlockLinking ||
|
||||||
|
SConfig::GetInstance().m_LocalCoreStartupParameter.bMMU)
|
||||||
|
{
|
||||||
|
// TODO: support block linking with MMU
|
||||||
|
jo.enableBlocklink = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -64,6 +64,9 @@ public:
|
||||||
~Jit64() {}
|
~Jit64() {}
|
||||||
|
|
||||||
void Init() override;
|
void Init() override;
|
||||||
|
|
||||||
|
void EnableBlockLink();
|
||||||
|
|
||||||
void Shutdown() override;
|
void Shutdown() override;
|
||||||
|
|
||||||
bool HandleFault(uintptr_t access_address, SContext* ctx) override;
|
bool HandleFault(uintptr_t access_address, SContext* ctx) override;
|
||||||
|
|
|
@ -244,13 +244,7 @@ namespace JitILProfiler
|
||||||
void JitIL::Init()
|
void JitIL::Init()
|
||||||
{
|
{
|
||||||
jo.optimizeStack = true;
|
jo.optimizeStack = true;
|
||||||
jo.enableBlocklink = true;
|
EnableBlockLink();
|
||||||
if (SConfig::GetInstance().m_LocalCoreStartupParameter.bJITNoBlockLinking ||
|
|
||||||
SConfig::GetInstance().m_LocalCoreStartupParameter.bMMU)
|
|
||||||
{
|
|
||||||
// TODO: support block linking with MMU
|
|
||||||
jo.enableBlocklink = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
jo.fpAccurateFcmp = false;
|
jo.fpAccurateFcmp = false;
|
||||||
jo.optimizeGatherPipe = true;
|
jo.optimizeGatherPipe = true;
|
||||||
|
@ -509,11 +503,19 @@ const u8* JitIL::DoJit(u32 em_address, PPCAnalyst::CodeBuffer *code_buf, JitBloc
|
||||||
|
|
||||||
if (SConfig::GetInstance().m_LocalCoreStartupParameter.bEnableDebugging)
|
if (SConfig::GetInstance().m_LocalCoreStartupParameter.bEnableDebugging)
|
||||||
{
|
{
|
||||||
|
// We can link blocks as long as we are not single stepping and there are no breakpoints here
|
||||||
|
EnableBlockLink();
|
||||||
|
|
||||||
// Comment out the following to disable breakpoints (speed-up)
|
// Comment out the following to disable breakpoints (speed-up)
|
||||||
if (!Profiler::g_ProfileBlocks)
|
if (!Profiler::g_ProfileBlocks)
|
||||||
{
|
{
|
||||||
if (GetState() == CPU_STEPPING)
|
if (GetState() == CPU_STEPPING)
|
||||||
|
{
|
||||||
blockSize = 1;
|
blockSize = 1;
|
||||||
|
|
||||||
|
// Do not link this block to other blocks While single stepping
|
||||||
|
jo.enableBlocklink = false;
|
||||||
|
}
|
||||||
Trace();
|
Trace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -648,6 +650,9 @@ const u8* JitIL::DoJit(u32 em_address, PPCAnalyst::CodeBuffer *code_buf, JitBloc
|
||||||
|
|
||||||
if (SConfig::GetInstance().m_LocalCoreStartupParameter.bEnableDebugging && breakpoints.IsAddressBreakPoint(ops[i].address) && GetState() != CPU_STEPPING)
|
if (SConfig::GetInstance().m_LocalCoreStartupParameter.bEnableDebugging && breakpoints.IsAddressBreakPoint(ops[i].address) && GetState() != CPU_STEPPING)
|
||||||
{
|
{
|
||||||
|
// Turn off block linking if there are breakpoints so that the Step Over command does not link this block.
|
||||||
|
jo.enableBlocklink = false;
|
||||||
|
|
||||||
ibuild.EmitBreakPointCheck(ibuild.EmitIntConst(ops[i].address));
|
ibuild.EmitBreakPointCheck(ibuild.EmitIntConst(ops[i].address));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -702,3 +707,14 @@ const u8* JitIL::DoJit(u32 em_address, PPCAnalyst::CodeBuffer *code_buf, JitBloc
|
||||||
|
|
||||||
return normalEntry;
|
return normalEntry;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void JitIL::EnableBlockLink()
|
||||||
|
{
|
||||||
|
jo.enableBlocklink = true;
|
||||||
|
if (SConfig::GetInstance().m_LocalCoreStartupParameter.bJITNoBlockLinking ||
|
||||||
|
SConfig::GetInstance().m_LocalCoreStartupParameter.bMMU)
|
||||||
|
{
|
||||||
|
// TODO: support block linking with MMU
|
||||||
|
jo.enableBlocklink = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -47,6 +47,9 @@ public:
|
||||||
// Initialization, etc
|
// Initialization, etc
|
||||||
|
|
||||||
void Init() override;
|
void Init() override;
|
||||||
|
|
||||||
|
void EnableBlockLink();
|
||||||
|
|
||||||
void Shutdown() override;
|
void Shutdown() override;
|
||||||
|
|
||||||
// Jit!
|
// Jit!
|
||||||
|
|
|
@ -310,10 +310,10 @@ void CCodeWindow::StepOver()
|
||||||
{
|
{
|
||||||
if (CCPU::IsStepping())
|
if (CCPU::IsStepping())
|
||||||
{
|
{
|
||||||
PowerPC::breakpoints.ClearAllTemporary();
|
|
||||||
UGeckoInstruction inst = Memory::Read_Instruction(PC);
|
UGeckoInstruction inst = Memory::Read_Instruction(PC);
|
||||||
if (inst.LK)
|
if (inst.LK)
|
||||||
{
|
{
|
||||||
|
PowerPC::breakpoints.ClearAllTemporary();
|
||||||
PowerPC::breakpoints.Add(PC + 4, true);
|
PowerPC::breakpoints.Add(PC + 4, true);
|
||||||
CCPU::EnableStepping(false);
|
CCPU::EnableStepping(false);
|
||||||
JumpToAddress(PC);
|
JumpToAddress(PC);
|
||||||
|
|
Loading…
Reference in New Issue