aboutsummaryrefslogtreecommitdiff
path: root/src/core/hle/service/jit/jit.cpp
diff options
context:
space:
mode:
authorPavelBARABANOV <pavelbarabanov94@gmail.com>2026-10-15 08:45:15 +0200
committercrueter <crueter@eden-emu.dev>2026-10-15 08:45:15 +0200
commite255c20db4111485d228c10478bda63aabcfdde5 (patch)
tree1f8c88981b60e9a4db4ed306742196b1c4b68116 /src/core/hle/service/jit/jit.cpp
parent14da4482a4668928bad43bb67ef12f96b9c9d972 (diff)
Revert "[hle] constexpr handler dispatch maps, introduce version gating (#4480)" (#4532)
This reverts commit 218c6705d950635bc18f8458d738a1996fb592b6. - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md). - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4532 Reviewed-by: lizzie <lizzie@eden-emu.dev> Reviewed-by: CamilleLaVey <camillelavey99@gmail.com> Reviewed-by: Maufeat <sahyno1996@gmail.com>
Diffstat (limited to 'src/core/hle/service/jit/jit.cpp')
-rw-r--r--src/core/hle/service/jit/jit.cpp37
1 files changed, 19 insertions, 18 deletions
diff --git a/src/core/hle/service/jit/jit.cpp b/src/core/hle/service/jit/jit.cpp
index 9059aaf518..ec3a3a8dcb 100644
--- a/src/core/hle/service/jit/jit.cpp
+++ b/src/core/hle/service/jit/jit.cpp
@@ -37,6 +37,18 @@ public:
, user_ro{std::move(user_ro_)}
, context{process_->GetMemory()}
{
+
+ // clang-format off
+ static const FunctionInfo functions[] = {
+ {0, C<&IJitEnvironment::GenerateCode>, "GenerateCode"},
+ {1, C<&IJitEnvironment::Control>, "Control"},
+ {1000, C<&IJitEnvironment::LoadPlugin>, "LoadPlugin"},
+ {1001, C<&IJitEnvironment::GetCodeAddress>, "GetCodeAddress"},
+ };
+ // clang-format on
+
+ RegisterHandlers(functions);
+
// Identity map user code range into sysmodule context
configuration.user_rx_memory.size = user_rx.GetSize();
configuration.user_rx_memory.offset = user_rx.GetAddress();
@@ -47,10 +59,6 @@ public:
configuration.sys_ro_memory = configuration.user_ro_memory;
}
- std::optional<FunctionInfoBase> FindRequest(u32 key) override {
- return HandlerTableGenerateWithFind(key, functions);
- }
-
~IJitEnvironment() {
user_rx.Finalize(system.Kernel());
user_ro.Finalize(system.Kernel());
@@ -240,13 +248,6 @@ private:
return in;
}
- static constexpr auto functions = CreateStaticMap(
- FunctionInfo{0, C<&IJitEnvironment::GenerateCode>, "GenerateCode"},
- FunctionInfo{1, C<&IJitEnvironment::Control>, "Control"},
- FunctionInfo{1000, C<&IJitEnvironment::LoadPlugin>, "LoadPlugin"},
- FunctionInfo{1001, C<&IJitEnvironment::GetCodeAddress>, "GetCodeAddress"}
- );
-
Kernel::KScopedAutoObject<Kernel::KProcess> process;
CodeMemory user_rx;
CodeMemory user_ro;
@@ -257,10 +258,14 @@ private:
class JITU final : public ServiceFramework<JITU> {
public:
- explicit JITU(Core::System& system_) : ServiceFramework{system_, "jit:u"} {}
+ explicit JITU(Core::System& system_) : ServiceFramework{system_, "jit:u"} {
+ // clang-format off
+ static const FunctionInfo functions[] = {
+ {0, C<&JITU::CreateJitEnvironment>, "CreateJitEnvironment"},
+ };
+ // clang-format on
- std::optional<FunctionInfoBase> FindRequest(u32 key) override {
- return HandlerTableGenerateWithFind(key, functions);
+ RegisterHandlers(functions);
}
private:
@@ -289,10 +294,6 @@ private:
}
private:
- static constexpr auto functions = CreateStaticMap(
- FunctionInfo{0, C<&JITU::CreateJitEnvironment>, "CreateJitEnvironment"}
- );
-
std::mt19937_64 generate_random{};
};