summaryrefslogtreecommitdiff
path: root/py/compile.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2018-05-22 21:16:30 +1000
committerDamien George <damien.p.george@gmail.com>2018-05-23 00:22:47 +1000
commitd298013939b38fb05961cf05c03ac3aef6a4f00c (patch)
treeb57995f38fb62ea8cb76e65640490ee61195261f /py/compile.c
parent26b5754092134b53e03eed8c5e6c580d28a2a829 (diff)
py/emit: Combine name and global into one func for load/store/delete.
Reduces code size by: bare-arm: -56 minimal x86: -300 unix x64: -576 unix nanbox: -300 stm32: -164 cc3200: -56 esp8266: -236 esp32: -76
Diffstat (limited to 'py/compile.c')
-rw-r--r--py/compile.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/py/compile.c b/py/compile.c
index 6f0be8fa8..3d443c6d8 100644
--- a/py/compile.c
+++ b/py/compile.c
@@ -66,7 +66,7 @@ typedef enum {
#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.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))
+#define EMIT_LOAD_GLOBAL(qst) (comp->emit_method_table->load_id.global(comp->emit, qst, MP_EMIT_IDOP_GLOBAL_GLOBAL))
#else
@@ -74,7 +74,7 @@ typedef enum {
#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_local(comp->emit, qst, local_num, MP_EMIT_IDOP_LOCAL_FAST))
-#define EMIT_LOAD_GLOBAL(qst) (mp_emit_bc_load_global(comp->emit, qst))
+#define EMIT_LOAD_GLOBAL(qst) (mp_emit_bc_load_global(comp->emit, qst, MP_EMIT_IDOP_GLOBAL_GLOBAL))
#endif