diff options
author | Damien George <damien.p.george@gmail.com> | 2018-05-19 00:11:04 +1000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2018-05-23 00:22:20 +1000 |
commit | 0a25fff9562e3051d85db9ca773f203620004742 (patch) | |
tree | 3b36f17d20598afc44bf24bf26afb7de7fc23df3 /py/compile.c | |
parent | 400273a799581e5eb86538d8c88fb872705475ab (diff) | |
download | micropython-0a25fff9562e3051d85db9ca773f203620004742.tar.gz micropython-0a25fff9562e3051d85db9ca773f203620004742.zip |
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
Diffstat (limited to 'py/compile.c')
-rw-r--r-- | py/compile.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/py/compile.c b/py/compile.c index c2dd914f03..4d985a07fc 100644 --- a/py/compile.c +++ b/py/compile.c @@ -65,7 +65,7 @@ typedef enum { // we need a method table to do the lookup for the emitter functions #define EMIT(fun) (comp->emit_method_table->fun(comp->emit)) #define EMIT_ARG(fun, ...) (comp->emit_method_table->fun(comp->emit, __VA_ARGS__)) -#define EMIT_LOAD_FAST(qst, local_num) (comp->emit_method_table->load_id.fast(comp->emit, qst, local_num)) +#define EMIT_LOAD_FAST(qst, local_num) (comp->emit_method_table->load_id.local(comp->emit, qst, local_num, MP_EMIT_IDOP_LOCAL_FAST)) #define EMIT_LOAD_GLOBAL(qst) (comp->emit_method_table->load_id.global(comp->emit, qst)) #else @@ -73,7 +73,7 @@ typedef enum { // if we only have the bytecode emitter enabled then we can do a direct call to the functions #define EMIT(fun) (mp_emit_bc_##fun(comp->emit)) #define EMIT_ARG(fun, ...) (mp_emit_bc_##fun(comp->emit, __VA_ARGS__)) -#define EMIT_LOAD_FAST(qst, local_num) (mp_emit_bc_load_fast(comp->emit, qst, local_num)) +#define EMIT_LOAD_FAST(qst, local_num) (mp_emit_bc_load_local(comp->emit, qst, local_num, MP_EMIT_IDOP_LOCAL_FAST)) #define EMIT_LOAD_GLOBAL(qst) (mp_emit_bc_load_global(comp->emit, qst)) #endif |