Virtual Machine Showdown: Stack Versus Registers
usenix.org
usenix.org
A big advantage of a stack-based architecture (in my experience) is that it's simpler to write a compiler for because you don't have to worry about register allocation. My compiler writing experience is a bit limited (I've done some work targeting the JVM, and some very limited MIPS assembly coding), but I've found that not having to track register state is a very helpful simplification.
If you care about performance, going the compiler route is the only way. In addition, JITCs do not need an interpreter as well, it's just often done that way to offset the cost of compilation for routines that aren't hit often.
instead of using the prevalent stack-based interpreter architecture, register based interpreters need fewer instructions, since all those load & store instructions are not necessary anymore. however, the amount of information cannot become less, therefore the information is replaced by using quadruple code, i.e., the tuple (opcode, destination register, source register 1, source register 2). the quadruple code requires more space, alas the bytecode binaries become bigger, whereas the code requires fewer instruction dispatches than its stack based counterpart.
NOTE: this paper implements the optimization for the jvm, but lua uses a register based architecture, too! (AFAIR google's dalvik [of android fame] uses a register based approach, too--probably to save energy [since dispatches in interpreters require indirect branches, which are quite expensive])
All in all, it's a bad idea unless you're doing it in hardware (where you simply can't have enough registers due to cost [in money and die area] issues)
PS: by jit compiling this code can be easily eliminated. PPS: the points i mentioned are only "easily" implementable when your host programming language supports primitive types (such as ints, longs, floats, etc.). whenever you are dealing with "objects" (i.e. pointers to structs) you have to do (un-)boxing which lessens the advantage of stack caching...
Lua 5 uses a register based VM, it seems. There's a paper on it - and more - here: http://www.tecgraf.puc-rio.br/~lhf/ftp/doc/jucs05.pdf