Paul Sokolovsky | f26a307 | 2014-04-17 05:44:51 +0300 | [diff] [blame] | 1 | typedef struct _mp_obj_fun_bc_t { |
| 2 | mp_obj_base_t base; |
| 3 | mp_obj_dict_t *globals; // the context within which this function was defined |
Damien George | 2827d62 | 2014-04-27 15:50:52 +0100 | [diff] [blame] | 4 | machine_uint_t n_pos_args : 16; // number of arguments this function takes |
| 5 | machine_uint_t n_kwonly_args : 16; // number of arguments this function takes |
| 6 | machine_uint_t n_def_args : 16; // number of default arguments |
Paul Sokolovsky | f26a307 | 2014-04-17 05:44:51 +0300 | [diff] [blame] | 7 | machine_uint_t takes_var_args : 1; // set if this function takes variable args |
| 8 | machine_uint_t takes_kw_args : 1; // set if this function takes keyword args |
| 9 | const byte *bytecode; // bytecode for the function |
| 10 | qstr *args; // argument names (needed to resolve positional args passed as keywords) |
| 11 | // values of default args (if any), plus a slot at the end for var args and/or kw args (if it takes them) |
| 12 | mp_obj_t extra_args[]; |
| 13 | } mp_obj_fun_bc_t; |