summaryrefslogtreecommitdiff
path: root/py/emit.h
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2014-04-20 17:50:40 +0100
committerDamien George <damien.p.george@gmail.com>2014-04-20 17:50:40 +0100
commit3558f62fb5c21a19a518c2ba75860f0b5963219e (patch)
treecf8626118be5d0169ec0f1cd0482563595704c4e /py/emit.h
parentbc5f0c19775e23b4f0621d52de47fb9438a78ba2 (diff)
py: Making closures now passes pointer to stack, not a tuple for vars.
Closed over variables are now passed on the stack, instead of creating a tuple and passing that. This way memory for the closed over variables can be allocated within the closure object itself. See issue #510 for background.
Diffstat (limited to 'py/emit.h')
-rw-r--r--py/emit.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/py/emit.h b/py/emit.h
index 74cc5baa4..64c2c8548 100644
--- a/py/emit.h
+++ b/py/emit.h
@@ -42,6 +42,7 @@ typedef struct _emit_method_table_t {
void (*load_const_id)(emit_t *emit, qstr qstr);
void (*load_const_str)(emit_t *emit, qstr qstr, bool bytes);
void (*load_const_verbatim_str)(emit_t *emit, const char *str); // only needed for emitcpy
+ void (*load_null)(emit_t *emit);
void (*load_fast)(emit_t *emit, qstr qstr, uint id_flags, int local_num);
void (*load_deref)(emit_t *emit, qstr qstr, int local_num);
void (*load_closure)(emit_t *emit, qstr qstr, int local_num); // only needed for emitcpy
@@ -100,7 +101,7 @@ typedef struct _emit_method_table_t {
void (*unpack_sequence)(emit_t *emit, int n_args);
void (*unpack_ex)(emit_t *emit, int n_left, int n_right);
void (*make_function)(emit_t *emit, scope_t *scope, uint n_pos_defaults, uint n_kw_defaults);
- void (*make_closure)(emit_t *emit, scope_t *scope, uint n_pos_defaults, uint n_kw_defaults);
+ void (*make_closure)(emit_t *emit, scope_t *scope, uint n_closed_over, uint n_pos_defaults, uint n_kw_defaults);
void (*call_function)(emit_t *emit, int n_positional, int n_keyword, uint star_flags);
void (*call_method)(emit_t *emit, int n_positional, int n_keyword, uint star_flags);
void (*return_value)(emit_t *emit);