zware icon indicating copy to clipboard operation
zware copied to clipboard

Perform op stack space check on entering a function

Open malcolmstill opened this issue 3 years ago • 0 comments

  • 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

malcolmstill avatar Oct 24 '21 18:10 malcolmstill