diff options
author | Damien George <damien.p.george@gmail.com> | 2018-10-01 13:07:04 +1000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2018-10-01 13:31:11 +1000 |
commit | cc2bd63c57a72ec37d839965c6bb61cd1fa202fc (patch) | |
tree | 44acc885421554921db85273aed4d1b1de4ecbf8 /py/emitnx86.c | |
parent | 8fec6f543411dc16b42e9850af0cc3a1097162a7 (diff) | |
download | micropython-cc2bd63c57a72ec37d839965c6bb61cd1fa202fc.tar.gz micropython-cc2bd63c57a72ec37d839965c6bb61cd1fa202fc.zip |
py/emitnative: Implement yield and yield-from in native emitter.
This commit adds first class support for yield and yield-from in the native
emitter, including send and throw support, and yields enclosed in exception
handlers (which requires pulling down the NLR stack before yielding, then
rebuilding it when resuming).
This has been fully tested and is working on unix x86 and x86-64, and
stm32. Also basic tests have been done with the esp8266 port. Performance
of existing native code is unchanged.
Diffstat (limited to 'py/emitnx86.c')
-rw-r--r-- | py/emitnx86.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/py/emitnx86.c b/py/emitnx86.c index 597a0fd4a8..7c96c3b82b 100644 --- a/py/emitnx86.c +++ b/py/emitnx86.c @@ -66,6 +66,7 @@ STATIC byte mp_f_n_args[MP_F_NUMBER_OF] = { [MP_F_SETUP_CODE_STATE] = 4, [MP_F_SMALL_INT_FLOOR_DIVIDE] = 2, [MP_F_SMALL_INT_MODULO] = 2, + [MP_F_NATIVE_YIELD_FROM] = 3, }; #define N_X86 (1) |