TL;DR
Emulators like Dolphin cannot use Just-In-Time (JIT) compilation on iOS due to platform restrictions. A new Game Boy emulator, WATaBoy, was developed that compiles instructions to WebAssembly (Wasm) instead of native code.
✦ Why It Matters
Engineers can explore using WebAssembly for performance-critical applications in restricted environments like iOS.
Key Takeaways
Full Summary
Dolphin, a popular game console emulator, is not available on iOS because Apple restricts JIT compilation, which is essential for performance. To circumvent this, WATaBoy was created as a Game Boy emulator that compiles instructions to WebAssembly (Wasm) bytecode, leveraging the fact that web browsers can JIT compile Wasm to native code.
The project involved building an initial interpreter version followed by a JIT-to-Wasm version to benchmark performance. Results showed that the JIT-to-Wasm approach outperformed the native interpreter, providing a viable solution for running CPU-bound emulators on iOS.
This method maintains cycle accuracy while optimizing execution speed. The findings suggest that using Wasm for emulation can be a practical alternative in environments with JIT restrictions, opening new avenues for emulator development.
Related