mirror of
https://github.com/micropython/micropython.git
synced 2025-12-16 09:50:15 +01:00
py/emitnative: Put None/False/True in global native const table.
So these constant objects can be loaded by dereferencing the REG_FUN_TABLE pointer instead of loading immediate values. This reduces the size of generated native code (when such constants are used), and means that pointers to these constants are no longer stored in the assembly code.
This commit is contained in:
@@ -174,7 +174,10 @@ STATIC bool mp_native_yield_from(mp_obj_t gen, mp_obj_t send_value, mp_obj_t *re
|
||||
}
|
||||
|
||||
// these must correspond to the respective enum in runtime0.h
|
||||
void *const mp_fun_table[MP_F_NUMBER_OF] = {
|
||||
const void *const mp_fun_table[MP_F_NUMBER_OF] = {
|
||||
&mp_const_none_obj,
|
||||
&mp_const_false_obj,
|
||||
&mp_const_true_obj,
|
||||
mp_convert_obj_to_native,
|
||||
mp_convert_native_to_obj,
|
||||
mp_native_swap_globals,
|
||||
|
||||
Reference in New Issue
Block a user