Hacker News new | ask | show | jobs
by ajconway 2237 days ago
Generally, JIT requires the ability to execute data (writeable memory pages that contain code). iOS apps need a special system permission (in Apple's terminology — entitlement) to construct such pages. To my knowledge, no apps except for the first-party ones (like Safari) have this permission. Apps can call into one system API that has this JIT capacity (WKWebView). It runs in a separate process and uses IPC to communicate with the app. It has an API that allows the application to execute arbitrary JS code at full speed. Some time ago it lacked support for WebAssembly, but it may have been resolved by now.

So, these are the technical limitations of the platform. Apple chose to implement a number of arbitrary rules on top of that. Well, it's not a democracy, and they are free to do so. There is always a slight chance of having some form of less restricted execution environment in future versions of iOS, mainly due to how much their iPad Pro hardware is overpowered relative to the OS capabilities.

1 comments

This was also discussed here a few months ago by the author of utmapp (Qemu on iOS). In order to get their code to work, they need to effectively run their own code in debugging mode. And yes, this requires the same entitlement as the JS JIT.

https://news.ycombinator.com/item?id=22387742