registers vs stacks

前端 未结 8 748
半阙折子戏
半阙折子戏 2021-01-29 19:13

What exactly are the advantages and disadvantages to using a register-based virtual machine versus using a stack-based virtual machine?

To me, it would seem as though a

8条回答
  •  情话喂你
    2021-01-29 19:41

    One reason for building stack-based VMs is that that actual VM opcodes can be smaller and simpler (no need to encode/decode operands). This makes the generated code smaller, and also makes the VM code simpler.

提交回复
热议问题