vm: Initial support for calling bytecode functions w/o C stack ("stackless").

This commit is contained in:
Paul Sokolovsky
2015-03-28 01:14:44 +02:00
parent f88eec0de2
commit 2039757b85
5 changed files with 85 additions and 2 deletions

View File

@@ -86,6 +86,9 @@ void mp_setup_code_state(mp_code_state *code_state, mp_obj_t self_in, mp_uint_t
mp_obj_fun_bc_t *self = self_in;
mp_uint_t n_state = code_state->n_state;
#if MICROPY_STACKLESS
code_state->prev = NULL;
#endif
code_state->code_info = self->bytecode;
code_state->sp = &code_state->state[0] - 1;
code_state->exc_sp = (mp_exc_stack_t*)(code_state->state + n_state) - 1;