Stack VM vs Register VM

That "register-based" means the VM uses hardware registers. It does not — the registers are slots in a frame, indexed by the instruction. The difference is in the operand encoding, not in where the values live.

Stack-based virtual machine

When you want the smallest, simplest compiler and instruction encoding — expressions lower to postfix with no allocation decisions at all.

Register-based virtual machine

When interpretation speed matters and you can afford a register allocator in the bytecode compiler.

AspectStack-based virtual machineRegister-based virtual machine
OperandsImplicit — taken from and returned to the operand stack.Explicit slot indices encoded in the instruction.
Instruction count for a + b * cMore: every value is pushed and popped.Fewer: operands are named, so no shuffling instructions.
Instruction sizeSmall, often one byte.Larger — the operand indices have to fit.
Compiler complexityA post-order walk of the AST is a working code generator.Needs slot allocation, which is register allocation under another name.
Dispatch overheadHigher — more instructions dispatched per unit of work.Lower, which is the entire argument for it.
Real examplesJVM bytecode, CPython, WebAssembly’s value stack.Lua 5, Dalvik, several research interpreters.