summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--py/objtype.c2
-rw-r--r--py/objtype.h3
-rw-r--r--py/vm.c4
3 files changed, 3 insertions, 6 deletions
diff --git a/py/objtype.c b/py/objtype.c
index 77810ce70..d7d0ed7ff 100644
--- a/py/objtype.c
+++ b/py/objtype.c
@@ -764,7 +764,7 @@ STATIC bool mp_obj_instance_store_attr(mp_obj_t self_in, qstr attr, mp_obj_t val
}
}
-void mp_obj_instance_attr(mp_obj_t self_in, qstr attr, mp_obj_t *dest) {
+STATIC void mp_obj_instance_attr(mp_obj_t self_in, qstr attr, mp_obj_t *dest) {
if (dest[0] == MP_OBJ_NULL) {
mp_obj_instance_load_attr(self_in, attr, dest);
} else {
diff --git a/py/objtype.h b/py/objtype.h
index 1f4313084..3fc8c6e1b 100644
--- a/py/objtype.h
+++ b/py/objtype.h
@@ -42,9 +42,6 @@ typedef struct _mp_obj_instance_t {
mp_obj_instance_t *mp_obj_new_instance(const mp_obj_type_t *cls, const mp_obj_type_t **native_base);
#endif
-// 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);
mp_obj_t mp_obj_instance_call(mp_obj_t self_in, size_t n_args, size_t n_kw, const mp_obj_t *args);
diff --git a/py/vm.c b/py/vm.c
index d24a024d5..498ecb491 100644
--- a/py/vm.c
+++ b/py/vm.c
@@ -336,7 +336,7 @@ dispatch_loop:
MARK_EXC_IP_SELECTIVE();
DECODE_QSTR;
mp_obj_t top = TOP();
- if (mp_obj_get_type(top)->attr == mp_obj_instance_attr) {
+ if (mp_obj_is_instance_type(mp_obj_get_type(top))) {
mp_obj_instance_t *self = MP_OBJ_TO_PTR(top);
mp_uint_t x = *ip;
mp_obj_t key = MP_OBJ_NEW_QSTR(qst);
@@ -434,7 +434,7 @@ dispatch_loop:
MARK_EXC_IP_SELECTIVE();
DECODE_QSTR;
mp_obj_t top = TOP();
- if (mp_obj_get_type(top)->attr == mp_obj_instance_attr && sp[-1] != MP_OBJ_NULL) {
+ if (mp_obj_is_instance_type(mp_obj_get_type(top)) && sp[-1] != MP_OBJ_NULL) {
mp_obj_instance_t *self = MP_OBJ_TO_PTR(top);
mp_uint_t x = *ip;
mp_obj_t key = MP_OBJ_NEW_QSTR(qst);