[Vm-dev] Amazing ARM simulator experience

Ben Coman btc at openinworld.com
Thu Jun 2 05:49:55 UTC 2016


On Thu, Jun 2, 2016 at 10:19 AM, Ryan Macnak <rmacnak at gmail.com> wrote:
>
> I'll second that simulators are an essential tool for building a JIT. In the Dart VM, we have our own simulators for ARM, ARM64 and MIPS that allow us to test changes against all the architectures we support, locally on our x64 workstations. When we first got the VM running on iOS, we were even running the ARM simulator on the iPhone to work around the no-JITing-unless-you're-Apple policy (we have since completed an AOT mode). Although it was sluggish compared to its JIT counterpart running on Android, it was certainly usable. And given our loading code is also implemented in Dart, having simulators allows us to cross-compile AOT code for Android and iOS from x64 desktops.


One thing I've been contemplating for a while, given that Sista will
IIUC cache hotspot info in the Image, enabling a hot-start, would that
be a reasonable workaround for Apple's no-JIT policy.  You could use
unit tests to warm up Sista then code-sign the whole resultant image
??


btw I got curious what exactly the policy[1] was... "Further
protection is provided by iOS using ARM’s Execute Never (XN) feature,
which marks memory pages as non-executable. Memory pages marked as
both writable and executable can be used only by apps under tightly
controlled conditions: The kernel checks for the presence of the
Apple-only dynamic code-signing entitlement. Even then, only a single
mmap call can be made to request an executable and writable page,
which is given a randomized address. Safari uses this functionality
for its JavaScript JIT compiler."

[1] https://www.apple.com/business/docs/iOS_Security_Guide.pdf

cheers -ben


More information about the Vm-dev mailing list