@@ -1459,6 +1459,7 @@ static void emit_native_load_attr(emit_t *emit, qstr qst) {
1459
1459
}
1460
1460
1461
1461
static void emit_native_load_method (emit_t * emit , qstr qst , bool is_super ) {
1462
+ DEBUG_printf ("load_method(%s, %d)\n" , qstr_str (qst ), is_super );
1462
1463
if (is_super ) {
1463
1464
emit_get_stack_pointer_to_reg_for_pop (emit , REG_ARG_2 , 3 ); // arg2 = dest ptr
1464
1465
emit_get_stack_pointer_to_reg_for_push (emit , REG_ARG_2 , 2 ); // arg2 = dest ptr
@@ -2149,6 +2150,7 @@ static void emit_native_setup_with(emit_t *emit, mp_uint_t label) {
2149
2150
}
2150
2151
2151
2152
static void emit_native_setup_block (emit_t * emit , mp_uint_t label , int kind ) {
2153
+ DEBUG_printf ("setup_block(%d, %d)\n" , (int )label , kind );
2152
2154
if (kind == MP_EMIT_SETUP_BLOCK_WITH ) {
2153
2155
emit_native_setup_with (emit , label );
2154
2156
} else {
@@ -2233,6 +2235,8 @@ static void emit_native_end_finally(emit_t *emit) {
2233
2235
// if exc == None: pass
2234
2236
// else: raise exc
2235
2237
// the check if exc is None is done in the MP_F_NATIVE_RAISE stub
2238
+ DEBUG_printf ("end_finally\n" );
2239
+
2236
2240
emit_native_pre (emit );
2237
2241
ASM_MOV_REG_LOCAL (emit -> as , REG_ARG_1 , LOCAL_IDX_EXC_VAL (emit ));
2238
2242
emit_call (emit , MP_F_NATIVE_RAISE );
@@ -2257,6 +2261,8 @@ static void emit_native_get_iter(emit_t *emit, bool use_stack) {
2257
2261
// perhaps the difficult one, as we want to rewrite for loops using native code
2258
2262
// in cases where we iterate over a Python object, can we use normal runtime calls?
2259
2263
2264
+ DEBUG_printf ("get_iter(%d)\n" , use_stack );
2265
+
2260
2266
vtype_kind_t vtype ;
2261
2267
emit_pre_pop_reg (emit , & vtype , REG_ARG_1 );
2262
2268
assert (vtype == VTYPE_PYOBJ );
@@ -2838,6 +2844,7 @@ static void emit_native_call_function(emit_t *emit, mp_uint_t n_positional, mp_u
2838
2844
}
2839
2845
2840
2846
static void emit_native_call_method (emit_t * emit , mp_uint_t n_positional , mp_uint_t n_keyword , mp_uint_t star_flags ) {
2847
+ DEBUG_printf ("call_method(%d, %d, %d)\n" , n_positional , n_keyword , star_flags );
2841
2848
if (star_flags ) {
2842
2849
emit_get_stack_pointer_to_reg_for_pop (emit , REG_ARG_3 , n_positional + 2 * n_keyword + 3 ); // pointer to args
2843
2850
emit_call_with_2_imm_args (emit , MP_F_CALL_METHOD_N_KW_VAR , 1 , REG_ARG_1 , n_positional | (n_keyword << 8 ), REG_ARG_2 );
@@ -2904,6 +2911,7 @@ static void emit_native_return_value(emit_t *emit) {
2904
2911
}
2905
2912
2906
2913
static void emit_native_raise_varargs (emit_t * emit , mp_uint_t n_args ) {
2914
+ DEBUG_printf ("raise_varargs(%d)\n" , n_args );
2907
2915
(void )n_args ;
2908
2916
assert (n_args == 1 );
2909
2917
vtype_kind_t vtype_exc ;
@@ -2919,6 +2927,8 @@ static void emit_native_raise_varargs(emit_t *emit, mp_uint_t n_args) {
2919
2927
static void emit_native_yield (emit_t * emit , int kind ) {
2920
2928
// Note: 1 (yield) or 3 (yield from) labels are reserved for this function, starting at *emit->label_slot
2921
2929
2930
+ DEBUG_printf ("yield(%d)\n" , kind );
2931
+
2922
2932
if (emit -> do_viper_types ) {
2923
2933
mp_raise_NotImplementedError (MP_ERROR_TEXT ("native yield" ));
2924
2934
}
0 commit comments