aboutsummaryrefslogtreecommitdiff
path: root/py/bc.h
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2017-06-09 13:31:57 +1000
committerDamien George <damien.p.george@gmail.com>2017-06-09 13:36:33 +1000
commita8a5d1e8c8db3b7c64e1921005ceb5a5d47280f4 (patch)
tree8b6ba37193f4c3eaaa9a1115d2be6d90055ce565 /py/bc.h
parent4352b944d2fe0919b34774bec1a6ea440649a1df (diff)
py: Provide mp_decode_uint_skip() to help reduce stack usage.
Taking the address of a local variable leads to increased stack usage, so the mp_decode_uint_skip() function is added to reduce the need for taking addresses. The changes in this patch reduce stack usage of a Python call by 8 bytes on ARM Thumb, by 16 bytes on non-windowing Xtensa archs, and by 16 bytes on x86-64. Code size is also slightly reduced on most archs by around 32 bytes.
Diffstat (limited to 'py/bc.h')
-rw-r--r--py/bc.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/py/bc.h b/py/bc.h
index e8d428612..88045dc55 100644
--- a/py/bc.h
+++ b/py/bc.h
@@ -92,6 +92,7 @@ typedef struct _mp_code_state_t {
mp_uint_t mp_decode_uint(const byte **ptr);
mp_uint_t mp_decode_uint_value(const byte *ptr);
+const byte *mp_decode_uint_skip(const byte *ptr);
mp_vm_return_kind_t mp_execute_bytecode(mp_code_state_t *code_state, volatile mp_obj_t inject_exc);
mp_code_state_t *mp_obj_fun_bc_prepare_codestate(mp_obj_t func, size_t n_args, size_t n_kw, const mp_obj_t *args);