diff options
| author | Ryan Houdek <Sonicadvance1@gmail.com> | 2015-07-15 08:41:58 -0500 |
|---|---|---|
| committer | Ryan Houdek <Sonicadvance1@gmail.com> | 2015-07-15 08:41:58 -0500 |
| commit | c0f80ca52449ae02458302d4e99e451a802ca9fa (patch) | |
| tree | 06bc489344131370c9e3a1f9bd315c13b54d568e /Source/Core/Common | |
| parent | 41bdaece5ef31a6fd31785ff79f6a54aa9728202 (diff) | |
| parent | 6f38d1baa1d6c735ae12b571dd341cd431f6ba73 (diff) | |
Merge pull request #2736 from degasus/farcache
JitArm64: Farcache
Diffstat (limited to 'Source/Core/Common')
| -rw-r--r-- | Source/Core/Common/Arm64Emitter.cpp | 7 | ||||
| -rw-r--r-- | Source/Core/Common/Arm64Emitter.h | 4 | ||||
| -rw-r--r-- | Source/Core/Common/CodeBlock.h | 6 |
3 files changed, 12 insertions, 5 deletions
diff --git a/Source/Core/Common/Arm64Emitter.cpp b/Source/Core/Common/Arm64Emitter.cpp index 6eaa4fdfca..f5b00de3cc 100644 --- a/Source/Core/Common/Arm64Emitter.cpp +++ b/Source/Core/Common/Arm64Emitter.cpp @@ -271,8 +271,8 @@ bool IsImmLogical(uint64_t value, unsigned int width, unsigned int *n, unsigned void ARM64XEmitter::SetCodePtr(u8* ptr) { m_code = ptr; - m_startcode = m_code; - m_lastCacheFlushEnd = ptr; + if (!m_lastCacheFlushEnd) + m_lastCacheFlushEnd = ptr; } const u8* ARM64XEmitter::GetCodePtr() const @@ -315,6 +315,9 @@ void ARM64XEmitter::FlushIcache() void ARM64XEmitter::FlushIcacheSection(u8* start, u8* end) { + if (start == end) + return; + #if defined(IOS) // Header file says this is equivalent to: sys_icache_invalidate(start, end - start); sys_cache_control(kCacheFunctionPrepareForExecution, start, end - start); diff --git a/Source/Core/Common/Arm64Emitter.h b/Source/Core/Common/Arm64Emitter.h index 6939984308..c4ce6ab253 100644 --- a/Source/Core/Common/Arm64Emitter.h +++ b/Source/Core/Common/Arm64Emitter.h @@ -324,7 +324,6 @@ class ARM64XEmitter private: u8* m_code; - u8* m_startcode; u8* m_lastCacheFlushEnd; void EncodeCompareBranchInst(u32 op, ARM64Reg Rt, const void* ptr); @@ -365,14 +364,13 @@ protected: public: ARM64XEmitter() - : m_code(nullptr), m_startcode(nullptr), m_lastCacheFlushEnd(nullptr) + : m_code(nullptr), m_lastCacheFlushEnd(nullptr) { } ARM64XEmitter(u8* code_ptr) { m_code = code_ptr; m_lastCacheFlushEnd = code_ptr; - m_startcode = code_ptr; } virtual ~ARM64XEmitter() diff --git a/Source/Core/Common/CodeBlock.h b/Source/Core/Common/CodeBlock.h index 972fc707d6..5699fc5385 100644 --- a/Source/Core/Common/CodeBlock.h +++ b/Source/Core/Common/CodeBlock.h @@ -72,5 +72,11 @@ public: { return region_size - (T::GetCodePtr() - region); } + + bool IsAlmostFull() const + { + // This should be bigger than the biggest block ever. + return GetSpaceLeft() < 0x10000; + } }; |
