registers vs stacks

前端 未结 8 743
半阙折子戏
半阙折子戏 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条回答
  •  梦毁少年i
    2021-01-29 19:54

    Stack based VMs are easier to generate code for.

    Register based VMs are easier to create fast implementations for, and easier to generate highly optimized code for.

    For your first attempt, I recommend starting with a stack based VM.

提交回复
热议问题