summaryrefslogtreecommitdiff
path: root/py/emitnative.c
diff options
context:
space:
mode:
authorDamien George <damien@micropython.org>2024-02-09 17:41:48 +1100
committerDamien George <damien@micropython.org>2024-02-16 14:17:01 +1100
commite2ff00e81113d7a3f32f860652017644b5d68bf1 (patch)
tree061a1d917a23be78706c3a4cfd6a46b1307a4ebf /py/emitnative.c
parent5e3006f1172d0eabbbefeb3268dfb942ec7cf9cd (diff)
py/emitglue: Introduce mp_proto_fun_t as a more general mp_raw_code_t.
Allows bytecode itself to be used instead of an mp_raw_code_t in the simple and common cases of a bytecode function without any children. This can be used to further reduce frozen code size, and has the potential to optimise other areas like importing. Signed-off-by: Damien George <damien@micropython.org>
Diffstat (limited to 'py/emitnative.c')
-rw-r--r--py/emitnative.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/py/emitnative.c b/py/emitnative.c
index e6357b3f9..5f347799e 100644
--- a/py/emitnative.c
+++ b/py/emitnative.c
@@ -2657,7 +2657,7 @@ STATIC void emit_native_make_function(emit_t *emit, scope_t *scope, mp_uint_t n_
need_reg_all(emit);
}
emit_load_reg_with_child(emit, REG_ARG_1, scope->raw_code);
- ASM_CALL_IND(emit->as, MP_F_MAKE_FUNCTION_FROM_RAW_CODE);
+ ASM_CALL_IND(emit->as, MP_F_MAKE_FUNCTION_FROM_PROTO_FUN);
emit_post_push_reg(emit, VTYPE_PYOBJ, REG_RET);
}
@@ -2675,7 +2675,7 @@ STATIC void emit_native_make_closure(emit_t *emit, scope_t *scope, mp_uint_t n_c
need_reg_all(emit);
}
emit_load_reg_with_child(emit, REG_ARG_1, scope->raw_code);
- ASM_CALL_IND(emit->as, MP_F_MAKE_FUNCTION_FROM_RAW_CODE);
+ ASM_CALL_IND(emit->as, MP_F_MAKE_FUNCTION_FROM_PROTO_FUN);
// make closure
#if REG_ARG_1 != REG_RET