3 ms·
Stack-orientation makes sense for interpreters, because decode is expensive in software. Hardware has different tradeoffs.
by 082349872349872 4y ago
Stack-orientation makes sense for interpreters, because decode is expensive in software. Hardware has different tradeoffs.
- Morpholemew 4y agoThe theory that stacks are better than registers for an interpreter was pretty conclusively disproven by the Lua 5.0 interpreter. See https://www.lua.org/doc/jucs05.pdf https://www.lua.org/doc/jucs05.pdf (summary: although decode is slightly more expensive per opcode, you have half as many opcodes to decode on average because you get rid of all the stack manipulation instructions)