summaryrefslogtreecommitdiff
path: root/py/showbc.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2016-01-09 23:59:52 +0000
committerDamien George <damien.p.george@gmail.com>2017-02-16 18:38:06 +1100
commitf4df3aaa72a0460614b1ab8b7b8a7927a1165e31 (patch)
tree2c1ee2988630c79a4e79e40a15173af588d8fd2c /py/showbc.c
parentae8d86758631e62466a55d179897d2111c3cb1c1 (diff)
py: Allow bytecode/native to put iter_buf on stack for simple for loops.
So that the "for x in it: ..." statement can now work without using the heap (so long as the iterator argument fits in an iter_buf structure).
Diffstat (limited to 'py/showbc.c')
-rw-r--r--py/showbc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/py/showbc.c b/py/showbc.c
index 9d20decdc..b52905f67 100644
--- a/py/showbc.c
+++ b/py/showbc.c
@@ -387,6 +387,10 @@ const byte *mp_bytecode_print_str(const byte *ip) {
printf("GET_ITER");
break;
+ case MP_BC_GET_ITER_STACK:
+ printf("GET_ITER_STACK");
+ break;
+
case MP_BC_FOR_ITER:
DECODE_ULABEL; // the jump offset if iteration finishes; for labels are always forward
printf("FOR_ITER " UINT_FMT, (mp_uint_t)(ip + unum - mp_showbc_code_start));