diff options
author | Damien George <damien.p.george@gmail.com> | 2014-04-09 12:43:17 +0100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2014-04-09 12:43:17 +0100 |
commit | 922ddd64155b3893f71cbf0b0c71a4cffbe4b1c8 (patch) | |
tree | 290159fd07150a2365c7861a3607484aed6fa549 /py/emitbc.c | |
parent | 78035b995ff7bd518cc1291aa70c966b53510fd9 (diff) |
py, compile: Combine have_star_arg, have_dbl_star_arg into star_flags.
Small reduction in ROM, heap and stack usage.
Diffstat (limited to 'py/emitbc.c')
-rw-r--r-- | py/emitbc.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/py/emitbc.c b/py/emitbc.c index b2edc25e0..f16ffced1 100644 --- a/py/emitbc.c +++ b/py/emitbc.c @@ -767,13 +767,13 @@ STATIC void emit_bc_make_closure(emit_t *emit, scope_t *scope, uint n_pos_defaul } } -STATIC void emit_bc_call_function_method_helper(emit_t *emit, int stack_adj, uint bytecode_base, int n_positional, int n_keyword, bool have_star_arg, bool have_dbl_star_arg) { - if (have_star_arg || have_dbl_star_arg) { - if (!have_star_arg) { +STATIC void emit_bc_call_function_method_helper(emit_t *emit, int stack_adj, uint bytecode_base, int n_positional, int n_keyword, uint star_flags) { + if (star_flags) { + if (!(star_flags & MP_EMIT_STAR_FLAG_SINGLE)) { // load dummy entry for non-existent pos_seq emit_bc_load_null(emit); emit_bc_rot_two(emit); - } else if (!have_dbl_star_arg) { + } else if (!(star_flags & MP_EMIT_STAR_FLAG_DOUBLE)) { // load dummy entry for non-existent kw_dict emit_bc_load_null(emit); } @@ -785,12 +785,12 @@ STATIC void emit_bc_call_function_method_helper(emit_t *emit, int stack_adj, uin } } -STATIC void emit_bc_call_function(emit_t *emit, int n_positional, int n_keyword, bool have_star_arg, bool have_dbl_star_arg) { - emit_bc_call_function_method_helper(emit, 0, MP_BC_CALL_FUNCTION, n_positional, n_keyword, have_star_arg, have_dbl_star_arg); +STATIC void emit_bc_call_function(emit_t *emit, int n_positional, int n_keyword, uint star_flags) { + emit_bc_call_function_method_helper(emit, 0, MP_BC_CALL_FUNCTION, n_positional, n_keyword, star_flags); } -STATIC void emit_bc_call_method(emit_t *emit, int n_positional, int n_keyword, bool have_star_arg, bool have_dbl_star_arg) { - emit_bc_call_function_method_helper(emit, -1, MP_BC_CALL_METHOD, n_positional, n_keyword, have_star_arg, have_dbl_star_arg); +STATIC void emit_bc_call_method(emit_t *emit, int n_positional, int n_keyword, uint star_flags) { + emit_bc_call_function_method_helper(emit, -1, MP_BC_CALL_METHOD, n_positional, n_keyword, star_flags); } STATIC void emit_bc_return_value(emit_t *emit) { |