mirror of
https://github.com/micropython/micropython.git
synced 2026-01-28 23:00:22 +01:00
py/persistentcode: Support saving functions with children.
This adds support to `mp_raw_code_save_fun_to_bytes()` so that it can handle saving functions that have children. It does this by inspecting the MP_BC_MAKE_FUNCTION/etc opcodes to work out how many children there are, and creating a tree of simplified raw code information. Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
@@ -139,7 +139,7 @@ void mp_raw_code_load_file(qstr filename, mp_compiled_module_t *ctx);
|
||||
|
||||
void mp_raw_code_save(mp_compiled_module_t *cm, mp_print_t *print);
|
||||
void mp_raw_code_save_file(mp_compiled_module_t *cm, qstr filename);
|
||||
mp_obj_t mp_raw_code_save_fun_to_bytes(const mp_module_constants_t *consts, const uint8_t *bytecode);
|
||||
mp_obj_t mp_raw_code_save_fun_to_bytes(const mp_module_constants_t *consts, mp_proto_fun_t proto_fun);
|
||||
|
||||
void mp_native_relocate(void *reloc, uint8_t *text, uintptr_t reloc_text);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user