aboutsummaryrefslogtreecommitdiff
path: root/src/dolphin/CodeBlock.h
diff options
context:
space:
mode:
authorRSDuck <RSDuck@users.noreply.github.com>2019-07-14 18:08:42 +0200
committerRSDuck <rsduck@users.noreply.github.com>2020-06-16 11:53:22 +0200
commitfc82ca1a97ce8304bf563ca53187227e505eb54e (patch)
tree3cfe1e0731a1a4de9e07aff4bda61f0a0a6c7e94 /src/dolphin/CodeBlock.h
parentd13d625f7363449c3fdc041b0a22005b92c83229 (diff)
jit: remove unnessary files from dolphin
Diffstat (limited to 'src/dolphin/CodeBlock.h')
-rw-r--r--src/dolphin/CodeBlock.h29
1 files changed, 1 insertions, 28 deletions
diff --git a/src/dolphin/CodeBlock.h b/src/dolphin/CodeBlock.h
index 1434297..31a8d93 100644
--- a/src/dolphin/CodeBlock.h
+++ b/src/dolphin/CodeBlock.h
@@ -49,15 +49,6 @@ public:
CodeBlock(CodeBlock&&) = delete;
CodeBlock& operator=(CodeBlock&&) = delete;
- // Call this before you generate any code.
- void AllocCodeSpace(size_t size)
- {
- region_size = size;
- total_region_size = size;
- region = static_cast<u8*>(Common::AllocateExecutableMemory(total_region_size));
- T::SetCodePtr(region);
- }
-
// Always clear code space with breakpoints, so that if someone accidentally executes
// uninitialized, it just breaks into the debugger.
void ClearCodeSpace()
@@ -66,26 +57,8 @@ public:
ResetCodePtr();
}
- // Call this when shutting down. Don't rely on the destructor, even though it'll do the job.
- void FreeCodeSpace()
- {
- ASSERT(!m_is_child);
- Common::FreeMemoryPages(region, total_region_size);
- region = nullptr;
- region_size = 0;
- total_region_size = 0;
- for (CodeBlock* child : m_children)
- {
- child->region = nullptr;
- child->region_size = 0;
- child->total_region_size = 0;
- }
- }
-
bool IsInSpace(const u8* ptr) const { return ptr >= region && ptr < (region + region_size); }
- // Cannot currently be undone. Will write protect the entire code region.
- // Start over if you need to change the code (call FreeCodeSpace(), AllocCodeSpace()).
- void WriteProtect() { Common::WriteProtectMemory(region, region_size, true); }
+
void ResetCodePtr() { T::SetCodePtr(region); }
size_t GetSpaceLeft() const
{