mirror of
https://github.com/micropython/micropython.git
synced 2026-01-05 11:40:18 +01:00
py: Merge mp_execute_bytecode into fun_bc_call.
This reduces stack usage by 16 words (64 bytes) for stmhal/ port. See issue #640.
This commit is contained in:
@@ -106,7 +106,7 @@ mp_vm_return_kind_t mp_obj_gen_resume(mp_obj_t self_in, mp_obj_t send_value, mp_
|
||||
}
|
||||
mp_obj_dict_t *old_globals = mp_globals_get();
|
||||
mp_globals_set(self->globals);
|
||||
mp_vm_return_kind_t ret_kind = mp_execute_bytecode2(&self->code_state, throw_value);
|
||||
mp_vm_return_kind_t ret_kind = mp_execute_bytecode(&self->code_state, throw_value);
|
||||
mp_globals_set(old_globals);
|
||||
|
||||
switch (ret_kind) {
|
||||
@@ -263,7 +263,7 @@ mp_obj_t mp_obj_new_gen_instance(mp_obj_dict_t *globals, const byte *bytecode,
|
||||
o->code_state.exc_sp = (mp_exc_stack_t*)(o->code_state.state + n_state) - 1;
|
||||
o->code_state.n_state = n_state;
|
||||
|
||||
// copy args to end of state array, in reverse (that's how mp_execute_bytecode2 needs it)
|
||||
// copy args to end of state array, in reverse (that's how mp_execute_bytecode needs it)
|
||||
for (uint i = 0; i < n_args; i++) {
|
||||
o->code_state.state[n_state - 1 - i] = args[i];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user