blob: 8207b161a2022a6b46a3b039c32735f43bcd03e9 [file] [log] [blame]
Paul Sokolovskyf26a3072014-04-17 05:44:51 +03001typedef 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 George2827d622014-04-27 15:50:52 +01004 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 Sokolovskyf26a3072014-04-17 05:44:51 +03007 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;