diff options
author | Damien George <damien.p.george@gmail.com> | 2015-06-25 14:42:13 +0000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2015-06-25 14:42:13 +0000 |
commit | 59fba2d6ea31c134c9c0b88dc73cd25b236f167c (patch) | |
tree | 58038f6437d92ea5bf7b5395175c8e844e169556 /py/runtime.h | |
parent | ed570e4b2a0a68e43b191fb0d5b45fb2ec83aca4 (diff) |
py: Remove mp_load_const_bytes and instead load precreated bytes object.
Previous to this patch each time a bytes object was referenced a new
instance (with the same data) was created. With this patch a single
bytes object is created in the compiler and is loaded directly at execute
time as a true constant (similar to loading bignum and float objects).
This saves on allocating RAM and means that bytes objects can now be
used when the memory manager is locked (eg in interrupts).
The MP_BC_LOAD_CONST_BYTES bytecode was removed as part of this.
Generated bytecode is slightly larger due to storing a pointer to the
bytes object instead of the qstr identifier.
Code size is reduced by about 60 bytes on Thumb2 architectures.
Diffstat (limited to 'py/runtime.h')
-rw-r--r-- | py/runtime.h | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/py/runtime.h b/py/runtime.h index 419b1d059..2282ea02c 100644 --- a/py/runtime.h +++ b/py/runtime.h @@ -88,10 +88,6 @@ void mp_delete_global(qstr qst); mp_obj_t mp_unary_op(mp_uint_t op, mp_obj_t arg); mp_obj_t mp_binary_op(mp_uint_t op, mp_obj_t lhs, mp_obj_t rhs); -mp_obj_t mp_load_const_int(qstr qst); -mp_obj_t mp_load_const_dec(qstr qst); -mp_obj_t mp_load_const_bytes(qstr qst); - mp_obj_t mp_call_function_0(mp_obj_t fun); mp_obj_t mp_call_function_1(mp_obj_t fun, mp_obj_t arg); mp_obj_t mp_call_function_2(mp_obj_t fun, mp_obj_t arg1, mp_obj_t arg2); |