mirror of
https://github.com/micropython/micropython.git
synced 2026-01-05 03:30:14 +01:00
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).
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user