4 ms·
https://www.usenix.org/legacy/events/vee05/full_papers/p153-yunhe.pdf https://www.usenix.org/legacy/events/vee05/full_papers/p153-... (2005) is the best stack v
by Someone 12y ago
https://www.usenix.org/legacy/events/vee05/full_papers/p153-yunhe.pdf https://www.usenix.org/legacy/events/vee05/full_papers/p153-... (2005) is the best stack vs registers comparison I know of (but I am, at best, a hobbyist in this field, so corrections are welcome)
I think there are three options for fast VMs:
- a stack machine that JITs to registers (JVM, C#)
- a register machine whose registers match that of the target architecture (I think Lua is or was an example here)
- a register machine with infinitely many registers that JITs to one whose registers match that of the target architecture (LLVM). I think the call is still out here whether it is possible to make a truly fast JITter here, but I expect that is just a matter of lack of effort.
Problem with the middle approach is that a portable JITter that wants to use the full power of a CPU must handle both the case where the hardware has fewer registers than the VM and the case where it has more. The other two only have to handle one of these cases. That's why they are more popular for multi-platform solutions.
And of course, there is the case of JITting to stack CPUs. For practical purposes, one can mostly ignored that case nowadays.
- chrisseaton 12y agoI'm not sure it makes much difference for JIT as by the time it's gone into the JIT's IR and had multiple optimisation passes applied to it I woukd imagine it'll be in either SSA or PDG format and what format the byte codes came in will be long forgotten.