News for hackers. Stuff that matters.
Re:Register-based VMs have a higher performance than stack-b... by sitkack on Sunday December 11, 2016 @10:05PM (#13155188)
My feeling is that has more to do with memory traffic and the cache hierarchy than the difference between register and stack VMs. Stack VMs are going to generate more read-modify-write cycles than a register VM. Of course experiments are in order (or out of order, ha!).
Re:Register-based VMs have a higher performance than stack-b... by questerzen on Monday December 12, 2016 @01:26AM (#13156054)
I imagine you are right. But there should be plenty of scope for optimising this in the VM itself. Most stack operations are immediately preceded by a push, so hold the top of the stack in a register and the last push in another and you could avoid a high proportion of memory calls in the most common cases. Does anyone know if JVM implementations do this?
Re:Register-based VMs have a higher performance than stack-b... by questerzen on Monday December 12, 2016 @04:20AM (#13156763)
From the Wikipedia page on the JVM: "[code verification]...allowing the JIT compiler to transform stack accesses into fixed register accesses. Because of this, that the JVM is a stack architecture does not imply a speed penalty for emulation on register-based architectures when using a JIT compiler."