Skip to content

Commit 3a3db4d

Browse files
committed
py: Put all bytecode state (arg count, etc) in bytecode.
1 parent 9b7f583 commit 3a3db4d

File tree

14 files changed

+95
-78
lines changed

14 files changed

+95
-78
lines changed

py/bc.c

Lines changed: 40 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131

3232
#include "py/nlr.h"
3333
#include "py/objfun.h"
34+
#include "py/runtime0.h"
3435
#include "py/bc.h"
3536

3637
#if 0 // print debugging info
@@ -100,6 +101,12 @@ void mp_setup_code_state(mp_code_state *code_state, mp_obj_t self_in, mp_uint_t
100101
code_state->prev = NULL;
101102
#endif
102103

104+
// get params
105+
mp_uint_t scope_flags = *code_state->ip++;
106+
mp_uint_t n_pos_args = *code_state->ip++;
107+
mp_uint_t n_kwonly_args = *code_state->ip++;
108+
mp_uint_t n_def_pos_args = *code_state->ip++;
109+
103110
// align ip
104111
code_state->ip = MP_ALIGN(code_state->ip, sizeof(mp_uint_t));
105112

@@ -112,33 +119,33 @@ void mp_setup_code_state(mp_code_state *code_state, mp_obj_t self_in, mp_uint_t
112119
const mp_obj_t *kwargs = args + n_args;
113120

114121
// var_pos_kw_args points to the stack where the var-args tuple, and var-kw dict, should go (if they are needed)
115-
mp_obj_t *var_pos_kw_args = &code_state->state[n_state - 1 - self->n_pos_args - self->n_kwonly_args];
122+
mp_obj_t *var_pos_kw_args = &code_state->state[n_state - 1 - n_pos_args - n_kwonly_args];
116123

117124
// check positional arguments
118125

119-
if (n_args > self->n_pos_args) {
126+
if (n_args > n_pos_args) {
120127
// given more than enough arguments
121-
if (!self->takes_var_args) {
122-
fun_pos_args_mismatch(self, self->n_pos_args, n_args);
128+
if ((scope_flags & MP_SCOPE_FLAG_VARARGS) == 0) {
129+
fun_pos_args_mismatch(self, n_pos_args, n_args);
123130
}
124131
// put extra arguments in varargs tuple
125-
*var_pos_kw_args-- = mp_obj_new_tuple(n_args - self->n_pos_args, args + self->n_pos_args);
126-
n_args = self->n_pos_args;
132+
*var_pos_kw_args-- = mp_obj_new_tuple(n_args - n_pos_args, args + n_pos_args);
133+
n_args = n_pos_args;
127134
} else {
128-
if (self->takes_var_args) {
135+
if ((scope_flags & MP_SCOPE_FLAG_VARARGS) != 0) {
129136
DEBUG_printf("passing empty tuple as *args\n");
130137
*var_pos_kw_args-- = mp_const_empty_tuple;
131138
}
132139
// Apply processing and check below only if we don't have kwargs,
133140
// otherwise, kw handling code below has own extensive checks.
134-
if (n_kw == 0 && !self->has_def_kw_args) {
135-
if (n_args >= (mp_uint_t)(self->n_pos_args - self->n_def_args)) {
141+
if (n_kw == 0 && (scope_flags & MP_SCOPE_FLAG_DEFKWARGS) == 0) {
142+
if (n_args >= (mp_uint_t)(n_pos_args - n_def_pos_args)) {
136143
// given enough arguments, but may need to use some default arguments
137-
for (mp_uint_t i = n_args; i < self->n_pos_args; i++) {
138-
code_state->state[n_state - 1 - i] = self->extra_args[i - (self->n_pos_args - self->n_def_args)];
144+
for (mp_uint_t i = n_args; i < n_pos_args; i++) {
145+
code_state->state[n_state - 1 - i] = self->extra_args[i - (n_pos_args - n_def_pos_args)];
139146
}
140147
} else {
141-
fun_pos_args_mismatch(self, self->n_pos_args - self->n_def_args, n_args);
148+
fun_pos_args_mismatch(self, n_pos_args - n_def_pos_args, n_args);
142149
}
143150
}
144151
}
@@ -150,12 +157,12 @@ void mp_setup_code_state(mp_code_state *code_state, mp_obj_t self_in, mp_uint_t
150157

151158
// check keyword arguments
152159

153-
if (n_kw != 0 || self->has_def_kw_args) {
160+
if (n_kw != 0 || (scope_flags & MP_SCOPE_FLAG_DEFKWARGS) != 0) {
154161
DEBUG_printf("Initial args: ");
155-
dump_args(code_state->state + n_state - self->n_pos_args - self->n_kwonly_args, self->n_pos_args + self->n_kwonly_args);
162+
dump_args(code_state->state + n_state - n_pos_args - n_kwonly_args, n_pos_args + n_kwonly_args);
156163

157164
mp_obj_t dict = MP_OBJ_NULL;
158-
if (self->takes_kw_args) {
165+
if ((scope_flags & MP_SCOPE_FLAG_VARKEYWORDS) != 0) {
159166
dict = mp_obj_new_dict(n_kw); // TODO: better go conservative with 0?
160167
*var_pos_kw_args = dict;
161168
}
@@ -165,7 +172,7 @@ void mp_setup_code_state(mp_code_state *code_state, mp_obj_t self_in, mp_uint_t
165172

166173
for (mp_uint_t i = 0; i < n_kw; i++) {
167174
mp_obj_t wanted_arg_name = kwargs[2 * i];
168-
for (mp_uint_t j = 0; j < self->n_pos_args + self->n_kwonly_args; j++) {
175+
for (mp_uint_t j = 0; j < n_pos_args + n_kwonly_args; j++) {
169176
if (wanted_arg_name == arg_names[j]) {
170177
if (code_state->state[n_state - 1 - j] != MP_OBJ_NULL) {
171178
nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_TypeError,
@@ -176,27 +183,27 @@ void mp_setup_code_state(mp_code_state *code_state, mp_obj_t self_in, mp_uint_t
176183
}
177184
}
178185
// Didn't find name match with positional args
179-
if (!self->takes_kw_args) {
186+
if ((scope_flags & MP_SCOPE_FLAG_VARKEYWORDS) == 0) {
180187
nlr_raise(mp_obj_new_exception_msg(&mp_type_TypeError, "function does not take keyword arguments"));
181188
}
182189
mp_obj_dict_store(dict, kwargs[2 * i], kwargs[2 * i + 1]);
183190
continue2:;
184191
}
185192

186193
DEBUG_printf("Args with kws flattened: ");
187-
dump_args(code_state->state + n_state - self->n_pos_args - self->n_kwonly_args, self->n_pos_args + self->n_kwonly_args);
194+
dump_args(code_state->state + n_state - n_pos_args - n_kwonly_args, n_pos_args + n_kwonly_args);
188195

189196
// fill in defaults for positional args
190-
mp_obj_t *d = &code_state->state[n_state - self->n_pos_args];
191-
mp_obj_t *s = &self->extra_args[self->n_def_args - 1];
192-
for (mp_uint_t i = self->n_def_args; i > 0; i--, d++, s--) {
197+
mp_obj_t *d = &code_state->state[n_state - n_pos_args];
198+
mp_obj_t *s = &self->extra_args[n_def_pos_args - 1];
199+
for (mp_uint_t i = n_def_pos_args; i > 0; i--, d++, s--) {
193200
if (*d == MP_OBJ_NULL) {
194201
*d = *s;
195202
}
196203
}
197204

198205
DEBUG_printf("Args after filling default positional: ");
199-
dump_args(code_state->state + n_state - self->n_pos_args - self->n_kwonly_args, self->n_pos_args + self->n_kwonly_args);
206+
dump_args(code_state->state + n_state - n_pos_args - n_kwonly_args, n_pos_args + n_kwonly_args);
200207

201208
// Check that all mandatory positional args are specified
202209
while (d < &code_state->state[n_state]) {
@@ -208,35 +215,35 @@ continue2:;
208215

209216
// Check that all mandatory keyword args are specified
210217
// Fill in default kw args if we have them
211-
for (mp_uint_t i = 0; i < self->n_kwonly_args; i++) {
212-
if (code_state->state[n_state - 1 - self->n_pos_args - i] == MP_OBJ_NULL) {
218+
for (mp_uint_t i = 0; i < n_kwonly_args; i++) {
219+
if (code_state->state[n_state - 1 - n_pos_args - i] == MP_OBJ_NULL) {
213220
mp_map_elem_t *elem = NULL;
214-
if (self->has_def_kw_args) {
215-
elem = mp_map_lookup(&((mp_obj_dict_t*)self->extra_args[self->n_def_args])->map, arg_names[self->n_pos_args + i], MP_MAP_LOOKUP);
221+
if ((scope_flags & MP_SCOPE_FLAG_DEFKWARGS) != 0) {
222+
elem = mp_map_lookup(&((mp_obj_dict_t*)self->extra_args[n_def_pos_args])->map, arg_names[n_pos_args + i], MP_MAP_LOOKUP);
216223
}
217224
if (elem != NULL) {
218-
code_state->state[n_state - 1 - self->n_pos_args - i] = elem->value;
225+
code_state->state[n_state - 1 - n_pos_args - i] = elem->value;
219226
} else {
220227
nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_TypeError,
221-
"function missing required keyword argument '%q'", MP_OBJ_QSTR_VALUE(arg_names[self->n_pos_args + i])));
228+
"function missing required keyword argument '%q'", MP_OBJ_QSTR_VALUE(arg_names[n_pos_args + i])));
222229
}
223230
}
224231
}
225232

226233
} else {
227234
// no keyword arguments given
228-
if (self->n_kwonly_args != 0) {
235+
if (n_kwonly_args != 0) {
229236
nlr_raise(mp_obj_new_exception_msg(&mp_type_TypeError,
230237
"function missing keyword-only argument"));
231238
}
232-
if (self->takes_kw_args) {
239+
if ((scope_flags & MP_SCOPE_FLAG_VARKEYWORDS) != 0) {
233240
*var_pos_kw_args = mp_obj_new_dict(0);
234241
}
235242
}
236243

237244
// get the ip and skip argument names
238245
const byte *ip = code_state->ip;
239-
ip += (self->n_pos_args + self->n_kwonly_args) * sizeof(mp_uint_t);
246+
ip += (n_pos_args + n_kwonly_args) * sizeof(mp_uint_t);
240247

241248
// store pointer to code_info and jump over it
242249
{
@@ -256,7 +263,7 @@ continue2:;
256263
// now that we skipped over the prelude, set the ip for the VM
257264
code_state->ip = ip;
258265

259-
DEBUG_printf("Calling: n_pos_args=%d, n_kwonly_args=%d\n", self->n_pos_args, self->n_kwonly_args);
260-
dump_args(code_state->state + n_state - self->n_pos_args - self->n_kwonly_args, self->n_pos_args + self->n_kwonly_args);
266+
DEBUG_printf("Calling: n_pos_args=%d, n_kwonly_args=%d\n", n_pos_args, n_kwonly_args);
267+
dump_args(code_state->state + n_state - n_pos_args - n_kwonly_args, n_pos_args + n_kwonly_args);
261268
dump_args(code_state->state, n_state);
262269
}

py/bc.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@
3333
//
3434
// n_state : var uint
3535
// n_exc_stack : var uint
36+
// scope_flags : byte
37+
// n_pos_args : byte number of arguments this function takes
38+
// n_kwonly_args : byte number of keyword-only arguments this function takes
39+
// n_def_pos_args : byte number of default positional arguments
3640
//
3741
// <word alignment padding>
3842
//
@@ -85,7 +89,7 @@ mp_uint_t mp_decode_uint(const byte **ptr);
8589
mp_vm_return_kind_t mp_execute_bytecode(mp_code_state *code_state, volatile mp_obj_t inject_exc);
8690
mp_code_state *mp_obj_fun_bc_prepare_codestate(mp_obj_t func, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args);
8791
void mp_setup_code_state(mp_code_state *code_state, mp_obj_t self_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args);
88-
void mp_bytecode_print(const void *descr, mp_uint_t n_total_args, const byte *code, mp_uint_t len);
92+
void mp_bytecode_print(const void *descr, const byte *code, mp_uint_t len);
8993
void mp_bytecode_print2(const byte *code, mp_uint_t len);
9094
const byte *mp_bytecode_print_str(const byte *ip);
9195
#define mp_bytecode_print_inst(code) mp_bytecode_print2(code, 1)

py/compile.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -539,6 +539,12 @@ STATIC void close_over_variables_etc(compiler_t *comp, scope_t *this_scope, int
539539
assert(n_pos_defaults >= 0);
540540
assert(n_kw_defaults >= 0);
541541

542+
// set flags
543+
if (n_kw_defaults > 0) {
544+
this_scope->scope_flags |= MP_SCOPE_FLAG_DEFKWARGS;
545+
}
546+
this_scope->num_def_pos_args = n_pos_defaults;
547+
542548
// make closed over variables, if any
543549
// ensure they are closed over in the order defined in the outer scope (mainly to agree with CPython)
544550
int nfree = 0;

py/emitbc.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,13 @@ void mp_emit_bc_start_pass(emit_t *emit, pass_kind_t pass, scope_t *scope) {
294294
emit_write_code_info_uint(emit, scope->exc_stack_size);
295295
}
296296

297+
// Write scope flags and number of arguments.
298+
// TODO check that num args all fit in a byte
299+
emit_write_code_info_byte(emit, emit->scope->scope_flags);
300+
emit_write_code_info_byte(emit, emit->scope->num_pos_args);
301+
emit_write_code_info_byte(emit, emit->scope->num_kwonly_args);
302+
emit_write_code_info_byte(emit, emit->scope->num_def_pos_args);
303+
297304
// Align code-info so that following pointers are aligned on a machine word.
298305
emit_align_code_info_to_machine_word(emit);
299306

@@ -372,9 +379,7 @@ void mp_emit_bc_end_pass(emit_t *emit) {
372379

373380
} else if (emit->pass == MP_PASS_EMIT) {
374381
mp_emit_glue_assign_bytecode(emit->scope->raw_code, emit->code_base,
375-
emit->code_info_size + emit->bytecode_size,
376-
emit->scope->num_pos_args, emit->scope->num_kwonly_args,
377-
emit->scope->scope_flags);
382+
emit->code_info_size + emit->bytecode_size, emit->scope->scope_flags);
378383
}
379384
}
380385

py/emitglue.c

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,9 @@ struct _mp_raw_code_t {
4848
mp_raw_code_kind_t kind : 3;
4949
mp_uint_t scope_flags : 7;
5050
mp_uint_t n_pos_args : 11;
51-
mp_uint_t n_kwonly_args : 11;
5251
union {
5352
struct {
54-
byte *code;
55-
mp_uint_t len;
53+
const byte *code;
5654
} u_byte;
5755
struct {
5856
void *fun_data;
@@ -67,36 +65,32 @@ mp_raw_code_t *mp_emit_glue_new_raw_code(void) {
6765
return rc;
6866
}
6967

70-
void mp_emit_glue_assign_bytecode(mp_raw_code_t *rc, byte *code, mp_uint_t len, mp_uint_t n_pos_args, mp_uint_t n_kwonly_args, mp_uint_t scope_flags) {
68+
void mp_emit_glue_assign_bytecode(mp_raw_code_t *rc, byte *code, mp_uint_t len, mp_uint_t scope_flags) {
7169
rc->kind = MP_CODE_BYTECODE;
7270
rc->scope_flags = scope_flags;
73-
rc->n_pos_args = n_pos_args;
74-
rc->n_kwonly_args = n_kwonly_args;
7571
rc->data.u_byte.code = code;
76-
rc->data.u_byte.len = len;
7772

7873
#ifdef DEBUG_PRINT
79-
DEBUG_printf("assign byte code: code=%p len=" UINT_FMT " n_pos_args=" UINT_FMT " n_kwonly_args=" UINT_FMT " flags=%x\n", code, len, n_pos_args, n_kwonly_args, (uint)scope_flags);
74+
DEBUG_printf("assign byte code: code=%p len=" UINT_FMT " flags=%x\n", code, len, (uint)scope_flags);
8075
#endif
8176
#if MICROPY_DEBUG_PRINTERS
8277
if (mp_verbose_flag >= 2) {
83-
mp_bytecode_print(rc, n_pos_args + n_kwonly_args, code, len);
78+
mp_bytecode_print(rc, code, len);
8479
}
8580
#endif
8681
}
8782

8883
#if MICROPY_EMIT_NATIVE || MICROPY_EMIT_INLINE_THUMB
89-
void mp_emit_glue_assign_native(mp_raw_code_t *rc, mp_raw_code_kind_t kind, void *fun_data, mp_uint_t fun_len, mp_uint_t n_pos_args, mp_uint_t n_kwonly_args, mp_uint_t scope_flags, mp_uint_t type_sig) {
84+
void mp_emit_glue_assign_native(mp_raw_code_t *rc, mp_raw_code_kind_t kind, void *fun_data, mp_uint_t fun_len, mp_uint_t n_pos_args, mp_uint_t scope_flags, mp_uint_t type_sig) {
9085
assert(kind == MP_CODE_NATIVE_PY || kind == MP_CODE_NATIVE_VIPER || kind == MP_CODE_NATIVE_ASM);
9186
rc->kind = kind;
9287
rc->scope_flags = scope_flags;
9388
rc->n_pos_args = n_pos_args;
94-
rc->n_kwonly_args = n_kwonly_args;
9589
rc->data.u_native.fun_data = fun_data;
9690
rc->data.u_native.type_sig = type_sig;
9791

9892
#ifdef DEBUG_PRINT
99-
DEBUG_printf("assign native: kind=%d fun=%p len=" UINT_FMT " n_pos_args=" UINT_FMT " n_kwonly_args=" UINT_FMT " flags=%x\n", kind, fun_data, fun_len, n_pos_args, n_kwonly_args, (uint)scope_flags);
93+
DEBUG_printf("assign native: kind=%d fun=%p len=" UINT_FMT " n_pos_args=" UINT_FMT " flags=%x\n", kind, fun_data, fun_len, n_pos_args, (uint)scope_flags);
10094
for (mp_uint_t i = 0; i < fun_len; i++) {
10195
if (i > 0 && i % 16 == 0) {
10296
DEBUG_printf("\n");
@@ -131,11 +125,11 @@ mp_obj_t mp_make_function_from_raw_code(mp_raw_code_t *rc, mp_obj_t def_args, mp
131125
switch (rc->kind) {
132126
case MP_CODE_BYTECODE:
133127
no_other_choice:
134-
fun = mp_obj_new_fun_bc(rc->scope_flags, rc->n_pos_args, rc->n_kwonly_args, def_args, def_kw_args, rc->data.u_byte.code);
128+
fun = mp_obj_new_fun_bc(def_args, def_kw_args, rc->data.u_byte.code);
135129
break;
136130
#if MICROPY_EMIT_NATIVE
137131
case MP_CODE_NATIVE_PY:
138-
fun = mp_obj_new_fun_native(rc->scope_flags, rc->n_pos_args, rc->n_kwonly_args, def_args, def_kw_args, rc->data.u_native.fun_data);
132+
fun = mp_obj_new_fun_native(def_args, def_kw_args, rc->data.u_native.fun_data);
139133
break;
140134
case MP_CODE_NATIVE_VIPER:
141135
fun = mp_obj_new_fun_viper(rc->n_pos_args, rc->data.u_native.fun_data, rc->data.u_native.type_sig);

py/emitglue.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ typedef struct _mp_raw_code_t mp_raw_code_t;
4343

4444
mp_raw_code_t *mp_emit_glue_new_raw_code(void);
4545

46-
void mp_emit_glue_assign_bytecode(mp_raw_code_t *rc, byte *code, mp_uint_t len, mp_uint_t n_pos_args, mp_uint_t n_kwonly_args, mp_uint_t scope_flags);
47-
void mp_emit_glue_assign_native(mp_raw_code_t *rc, mp_raw_code_kind_t kind, void *fun_data, mp_uint_t fun_len, mp_uint_t n_pos_args, mp_uint_t n_kwonly_args, mp_uint_t scope_flags, mp_uint_t type_sig);
46+
void mp_emit_glue_assign_bytecode(mp_raw_code_t *rc, byte *code, mp_uint_t len, mp_uint_t scope_flags);
47+
void mp_emit_glue_assign_native(mp_raw_code_t *rc, mp_raw_code_kind_t kind, void *fun_data, mp_uint_t fun_len, mp_uint_t n_pos_args, mp_uint_t scope_flags, mp_uint_t type_sig);
4848

4949
mp_obj_t mp_make_function_from_raw_code(mp_raw_code_t *rc, mp_obj_t def_args, mp_obj_t def_kw_args);
5050
mp_obj_t mp_make_closure_from_raw_code(mp_raw_code_t *rc, mp_uint_t n_closed_over, const mp_obj_t *args);

py/emitinlinethumb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ STATIC void emit_inline_thumb_end_pass(emit_inline_asm_t *emit) {
9090

9191
if (emit->pass == MP_PASS_EMIT) {
9292
void *f = asm_thumb_get_code(emit->as);
93-
mp_emit_glue_assign_native(emit->scope->raw_code, MP_CODE_NATIVE_ASM, f, asm_thumb_get_code_size(emit->as), emit->scope->num_pos_args, 0, 0, 0);
93+
mp_emit_glue_assign_native(emit->scope->raw_code, MP_CODE_NATIVE_ASM, f, asm_thumb_get_code_size(emit->as), emit->scope->num_pos_args, 0, 0);
9494
}
9595
}
9696

py/emitnative.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -824,6 +824,10 @@ STATIC void emit_native_end_pass(emit_t *emit) {
824824

825825
if (!emit->do_viper_types) {
826826
emit->prelude_offset = ASM_GET_CODE_POS(emit->as);
827+
ASM_DATA(emit->as, 1, emit->scope->scope_flags);
828+
ASM_DATA(emit->as, 1, emit->scope->num_pos_args);
829+
ASM_DATA(emit->as, 1, emit->scope->num_kwonly_args);
830+
ASM_DATA(emit->as, 1, emit->scope->num_def_pos_args);
827831
ASM_ALIGN(emit->as, ASM_WORD_SIZE);
828832

829833
// write argument names as qstr objects
@@ -874,8 +878,7 @@ STATIC void emit_native_end_pass(emit_t *emit) {
874878

875879
mp_emit_glue_assign_native(emit->scope->raw_code,
876880
emit->do_viper_types ? MP_CODE_NATIVE_VIPER : MP_CODE_NATIVE_PY,
877-
f, f_len, emit->scope->num_pos_args, emit->scope->num_kwonly_args,
878-
emit->scope->scope_flags, type_sig);
881+
f, f_len, emit->scope->num_pos_args, emit->scope->scope_flags, type_sig);
879882
}
880883
}
881884

py/obj.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -537,8 +537,8 @@ mp_obj_t mp_obj_new_exception_arg1(const mp_obj_type_t *exc_type, mp_obj_t arg);
537537
mp_obj_t mp_obj_new_exception_args(const mp_obj_type_t *exc_type, mp_uint_t n_args, const mp_obj_t *args);
538538
mp_obj_t mp_obj_new_exception_msg(const mp_obj_type_t *exc_type, const char *msg);
539539
mp_obj_t mp_obj_new_exception_msg_varg(const mp_obj_type_t *exc_type, const char *fmt, ...); // counts args by number of % symbols in fmt, excluding %%; can only handle void* sizes (ie no float/double!)
540-
mp_obj_t mp_obj_new_fun_bc(mp_uint_t scope_flags, mp_uint_t n_pos_args, mp_uint_t n_kwonly_args, mp_obj_t def_args, mp_obj_t def_kw_args, const byte *code);
541-
mp_obj_t mp_obj_new_fun_native(mp_uint_t scope_flags, mp_uint_t n_pos_args, mp_uint_t n_kwonly_args, mp_obj_t def_args_in, mp_obj_t def_kw_args, const void *fun_data);
540+
mp_obj_t mp_obj_new_fun_bc(mp_obj_t def_args, mp_obj_t def_kw_args, const byte *code);
541+
mp_obj_t mp_obj_new_fun_native(mp_obj_t def_args_in, mp_obj_t def_kw_args, const void *fun_data);
542542
mp_obj_t mp_obj_new_fun_viper(mp_uint_t n_args, void *fun_data, mp_uint_t type_sig);
543543
mp_obj_t mp_obj_new_fun_asm(mp_uint_t n_args, void *fun_data);
544544
mp_obj_t mp_obj_new_gen_wrap(mp_obj_t fun);

0 commit comments

Comments
 (0)