mirror of
https://github.com/micropython/micropython.git
synced 2026-01-04 19:20:22 +01:00
py/emit: Combine fast and deref into one function for load/store/delete.
Reduces code size by:
bare-arm: -16
minimal x86: -208
unix x64: -408
unix nanbox: -248
stm32: -12
cc3200: -24
esp8266: -96
esp32: -44
This commit is contained in:
@@ -67,10 +67,10 @@ void mp_emit_common_id_op(emit_t *emit, const mp_emit_method_table_id_ops_t *emi
|
||||
} else if (id->kind == ID_INFO_KIND_GLOBAL_EXPLICIT) {
|
||||
emit_method_table->global(emit, qst);
|
||||
} else if (id->kind == ID_INFO_KIND_LOCAL) {
|
||||
emit_method_table->fast(emit, qst, id->local_num);
|
||||
emit_method_table->local(emit, qst, id->local_num, MP_EMIT_IDOP_LOCAL_FAST);
|
||||
} else {
|
||||
assert(id->kind == ID_INFO_KIND_CELL || id->kind == ID_INFO_KIND_FREE);
|
||||
emit_method_table->deref(emit, qst, id->local_num);
|
||||
emit_method_table->local(emit, qst, id->local_num, MP_EMIT_IDOP_LOCAL_DEREF);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user