py: Remove unnecessary id_flags argument from emitter's load_fast.
Saves 24 bytes in bare-arm.
diff --git a/py/compile.c b/py/compile.c
index f554854..7d94412 100644
--- a/py/compile.c
+++ b/py/compile.c
@@ -981,7 +981,7 @@
EMIT_ARG(load_closure, id->qst, id->local_num);
#else
// in Micro Python we load closures using LOAD_FAST
- EMIT_ARG(load_fast, id->qst, id->flags, id->local_num);
+ EMIT_ARG(load_fast, id->qst, id->local_num);
#endif
nfree += 1;
}
@@ -2487,7 +2487,7 @@
for (int i = 0; i < comp->scope_cur->id_info_len; i++) {
if (comp->scope_cur->id_info[i].flags & ID_FLAG_IS_PARAM) {
// first argument found; load it and call super
- EMIT_ARG(load_fast, MP_QSTR_, comp->scope_cur->id_info[i].flags, comp->scope_cur->id_info[i].local_num);
+ EMIT_ARG(load_fast, MP_QSTR_, comp->scope_cur->id_info[i].local_num);
EMIT_ARG(call_function, 2, 0, 0);
return;
}
@@ -3384,7 +3384,7 @@
#if MICROPY_EMIT_CPYTHON
EMIT_ARG(load_closure, MP_QSTR___class__, 0); // XXX check this is the correct local num
#else
- EMIT_ARG(load_fast, MP_QSTR___class__, id->flags, id->local_num);
+ EMIT_ARG(load_fast, MP_QSTR___class__, id->local_num);
#endif
}
EMIT(return_value);
diff --git a/py/emit.h b/py/emit.h
index 06a4201..2ca3d04 100644
--- a/py/emit.h
+++ b/py/emit.h
@@ -82,7 +82,7 @@
void (*load_const_str)(emit_t *emit, qstr qst, bool bytes);
void (*load_const_obj)(emit_t *emit, void *obj);
void (*load_null)(emit_t *emit);
- void (*load_fast)(emit_t *emit, qstr qst, mp_uint_t id_flags, mp_uint_t local_num);
+ void (*load_fast)(emit_t *emit, qstr qst, mp_uint_t local_num);
void (*load_deref)(emit_t *emit, qstr qst, mp_uint_t local_num);
void (*load_name)(emit_t *emit, qstr qst);
void (*load_global)(emit_t *emit, qstr qst);
diff --git a/py/emitbc.c b/py/emitbc.c
index 436fdf1..6be8f46 100644
--- a/py/emitbc.c
+++ b/py/emitbc.c
@@ -498,7 +498,7 @@
emit_write_bytecode_byte(emit, MP_BC_LOAD_NULL);
};
-STATIC void emit_bc_load_fast(emit_t *emit, qstr qst, mp_uint_t id_flags, mp_uint_t local_num) {
+STATIC void emit_bc_load_fast(emit_t *emit, qstr qst, mp_uint_t local_num) {
assert(local_num >= 0);
emit_bc_pre(emit, 1);
if (local_num <= 15) {
diff --git a/py/emitcommon.c b/py/emitcommon.c
index 4d90983..8011c0f 100644
--- a/py/emitcommon.c
+++ b/py/emitcommon.c
@@ -44,7 +44,7 @@
} else if (id->kind == ID_INFO_KIND_GLOBAL_EXPLICIT) {
EMIT(load_global, qst);
} else if (id->kind == ID_INFO_KIND_LOCAL) {
- EMIT(load_fast, qst, id->flags, id->local_num);
+ EMIT(load_fast, qst, id->local_num);
} else if (id->kind == ID_INFO_KIND_CELL || id->kind == ID_INFO_KIND_FREE) {
EMIT(load_deref, qst, id->local_num);
} else {
diff --git a/py/emitcpy.c b/py/emitcpy.c
index c54345c..924a556 100644
--- a/py/emitcpy.c
+++ b/py/emitcpy.c
@@ -245,7 +245,7 @@
assert(0);
}
-STATIC void emit_cpy_load_fast(emit_t *emit, qstr qst, mp_uint_t id_flags, mp_uint_t local_num) {
+STATIC void emit_cpy_load_fast(emit_t *emit, qstr qst, mp_uint_t local_num) {
emit_pre(emit, 1, 3);
if (emit->pass == MP_PASS_EMIT) {
printf("LOAD_FAST " UINT_FMT " %s\n", local_num, qstr_str(qst));
diff --git a/py/emitnative.c b/py/emitnative.c
index c7cbbf4..a8e547f 100644
--- a/py/emitnative.c
+++ b/py/emitnative.c
@@ -1184,8 +1184,8 @@
emit_post_push_imm(emit, VTYPE_PYOBJ, 0);
}
-STATIC void emit_native_load_fast(emit_t *emit, qstr qst, mp_uint_t id_flags, mp_uint_t local_num) {
- DEBUG_printf("load_fast(%s, " UINT_FMT ", " UINT_FMT ")\n", qstr_str(qst), id_flags, local_num);
+STATIC void emit_native_load_fast(emit_t *emit, qstr qst, mp_uint_t local_num) {
+ DEBUG_printf("load_fast(%s, " UINT_FMT ")\n", qstr_str(qst), local_num);
vtype_kind_t vtype = emit->local_vtype[local_num];
if (vtype == VTYPE_UNBOUND) {
printf("ViperTypeError: local %s used before type known\n", qstr_str(qst));