JitCommon: Pass jit block instead of host pointer on linking.

So the JIT may do more fancy stuff.
This commit is contained in:
degasus 2016-05-13 23:28:35 +02:00
parent cf3c65fbd0
commit 10e716c623
6 changed files with 10 additions and 8 deletions

View File

@ -198,6 +198,6 @@ void CachedInterpreter::WriteDestroyBlock(const u8* location, u32 address)
{ {
} }
void CachedInterpreter::WriteLinkBlock(u8* location, const u8* address) void CachedInterpreter::WriteLinkBlock(u8* location, const JitBlock& block)
{ {
} }

View File

@ -35,7 +35,7 @@ public:
return "Cached Interpreter"; return "Cached Interpreter";
} }
void WriteLinkBlock(u8* location, const u8* address) override; void WriteLinkBlock(u8* location, const JitBlock& block) override;
void WriteDestroyBlock(const u8* location, u32 address) override; void WriteDestroyBlock(const u8* location, u32 address) override;

View File

@ -7,8 +7,9 @@
#include "Core/PowerPC/JitArm64/Jit.h" #include "Core/PowerPC/JitArm64/Jit.h"
#include "Core/PowerPC/JitArm64/JitArm64Cache.h" #include "Core/PowerPC/JitArm64/JitArm64Cache.h"
void JitArm64BlockCache::WriteLinkBlock(u8* location, const u8* address) void JitArm64BlockCache::WriteLinkBlock(u8* location, const JitBlock& block)
{ {
const u8* address = block.checkedEntry;
ARM64XEmitter emit(location); ARM64XEmitter emit(location);
s64 offset = address - location; s64 offset = address - location;

View File

@ -12,6 +12,6 @@ typedef void (*CompiledCode)();
class JitArm64BlockCache : public JitBaseBlockCache class JitArm64BlockCache : public JitBaseBlockCache
{ {
private: private:
void WriteLinkBlock(u8* location, const u8* address); void WriteLinkBlock(u8* location, const JitBlock& block);
void WriteDestroyBlock(const u8* location, u32 address); void WriteDestroyBlock(const u8* location, u32 address);
}; };

View File

@ -198,7 +198,7 @@ using namespace Gen;
int destinationBlock = GetBlockNumberFromStartAddress(e.exitAddress); int destinationBlock = GetBlockNumberFromStartAddress(e.exitAddress);
if (destinationBlock != -1) if (destinationBlock != -1)
{ {
WriteLinkBlock(e.exitPtrs, blocks[destinationBlock].checkedEntry); WriteLinkBlock(e.exitPtrs, blocks[destinationBlock]);
e.linkStatus = true; e.linkStatus = true;
} }
} }
@ -316,8 +316,9 @@ using namespace Gen;
} }
} }
void JitBlockCache::WriteLinkBlock(u8* location, const u8* address) void JitBlockCache::WriteLinkBlock(u8* location, const JitBlock& block)
{ {
const u8* address = block.checkedEntry;
XEmitter emit(location); XEmitter emit(location);
if (*location == 0xE8) if (*location == 0xE8)
{ {

View File

@ -116,7 +116,7 @@ class JitBaseBlockCache
void DestroyBlock(int block_num, bool invalidate); void DestroyBlock(int block_num, bool invalidate);
// Virtual for overloaded // Virtual for overloaded
virtual void WriteLinkBlock(u8* location, const u8* address) = 0; virtual void WriteLinkBlock(u8* location, const JitBlock& block) = 0;
virtual void WriteDestroyBlock(const u8* location, u32 address) = 0; virtual void WriteDestroyBlock(const u8* location, u32 address) = 0;
public: public:
@ -164,6 +164,6 @@ public:
class JitBlockCache : public JitBaseBlockCache class JitBlockCache : public JitBaseBlockCache
{ {
private: private:
void WriteLinkBlock(u8* location, const u8* address) override; void WriteLinkBlock(u8* location, const JitBlock& block) override;
void WriteDestroyBlock(const u8* location, u32 address) override; void WriteDestroyBlock(const u8* location, u32 address) override;
}; };