Merge pull request #4766 from lioncash/dspemitter

DSPCore: Move CompileCurrent to the DSPEmitter
This commit is contained in:
Markus Wick 2017-01-27 08:09:52 +01:00 committed by GitHub
commit f37c5f1f1c
3 changed files with 22 additions and 24 deletions

View File

@ -314,28 +314,6 @@ void DSPCore_Step()
step_event.Set(); step_event.Set();
} }
void CompileCurrent()
{
g_dsp_jit->Compile(g_dsp.pc);
bool retry = true;
while (retry)
{
retry = false;
for (u16 i = 0x0000; i < 0xffff; ++i)
{
if (!g_dsp_jit->m_unresolved_jumps[i].empty())
{
u16 addrToCompile = g_dsp_jit->m_unresolved_jumps[i].front();
g_dsp_jit->Compile(addrToCompile);
if (!g_dsp_jit->m_unresolved_jumps[i].empty())
retry = true;
}
}
}
}
u16 DSPCore_ReadRegister(size_t reg) u16 DSPCore_ReadRegister(size_t reg)
{ {
switch (reg) switch (reg)

View File

@ -354,8 +354,6 @@ void DSPCore_SetExternalInterrupt(bool val);
// sets a flag in the pending exception register. // sets a flag in the pending exception register.
void DSPCore_SetException(u8 level); void DSPCore_SetException(u8 level);
void CompileCurrent();
enum DSPCoreState enum DSPCoreState
{ {
DSPCORE_STOP = 0, DSPCORE_STOP = 0,

View File

@ -352,6 +352,28 @@ void DSPEmitter::Compile(u16 start_addr)
JMP(m_return_dispatcher, true); JMP(m_return_dispatcher, true);
} }
static void CompileCurrent()
{
g_dsp_jit->Compile(g_dsp.pc);
bool retry = true;
while (retry)
{
retry = false;
for (u16 i = 0x0000; i < 0xffff; ++i)
{
if (!g_dsp_jit->m_unresolved_jumps[i].empty())
{
const u16 address_to_compile = g_dsp_jit->m_unresolved_jumps[i].front();
g_dsp_jit->Compile(address_to_compile);
if (!g_dsp_jit->m_unresolved_jumps[i].empty())
retry = true;
}
}
}
}
const u8* DSPEmitter::CompileStub() const u8* DSPEmitter::CompileStub()
{ {
const u8* entryPoint = AlignCode16(); const u8* entryPoint = AlignCode16();