• Damien George's avatar
    py/vm: When VM raises exception put exc obj at beginning of func state. · d95947b4
    Damien George authored
    Instead of at end of state, n_state - 1.  It was originally (way back in
    v1.0) put at the end of the state because the VM didn't have a pointer to
    the start.  But now that the VM takes a mp_code_state_t pointer it does
    have a pointer to the start of the state so can put the exception object
    there.
    
    This commit saves about 30 bytes of code on all architectures, and, more
    importantly, reduces C-stack usage by a couple of words (8 bytes on Thumb2
    and 16 bytes on x86-64) for every (non-generator) call of a bytecode
    function because fun_bc_call no longer needs to remember the n_state
    variable.
    d95947b4
objgenerator.c 9.81 KB