diff options
author | Damien George <damien.p.george@gmail.com> | 2018-05-22 22:18:42 +1000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2018-05-23 00:23:36 +1000 |
commit | 436e0d4c54ab22050072d392f0822e555bcc70f1 (patch) | |
tree | 17a1accb1b578441b9068f3dd005b32d46b3dc68 /py/emitbc.c | |
parent | d97906ca9a0f1e0728cefb930d458bb8fba3bd17 (diff) |
py/emit: Merge build set/slice into existing build emit function.
Reduces code size by:
bare-arm: +0
minimal x86: +0
unix x64: -368
unix nanbox: -248
stm32: -128
cc3200: -48
esp8266: -184
esp32: -40
Diffstat (limited to 'py/emitbc.c')
-rw-r--r-- | py/emitbc.c | 22 |
1 files changed, 2 insertions, 20 deletions
diff --git a/py/emitbc.c b/py/emitbc.c index 6be9f900c..4c587c72e 100644 --- a/py/emitbc.c +++ b/py/emitbc.c @@ -800,6 +800,8 @@ void mp_emit_bc_build(emit_t *emit, mp_uint_t n_args, int kind) { MP_STATIC_ASSERT(MP_BC_BUILD_TUPLE + MP_EMIT_BUILD_TUPLE == MP_BC_BUILD_TUPLE); MP_STATIC_ASSERT(MP_BC_BUILD_TUPLE + MP_EMIT_BUILD_LIST == MP_BC_BUILD_LIST); MP_STATIC_ASSERT(MP_BC_BUILD_TUPLE + MP_EMIT_BUILD_MAP == MP_BC_BUILD_MAP); + MP_STATIC_ASSERT(MP_BC_BUILD_TUPLE + MP_EMIT_BUILD_SET == MP_BC_BUILD_SET); + MP_STATIC_ASSERT(MP_BC_BUILD_TUPLE + MP_EMIT_BUILD_SLICE == MP_BC_BUILD_SLICE); if (kind == MP_EMIT_BUILD_MAP) { emit_bc_pre(emit, 1); } else { @@ -813,20 +815,6 @@ void mp_emit_bc_store_map(emit_t *emit) { emit_write_bytecode_byte(emit, MP_BC_STORE_MAP); } -#if MICROPY_PY_BUILTINS_SET -void mp_emit_bc_build_set(emit_t *emit, mp_uint_t n_args) { - emit_bc_pre(emit, 1 - n_args); - emit_write_bytecode_byte_uint(emit, MP_BC_BUILD_SET, n_args); -} -#endif - -#if MICROPY_PY_BUILTINS_SLICE -void mp_emit_bc_build_slice(emit_t *emit, mp_uint_t n_args) { - emit_bc_pre(emit, 1 - n_args); - emit_write_bytecode_byte_uint(emit, MP_BC_BUILD_SLICE, n_args); -} -#endif - void mp_emit_bc_store_comp(emit_t *emit, scope_kind_t kind, mp_uint_t collection_stack_index) { int t; int n; @@ -979,12 +967,6 @@ const emit_method_table_t emit_bc_method_table = { mp_emit_bc_binary_op, mp_emit_bc_build, mp_emit_bc_store_map, - #if MICROPY_PY_BUILTINS_SET - mp_emit_bc_build_set, - #endif - #if MICROPY_PY_BUILTINS_SLICE - mp_emit_bc_build_slice, - #endif mp_emit_bc_store_comp, mp_emit_bc_unpack_sequence, mp_emit_bc_unpack_ex, |