Merge pull request #6534 from lioncash/dspjit

DSPEmitter: Remove uses of the DSP JIT global in CompileCurrent()
This commit is contained in:
Markus Wick 2018-03-26 21:12:46 +02:00 committed by GitHub
commit 9b5726fc23
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 6 deletions

View File

@ -374,9 +374,9 @@ void DSPEmitter::Compile(u16 start_addr)
JMP(m_return_dispatcher, true);
}
static void CompileCurrent()
static void CompileCurrent(DSPEmitter& emitter)
{
g_dsp_jit->Compile(g_dsp.pc);
emitter.Compile(g_dsp.pc);
bool retry = true;
@ -385,11 +385,11 @@ static void CompileCurrent()
retry = false;
for (size_t i = 0; i < 0xffff; ++i)
{
if (!g_dsp_jit->m_unresolved_jumps[i].empty())
if (!emitter.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())
const u16 address_to_compile = emitter.m_unresolved_jumps[i].front();
emitter.Compile(address_to_compile);
if (!emitter.m_unresolved_jumps[i].empty())
retry = true;
}
}
@ -399,6 +399,7 @@ static void CompileCurrent()
const u8* DSPEmitter::CompileStub()
{
const u8* entryPoint = AlignCode16();
MOV(64, R(ABI_PARAM1), Imm64(reinterpret_cast<u64>(this)));
ABI_CallFunction(CompileCurrent);
XOR(32, R(EAX), R(EAX)); // Return 0 cycles executed
JMP(m_return_dispatcher);