diff options
| author | Damien George <damien.p.george@gmail.com> | 2017-03-17 16:38:46 +1100 |
|---|---|---|
| committer | Damien George <damien.p.george@gmail.com> | 2017-03-17 16:50:19 +1100 |
| commit | 5640e6dacd39d97adffce8490991c457f457b1cd (patch) | |
| tree | c1978abcf974c64cc7aede37404f113ac74faafc /py/vm.c | |
| parent | 71a3d6ec3bd02c5bd13334537e1bd146bb643bad (diff) | |
py: Provide mp_decode_uint_value to help optimise stack usage.
This has a noticeable improvement on x86-64 and Thumb2 archs, where stack
usage is reduced by 2 machine words in the VM.
Diffstat (limited to 'py/vm.c')
| -rw-r--r-- | py/vm.c | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -162,8 +162,7 @@ mp_vm_return_kind_t mp_execute_bytecode(mp_code_state_t *code_state, volatile mp run_code_state: ; #endif // Pointers which are constant for particular invocation of mp_execute_bytecode() - const byte *temp_bc = code_state->fun_bc->bytecode; - size_t n_state = mp_decode_uint(&temp_bc); + size_t n_state = mp_decode_uint_value(code_state->fun_bc->bytecode); mp_obj_t * /*const*/ fastn = &code_state->state[n_state - 1]; mp_exc_stack_t * /*const*/ exc_stack = (mp_exc_stack_t*)(code_state->state + n_state); |
