keep a few separate thunkmanagers so they don't all share the same register backup area. seems to fix the single-core-paired-single-x64 issue in mario kart wii, please test the other games that were problematic.

this is probably not the best way to fix it but it'll do for now.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5062 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
hrydgard 2010-02-14 22:37:46 +00:00
parent 14bb1b5f01
commit b245c398a3
7 changed files with 22 additions and 10 deletions

View File

@ -23,8 +23,6 @@
#include "ABI.h" #include "ABI.h"
#include "Thunk.h" #include "Thunk.h"
ThunkManager thunks;
#define THUNK_ARENA_SIZE 1024*1024*1 #define THUNK_ARENA_SIZE 1024*1024*1
namespace namespace

View File

@ -43,13 +43,17 @@ class ThunkManager : public Gen::XCodeBlock
const u8 *load_regs; const u8 *load_regs;
public: public:
void Init(); ThunkManager() {
void Reset(); Init();
void Shutdown(); }
~ThunkManager() {
Shutdown();
}
void *ProtectFunction(void *function, int num_params); void *ProtectFunction(void *function, int num_params);
private:
void Init();
void Shutdown();
void Reset();
}; };
extern ThunkManager thunks;
#endif // _THUNK_H_ #endif // _THUNK_H_

View File

@ -45,7 +45,6 @@ namespace HW
{ {
CoreTiming::Init(); CoreTiming::Init();
thunks.Init(); // not really hw, but this way we know it's inited early :P
State_Init(); State_Init();
// Init the whole Hardware // Init the whole Hardware
@ -85,7 +84,6 @@ namespace HW
} }
State_Shutdown(); State_Shutdown();
thunks.Shutdown();
CoreTiming::Shutdown(); CoreTiming::Shutdown();
} }

View File

@ -48,6 +48,8 @@ The register allocation is just a simple forward greedy allocator.
#include "../../ConfigManager.h" #include "../../ConfigManager.h"
#include "x64Emitter.h" #include "x64Emitter.h"
static ThunkManager thunks;
using namespace IREmitter; using namespace IREmitter;
using namespace Gen; using namespace Gen;

View File

@ -19,6 +19,7 @@
#define _JITASMCOMMON_H #define _JITASMCOMMON_H
#include "../JitCommon/Jit_Util.h" #include "../JitCommon/Jit_Util.h"
#include "Thunk.h"
class CommonAsmRoutines : public EmuCodeBlock { class CommonAsmRoutines : public EmuCodeBlock {
protected: protected:
@ -69,6 +70,9 @@ public:
// In: ECX: Address to write to. // In: ECX: Address to write to.
// In: XMM0: Bottom 32-bit slot holds the float to be written. // In: XMM0: Bottom 32-bit slot holds the float to be written.
const u8 GC_ALIGNED16(*singleStoreQuantized[8]); const u8 GC_ALIGNED16(*singleStoreQuantized[8]);
private:
ThunkManager thunks;
}; };
#endif #endif

View File

@ -21,6 +21,7 @@
#include "Common.h" #include "Common.h"
#include "x64Emitter.h" #include "x64Emitter.h"
#include "x64Analyzer.h" #include "x64Analyzer.h"
#include "Thunk.h"
// Declarations and definitions // Declarations and definitions
// ---------- // ----------
@ -53,6 +54,8 @@ public:
const u8 *GetReadTrampoline(const InstructionInfo &info); const u8 *GetReadTrampoline(const InstructionInfo &info);
const u8 *GetWriteTrampoline(const InstructionInfo &info); const u8 *GetWriteTrampoline(const InstructionInfo &info);
private:
ThunkManager thunks;
}; };
#endif #endif

View File

@ -19,6 +19,7 @@
#define _JITUTIL_H #define _JITUTIL_H
#include "x64Emitter.h" #include "x64Emitter.h"
#include "Thunk.h"
// Like XCodeBlock but has some utilities for memory access. // Like XCodeBlock but has some utilities for memory access.
class EmuCodeBlock : public Gen::XCodeBlock { class EmuCodeBlock : public Gen::XCodeBlock {
@ -39,6 +40,8 @@ public:
void ForceSinglePrecisionS(Gen::X64Reg xmm); void ForceSinglePrecisionS(Gen::X64Reg xmm);
void ForceSinglePrecisionP(Gen::X64Reg xmm); void ForceSinglePrecisionP(Gen::X64Reg xmm);
protected:
ThunkManager thunks;
}; };
#endif // _JITUTIL_H #endif // _JITUTIL_H