diff options
author | Damien George <damien.p.george@gmail.com> | 2015-03-21 14:21:54 +0000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2015-03-21 14:21:54 +0000 |
commit | 55b74d1ff5fcdd32150b10cb42cd1fd59f1317c3 (patch) | |
tree | 6bcd00d3379aecc8b7a0012aac633b446c646768 /py/runtime.h | |
parent | 59f68313369802a9fe19c5161891075d5163c0f0 (diff) |
py: Combine duplicated code that converts members from a lookup.
Despite initial guess, this code factoring does not hamper performance.
In fact it seems to improve speed by a little: running pystone(1.2) on
pyboard (which gives a very stable result) this patch takes pystones
from 1729.51 up to 1742.16. Also, pystones on x64 increase by around
the same proportion (but it's much noisier).
Taking a look at the generated machine code, stack usage with this patch
is unchanged, and call is tail-optimised with all arguments in
registers. Code size decreases by about 50 bytes on Thumb2 archs.
Diffstat (limited to 'py/runtime.h')
-rw-r--r-- | py/runtime.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/py/runtime.h b/py/runtime.h index e09162433..bead02831 100644 --- a/py/runtime.h +++ b/py/runtime.h @@ -101,6 +101,7 @@ void mp_unpack_sequence(mp_obj_t seq, mp_uint_t num, mp_obj_t *items); void mp_unpack_ex(mp_obj_t seq, mp_uint_t num, mp_obj_t *items); mp_obj_t mp_store_map(mp_obj_t map, mp_obj_t key, mp_obj_t value); mp_obj_t mp_load_attr(mp_obj_t base, qstr attr); +void mp_convert_member_lookup(mp_obj_t obj, const mp_obj_type_t *type, mp_obj_t member, mp_obj_t *dest); void mp_load_method(mp_obj_t base, qstr attr, mp_obj_t *dest); void mp_load_method_maybe(mp_obj_t base, qstr attr, mp_obj_t *dest); void mp_store_attr(mp_obj_t base, qstr attr, mp_obj_t val); |