Remove a function that didn't make a lot of sense.

This commit is contained in:
Henrik Rydgård 2017-01-26 09:50:16 +01:00
parent 1503f00885
commit 635b2ada43
15 changed files with 7 additions and 42 deletions

View File

@ -540,7 +540,7 @@ void CBreakPoints::Update(u32 addr)
if (addr != 0) if (addr != 0)
MIPSComp::jit->InvalidateCacheAt(addr - 4, 8); MIPSComp::jit->InvalidateCacheAt(addr - 4, 8);
else else
MIPSComp::jit->InvalidateCache(); MIPSComp::jit->ClearCache();
if (resume) if (resume)
Core_EnableStepping(false); Core_EnableStepping(false);

View File

@ -154,11 +154,6 @@ void ArmJit::ClearCache()
GenerateFixedCode(); GenerateFixedCode();
} }
void ArmJit::InvalidateCache()
{
blocks.Clear();
}
void ArmJit::InvalidateCacheAt(u32 em_address, int length) void ArmJit::InvalidateCacheAt(u32 em_address, int length)
{ {
blocks.InvalidateICache(em_address, length); blocks.InvalidateICache(em_address, length);

View File

@ -174,7 +174,6 @@ public:
void RestoreSavedEmuHackOps(std::vector<u32> saved) override { blocks.RestoreSavedEmuHackOps(saved); } void RestoreSavedEmuHackOps(std::vector<u32> saved) override { blocks.RestoreSavedEmuHackOps(saved); }
void ClearCache() override; void ClearCache() override;
void InvalidateCache() override;
void InvalidateCacheAt(u32 em_address, int length = 4) override; void InvalidateCacheAt(u32 em_address, int length = 4) override;
void EatPrefix() override { js.EatPrefix(); } void EatPrefix() override { js.EatPrefix(); }

View File

@ -146,10 +146,6 @@ void Arm64Jit::ClearCache() {
GenerateFixedCode(jo); GenerateFixedCode(jo);
} }
void Arm64Jit::InvalidateCache() {
blocks.Clear();
}
void Arm64Jit::InvalidateCacheAt(u32 em_address, int length) { void Arm64Jit::InvalidateCacheAt(u32 em_address, int length) {
blocks.InvalidateICache(em_address, length); blocks.InvalidateICache(em_address, length);
} }
@ -194,7 +190,7 @@ void Arm64Jit::Compile(u32 em_address) {
ClearCache(); ClearCache();
} }
BeginWrite(); BeginWrite(4);
int block_num = blocks.AllocateBlock(em_address); int block_num = blocks.AllocateBlock(em_address);
JitBlock *b = blocks.GetBlock(block_num); JitBlock *b = blocks.GetBlock(block_num);
@ -203,6 +199,9 @@ void Arm64Jit::Compile(u32 em_address) {
EndWrite(); EndWrite();
// Don't forget to zap the newly written instructions in the instruction cache!
FlushIcache();
bool cleanSlate = false; bool cleanSlate = false;
if (js.hasSetRounding && !js.lastSetRounding) { if (js.hasSetRounding && !js.lastSetRounding) {
@ -336,9 +335,6 @@ const u8 *Arm64Jit::DoJit(u32 em_address, JitBlock *b) {
if (dontLogBlocks > 0) if (dontLogBlocks > 0)
dontLogBlocks--; dontLogBlocks--;
// Don't forget to zap the newly written instructions in the instruction cache!
FlushIcache();
if (js.lastContinuedPC == 0) { if (js.lastContinuedPC == 0) {
b->originalSize = js.numInstructions; b->originalSize = js.numInstructions;
} else { } else {
@ -406,7 +402,7 @@ void Arm64Jit::LinkBlock(u8 *exitPoint, const u8 *checkedEntry) {
} }
ARM64XEmitter emit(exitPoint); ARM64XEmitter emit(exitPoint);
emit.B(checkedEntry); emit.B(checkedEntry);
// TODO: Write stuff after. // TODO: Write stuff after, convering up the now-unused instructions.
emit.FlushIcache(); emit.FlushIcache();
if (PlatformIsWXExclusive()) { if (PlatformIsWXExclusive()) {
ProtectMemoryPages(exitPoint, 32, MEM_PROT_READ | MEM_PROT_EXEC); ProtectMemoryPages(exitPoint, 32, MEM_PROT_READ | MEM_PROT_EXEC);

View File

@ -175,7 +175,6 @@ public:
void RestoreSavedEmuHackOps(std::vector<u32> saved) override { blocks.RestoreSavedEmuHackOps(saved); } void RestoreSavedEmuHackOps(std::vector<u32> saved) override { blocks.RestoreSavedEmuHackOps(saved); }
void ClearCache() override; void ClearCache() override;
void InvalidateCache() override;
void InvalidateCacheAt(u32 em_address, int length = 4) override; void InvalidateCacheAt(u32 em_address, int length = 4) override;
void EatPrefix() override { js.EatPrefix(); } void EatPrefix() override { js.EatPrefix(); }

View File

@ -69,10 +69,6 @@ void IRJit::ClearCache() {
blocks_.Clear(); blocks_.Clear();
} }
void IRJit::InvalidateCache() {
blocks_.Clear();
}
void IRJit::InvalidateCacheAt(u32 em_address, int length) { void IRJit::InvalidateCacheAt(u32 em_address, int length) {
blocks_.InvalidateICache(em_address, length); blocks_.InvalidateICache(em_address, length);
} }

View File

@ -144,7 +144,6 @@ public:
void RestoreSavedEmuHackOps(std::vector<u32> saved) override { blocks_.RestoreSavedEmuHackOps(saved); } void RestoreSavedEmuHackOps(std::vector<u32> saved) override { blocks_.RestoreSavedEmuHackOps(saved); }
void ClearCache() override; void ClearCache() override;
void InvalidateCache() override;
void InvalidateCacheAt(u32 em_address, int length = 4) override; void InvalidateCacheAt(u32 em_address, int length = 4) override;
const u8 *GetDispatcher() const override { return nullptr; } const u8 *GetDispatcher() const override { return nullptr; }

View File

@ -60,7 +60,7 @@ op_agent_t agent;
const u32 INVALID_EXIT = 0xFFFFFFFF; const u32 INVALID_EXIT = 0xFFFFFFFF;
JitBlockCache::JitBlockCache(MIPSState *mips, CodeBlockCommon *codeBlock) : JitBlockCache::JitBlockCache(MIPSState *mips, CodeBlockCommon *codeBlock) :
codeBlock_(codeBlock), blocks_(0), num_blocks_(0) { codeBlock_(codeBlock), blocks_(nullptr), num_blocks_(0) {
} }
JitBlockCache::~JitBlockCache() { JitBlockCache::~JitBlockCache() {

View File

@ -123,7 +123,6 @@ namespace MIPSComp {
virtual bool DescribeCodePtr(const u8 *ptr, std::string &name) = 0; virtual bool DescribeCodePtr(const u8 *ptr, std::string &name) = 0;
virtual const u8 *GetDispatcher() const = 0; virtual const u8 *GetDispatcher() const = 0;
virtual JitBlockCache *GetBlockCache() = 0; virtual JitBlockCache *GetBlockCache() = 0;
virtual void InvalidateCache() = 0;
virtual void InvalidateCacheAt(u32 em_address, int length = 4) = 0; virtual void InvalidateCacheAt(u32 em_address, int length = 4) = 0;
virtual void DoState(PointerWrap &p) = 0; virtual void DoState(PointerWrap &p) = 0;
virtual void DoDummyState(PointerWrap &p) = 0; virtual void DoDummyState(PointerWrap &p) = 0;

View File

@ -99,11 +99,6 @@ void MipsJit::ClearCache()
//GenerateFixedCode(); //GenerateFixedCode();
} }
void MipsJit::InvalidateCache()
{
blocks.Clear();
}
void MipsJit::InvalidateCacheAt(u32 em_address, int length) void MipsJit::InvalidateCacheAt(u32 em_address, int length)
{ {
blocks.InvalidateICache(em_address, length); blocks.InvalidateICache(em_address, length);

View File

@ -135,7 +135,6 @@ public:
void RestoreSavedEmuHackOps(std::vector<u32> saved) override { blocks.RestoreSavedEmuHackOps(saved); } void RestoreSavedEmuHackOps(std::vector<u32> saved) override { blocks.RestoreSavedEmuHackOps(saved); }
void ClearCache() override; void ClearCache() override;
void InvalidateCache() override;
void InvalidateCacheAt(u32 em_address, int length = 4) override; void InvalidateCacheAt(u32 em_address, int length = 4) override;
void EatPrefix() override { js.EatPrefix(); } void EatPrefix() override { js.EatPrefix(); }

View File

@ -94,11 +94,6 @@ void FakeJit::ClearCache()
//GenerateFixedCode(); //GenerateFixedCode();
} }
void FakeJit::InvalidateCache()
{
blocks.Clear();
}
void FakeJit::InvalidateCacheAt(u32 em_address, int length) void FakeJit::InvalidateCacheAt(u32 em_address, int length)
{ {
blocks.InvalidateICache(em_address, length); blocks.InvalidateICache(em_address, length);

View File

@ -128,7 +128,6 @@ public:
JitBlockCache *GetBlockCache() { return &blocks; } JitBlockCache *GetBlockCache() { return &blocks; }
void ClearCache(); void ClearCache();
void InvalidateCache();
void InvalidateCacheAt(u32 em_address, int length = 4); void InvalidateCacheAt(u32 em_address, int length = 4);
void EatPrefix() { js.EatPrefix(); } void EatPrefix() { js.EatPrefix(); }

View File

@ -245,11 +245,6 @@ void Jit::ClearCache()
GenerateFixedCode(jo); GenerateFixedCode(jo);
} }
void Jit::InvalidateCache()
{
blocks.Clear();
}
void Jit::CompileDelaySlot(int flags, RegCacheState *state) void Jit::CompileDelaySlot(int flags, RegCacheState *state)
{ {
// Need to offset the downcount which was already incremented for the branch + delay slot. // Need to offset the downcount which was already incremented for the branch + delay slot.

View File

@ -163,7 +163,6 @@ public:
void RestoreSavedEmuHackOps(std::vector<u32> saved) override { blocks.RestoreSavedEmuHackOps(saved); } void RestoreSavedEmuHackOps(std::vector<u32> saved) override { blocks.RestoreSavedEmuHackOps(saved); }
void ClearCache() override; void ClearCache() override;
void InvalidateCache() override;
void InvalidateCacheAt(u32 em_address, int length = 4) override { void InvalidateCacheAt(u32 em_address, int length = 4) override {
if (blocks.RangeMayHaveEmuHacks(em_address, em_address + length)) { if (blocks.RangeMayHaveEmuHacks(em_address, em_address + length)) {
blocks.InvalidateICache(em_address, length); blocks.InvalidateICache(em_address, length);