diff options
author | Damien George <damien.p.george@gmail.com> | 2015-04-01 14:10:50 +0000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2015-04-11 16:54:37 +0100 |
commit | b1bbe966c408901ae64ea8c8b468694c47d05b1a (patch) | |
tree | 46025c34daf602aeb1e8def41d1e01f0750b6d13 /py/objtype.h | |
parent | d07ccc5a394d0252ffbc227509ed2134465c215a (diff) |
py: Combine load_attr and store_attr type methods into one (attr).
This simplifies the API for objects and reduces code size (by around 400
bytes on Thumb2, and around 2k on x86). Performance impact was measured
with Pystone score, but change was barely noticeable.
Diffstat (limited to 'py/objtype.h')
-rw-r--r-- | py/objtype.h | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/py/objtype.h b/py/objtype.h index 176e802d2..de1909b1e 100644 --- a/py/objtype.h +++ b/py/objtype.h @@ -37,9 +37,8 @@ typedef struct _mp_obj_instance_t { // TODO maybe cache __getattr__ and __setattr__ for efficient lookup of them } mp_obj_instance_t; -// these need to be exposed for MICROPY_OPT_CACHE_MAP_LOOKUP_IN_BYTECODE to work -void mp_obj_instance_load_attr(mp_obj_t self_in, qstr attr, mp_obj_t *dest); -bool mp_obj_instance_store_attr(mp_obj_t self_in, qstr attr, mp_obj_t value); +// this needs to be exposed for MICROPY_OPT_CACHE_MAP_LOOKUP_IN_BYTECODE to work +void mp_obj_instance_attr(mp_obj_t self_in, qstr attr, mp_obj_t *dest); // these need to be exposed so mp_obj_is_callable can work correctly bool mp_obj_instance_is_callable(mp_obj_t self_in); |