zware
zware copied to clipboard
Perform op stack space check on entering a function
- The idea is rather than potentially perform stack allocation checks for instructions that produce more operands than they consume, calculate the operand stack space requirement for a whole function at parsetime and store this value with the functions metadata
- During execution operand stack overflow checks only occur on function calls, so that instructions like
i32.const
don't themselves require a check - Additionally this feels like a move in the direction of the interpreter being a register machine rather than explicitly as stack machine