A shame operating systems like iOS/iPadOS do not allow JIT. iPad Pro's have such fast CPU's that you cant even use fully because of decisions like this.
They do, technically, allow JIT. You need a very hard-to-obtain entitlement that lets you turn writable pages into executable read-only pages, and good luck getting that entitlement if (for some reason) your name isn’t “mobilesafari”, but the capability exists.
JIT: So you want to be faster than an interpreter on modern CPUs
31–40 of 66 posts
Re: JIT: So you want to be faster than an interpreter on modern CPUs
#32Earlier quoted context omitted.
JIT compilation can be faster for compiled languages too, as it allows data driven inlining and devirtualization, as well as "effective constant" propogation and runtime architecture feature detection
It can be but it never is.
AutoFDO has since been ported to Android and adopted by Yandex [3].
[0] https://lwn.net/Articles/995397/
Re: JIT: So you want to be faster than an interpreter on modern CPUs
#33> This is called branch prediction, it has been the source of many fun security issues... No, that's speculative execution you just described. Branch prediction was implemented long before out-of-order CPUs were a thing, as you need branch prediction to make the most of pipelining (eg. fetching and decoding a new instruction while you're still executing the previous one--if you predict branches, you're more likely to…
Speculative execution does not require out-of-order execution. When you predict a branch, you're speculatively executing the predicted branch. Whether you're doing it in the same order as instruction order or out of order is independent of that.
Re: JIT: So you want to be faster than an interpreter on modern CPUs
#34Earlier quoted context omitted.
JIT compilation can be faster for compiled languages too, as it allows data driven inlining and devirtualization, as well as "effective constant" propogation and runtime architecture feature detection
It can be but it never is.
Re: JIT: So you want to be faster than an interpreter on modern CPUs
#35Earlier quoted context omitted.
Speculative execution does not require out-of-order execution. When you predict a branch, you're speculatively executing the predicted branch. Whether you're doing it in the same order as instruction order or out of order is independent of that.
If you're executing instructions in order, wouldn't you already know the result of the branch by the time you reach its code?
Re: JIT: So you want to be faster than an interpreter on modern CPUs
#36Earlier quoted context omitted.
They do, technically, allow JIT. You need a very hard-to-obtain entitlement that lets you turn writable pages into executable read-only pages, and good luck getting that entitlement if (for some reason) your name isn’t “mobilesafari”, but the capability exists.
When you say it's "hard" to obtain--is it possible to obtain if you aren't Apple? Does Apple ever provide it to third party developers, or is there even a path to requesting it?
Re: JIT: So you want to be faster than an interpreter on modern CPUs
#37A shame operating systems like iOS/iPadOS do not allow JIT. iPad Pro's have such fast CPU's that you cant even use fully because of decisions like this.
Re: JIT: So you want to be faster than an interpreter on modern CPUs
#38I'm not really interested in building an interpreter, but the part about scalar out of order execution got me thinking. The opcode sequencing logic of an interpreter is inherently serial and an obvious bottleneck (step++; goto step->label; requires an add, then a fetch and then a jump, pretty ugly). Why not do the same thing the CPU does and fetch N jump addresses at once? Now the overhead is gone and you just need t…
Re: JIT: So you want to be faster than an interpreter on modern CPUs
#39A shame operating systems like iOS/iPadOS do not allow JIT. iPad Pro's have such fast CPU's that you cant even use fully because of decisions like this.
They do, technically, allow JIT. You need a very hard-to-obtain entitlement that lets you turn writable pages into executable read-only pages, and good luck getting that entitlement if (for some reason) your name isn’t “mobilesafari”, but the capability exists.