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:
Damien George
2018-05-19 00:11:04 +10:00
parent 400273a799
commit 0a25fff956
5 changed files with 61 additions and 68 deletions

View File

@@ -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);
}
}