diff options
author | Damien George <damien.p.george@gmail.com> | 2018-05-19 00:30:42 +1000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2018-05-23 00:22:35 +1000 |
commit | e686c940525c5b87d02e3dd7bfcdec23cfa996dd (patch) | |
tree | 53782e9b79e3a26eb4ec2c5cd1348b0cea351e25 /py/emitnative.c | |
parent | 0a25fff9562e3051d85db9ca773f203620004742 (diff) | |
download | micropython-e686c940525c5b87d02e3dd7bfcdec23cfa996dd.tar.gz micropython-e686c940525c5b87d02e3dd7bfcdec23cfa996dd.zip |
py/emit: Combine yield value and yield-from emit funcs into one.
Reduces code size by:
bare-arm: -24
minimal x86: -72
unix x64: -200
unix nanbox: -72
stm32: -52
cc3200: -32
esp8266: -84
esp32: -24
Diffstat (limited to 'py/emitnative.c')
-rw-r--r-- | py/emitnative.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/py/emitnative.c b/py/emitnative.c index 9e16ef4bd9..26bcebfcbb 100644 --- a/py/emitnative.c +++ b/py/emitnative.c @@ -2170,16 +2170,12 @@ STATIC void emit_native_raise_varargs(emit_t *emit, mp_uint_t n_args) { emit_call(emit, MP_F_NATIVE_RAISE); } -STATIC void emit_native_yield_value(emit_t *emit) { +STATIC void emit_native_yield(emit_t *emit, int kind) { // not supported (for now) (void)emit; + (void)kind; mp_raise_NotImplementedError("native yield"); } -STATIC void emit_native_yield_from(emit_t *emit) { - // not supported (for now) - (void)emit; - mp_raise_NotImplementedError("native yield from"); -} STATIC void emit_native_start_except_handler(emit_t *emit) { // This instruction follows an nlr_pop, so the stack counter is back to zero, when really @@ -2278,8 +2274,7 @@ const emit_method_table_t EXPORT_FUN(method_table) = { emit_native_call_method, emit_native_return_value, emit_native_raise_varargs, - emit_native_yield_value, - emit_native_yield_from, + emit_native_yield, emit_native_start_except_handler, emit_native_end_except_handler, |