-
Julian Seward authored
Support stack overflow checks in interpreted code. The deal is: * If a BCO is reckoned to need less than iNTERP_STACK_CHECK_THRESH words of stack, no stack check insn is added. * If a BCO needs >= iNTERP_STACK_CHECK_THRESH words, an explicit check insn is added. The interpreter ensures at least iNTERP_STACK_CHECK_THRESH words of stack are available before running each BCO, regardless of whether or not the BCO contains an explicit check insn too. By setting iNTERP_STACK_CHECK_THRESH to a suitably large level (currently 50), most BCOs only require the implicit stack check, which avoids the overhead of decoding one extra insn per BCO. BCOs which do have a stack check insn then do 2 stack checks rather than 1 (implicit, then explicit), but this is rare enough that we don't care.
3a8cc90c