dspjit - iram/codespace reset fixed, decreased dspjit codespace to 2MB
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7572 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
65a2e000e9
commit
3d676ac57e
|
@ -274,6 +274,9 @@ int DSPCore_RunCycles(int cycles)
|
||||||
DSPCompiledCode pExecAddr = (DSPCompiledCode)dspjit->enterDispatcher;
|
DSPCompiledCode pExecAddr = (DSPCompiledCode)dspjit->enterDispatcher;
|
||||||
pExecAddr();
|
pExecAddr();
|
||||||
|
|
||||||
|
if (g_dsp.reset_dspjit_codespace)
|
||||||
|
dspjit->ClearIRAMandDSPJITCodespaceReset();
|
||||||
|
|
||||||
return cyclesLeft;
|
return cyclesLeft;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -232,6 +232,7 @@ struct SDSP
|
||||||
u8 reg_stack_ptr[4];
|
u8 reg_stack_ptr[4];
|
||||||
u8 exceptions; // pending exceptions
|
u8 exceptions; // pending exceptions
|
||||||
volatile bool external_interrupt_waiting;
|
volatile bool external_interrupt_waiting;
|
||||||
|
bool reset_dspjit_codespace;
|
||||||
|
|
||||||
// DSP hardware stacks. They're mapped to a bunch of registers, such that writes
|
// DSP hardware stacks. They're mapped to a bunch of registers, such that writes
|
||||||
// to them push and reads pop.
|
// to them push and reads pop.
|
||||||
|
|
|
@ -66,16 +66,35 @@ DSPEmitter::~DSPEmitter()
|
||||||
FreeCodeSpace();
|
FreeCodeSpace();
|
||||||
}
|
}
|
||||||
|
|
||||||
void DSPEmitter::ClearIRAM() {
|
void DSPEmitter::ClearIRAM()
|
||||||
// ClearCodeSpace();
|
{
|
||||||
for(int i = 0x0000; i < 0x1000; i++)
|
for(int i = 0x0000; i < 0x1000; i++)
|
||||||
{
|
{
|
||||||
blocks[i] = (DSPCompiledCode)stubEntryPoint;
|
blocks[i] = (DSPCompiledCode)stubEntryPoint;
|
||||||
blockLinks[i] = 0;
|
blockLinks[i] = 0;
|
||||||
blockSize[i] = 0;
|
blockSize[i] = 0;
|
||||||
|
unresolvedJumps[i].clear();
|
||||||
}
|
}
|
||||||
|
g_dsp.reset_dspjit_codespace = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DSPEmitter::ClearIRAMandDSPJITCodespaceReset()
|
||||||
|
{
|
||||||
|
ResetCodePtr();
|
||||||
|
CompileDispatcher();
|
||||||
|
stubEntryPoint = CompileStub();
|
||||||
|
|
||||||
|
for(int i = 0x0000; i < 0x10000; i++)
|
||||||
|
{
|
||||||
|
blocks[i] = (DSPCompiledCode)stubEntryPoint;
|
||||||
|
blockLinks[i] = 0;
|
||||||
|
blockSize[i] = 0;
|
||||||
|
unresolvedJumps[i].clear();
|
||||||
|
}
|
||||||
|
g_dsp.reset_dspjit_codespace = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Must go out of block if exception is detected
|
// Must go out of block if exception is detected
|
||||||
void DSPEmitter::checkExceptions(u32 retval)
|
void DSPEmitter::checkExceptions(u32 retval)
|
||||||
{
|
{
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
#include "x64Emitter.h"
|
#include "x64Emitter.h"
|
||||||
#include "Jit/DSPJitRegCache.h"
|
#include "Jit/DSPJitRegCache.h"
|
||||||
|
|
||||||
#define COMPILED_CODE_SIZE sizeof(void *) * 0x200000
|
#define COMPILED_CODE_SIZE 2097152
|
||||||
|
|
||||||
#define MAX_BLOCKS 0x10000
|
#define MAX_BLOCKS 0x10000
|
||||||
|
|
||||||
|
@ -41,6 +41,7 @@ public:
|
||||||
|
|
||||||
void EmitInstruction(UDSPInstruction inst);
|
void EmitInstruction(UDSPInstruction inst);
|
||||||
void ClearIRAM();
|
void ClearIRAM();
|
||||||
|
void ClearIRAMandDSPJITCodespaceReset();
|
||||||
|
|
||||||
void CompileDispatcher();
|
void CompileDispatcher();
|
||||||
Block CompileStub();
|
Block CompileStub();
|
||||||
|
|
Loading…
Reference in New Issue