summaryrefslogtreecommitdiff
path: root/py/emit.h
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/emit.h
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/emit.h')
-rw-r--r--py/emit.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/py/emit.h b/py/emit.h
index 7d00f11f9..6acae9e80 100644
--- a/py/emit.h
+++ b/py/emit.h
@@ -110,9 +110,9 @@ typedef struct _emit_method_table_t {
void (*setup_except)(emit_t *emit, mp_uint_t label);
void (*setup_finally)(emit_t *emit, mp_uint_t label);
void (*end_finally)(emit_t *emit);
- void (*get_iter)(emit_t *emit);
+ void (*get_iter)(emit_t *emit, bool use_stack);
void (*for_iter)(emit_t *emit, mp_uint_t label);
- void (*for_iter_end)(emit_t *emit);
+ void (*for_iter_end)(emit_t *emit, bool use_stack);
void (*pop_block)(emit_t *emit);
void (*pop_except)(emit_t *emit);
void (*unary_op)(emit_t *emit, mp_unary_op_t op);
@@ -228,9 +228,9 @@ void mp_emit_bc_with_cleanup(emit_t *emit, mp_uint_t label);
void mp_emit_bc_setup_except(emit_t *emit, mp_uint_t label);
void mp_emit_bc_setup_finally(emit_t *emit, mp_uint_t label);
void mp_emit_bc_end_finally(emit_t *emit);
-void mp_emit_bc_get_iter(emit_t *emit);
+void mp_emit_bc_get_iter(emit_t *emit, bool use_stack);
void mp_emit_bc_for_iter(emit_t *emit, mp_uint_t label);
-void mp_emit_bc_for_iter_end(emit_t *emit);
+void mp_emit_bc_for_iter_end(emit_t *emit, bool use_stack);
void mp_emit_bc_pop_block(emit_t *emit);
void mp_emit_bc_pop_except(emit_t *emit);
void mp_emit_bc_unary_op(emit_t *emit, mp_unary_op_t op);