Lines Matching refs:sp
43 #define TRACE_PREFIX mp_printf(&mp_plat_print, "ts=%p sp=%d ", mp_thread_get_state(), (int)(sp - &c…
45 #define TRACE_PREFIX mp_printf(&mp_plat_print, "sp=%d ", (int)(sp - &code_state->state[0] + 1))
96 #define PUSH(val) *++sp = (val)
97 #define POP() (*sp--)
98 #define TOP() (*sp)
99 #define SET_TOP(val) *sp = (val)
111 exc_sp->val_sp = MP_TAGPTR_MAKE(sp, ((with_or_finally) << 1)); \
119 #define CANCEL_ACTIVE_FINALLY(sp) do { \ argument
120 if (mp_obj_is_small_int(sp[-1])) { \
123 sp[-2] = sp[0]; \
124 sp -= 2; \
126 assert(sp[-1] == mp_const_none || mp_obj_is_exception_instance(sp[-1])); \
129 sp[-1] = sp[0]; \
130 --sp; \
220 TRACE_TICK(ip, sp, false); \ in mp_execute_bytecode()
274 mp_obj_t *sp = code_state->sp; in mp_execute_bytecode() local
298 TRACE_TICK(ip, sp, false); in mp_execute_bytecode()
446 mp_load_method(*sp, qst, sp); in mp_execute_bytecode()
447 sp += 1; in mp_execute_bytecode()
454 sp -= 1; in mp_execute_bytecode()
455 mp_load_super_method(qst, sp - 1); in mp_execute_bytecode()
502 mp_store_attr(sp[0], qst, sp[-1]); in mp_execute_bytecode()
503 sp -= 2; in mp_execute_bytecode()
518 if (mp_obj_is_instance_type(mp_obj_get_type(top)) && sp[-1] != MP_OBJ_NULL) { in mp_execute_bytecode()
523 elem->value = sp[-1]; in mp_execute_bytecode()
525 mp_store_attr(sp[0], qst, sp[-1]); in mp_execute_bytecode()
527 sp -= 2; in mp_execute_bytecode()
535 mp_obj_subscr(sp[-1], sp[0], sp[-2]); in mp_execute_bytecode()
536 sp -= 3; in mp_execute_bytecode()
580 sp += 2; in mp_execute_bytecode()
581 sp[0] = sp[-2]; in mp_execute_bytecode()
582 sp[-1] = sp[-3]; in mp_execute_bytecode()
586 sp -= 1; in mp_execute_bytecode()
590 mp_obj_t top = sp[0]; in mp_execute_bytecode()
591 sp[0] = sp[-1]; in mp_execute_bytecode()
592 sp[-1] = top; in mp_execute_bytecode()
597 mp_obj_t top = sp[0]; in mp_execute_bytecode()
598 sp[0] = sp[-1]; in mp_execute_bytecode()
599 sp[-1] = sp[-2]; in mp_execute_bytecode()
600 sp[-2] = top; in mp_execute_bytecode()
631 sp--; in mp_execute_bytecode()
639 sp--; in mp_execute_bytecode()
650 mp_load_method(obj, MP_QSTR___exit__, sp); in mp_execute_bytecode()
651 mp_load_method(obj, MP_QSTR___enter__, sp + 2); in mp_execute_bytecode()
652 mp_obj_t ret = mp_call_method_n_kw(0, 0, sp + 2); in mp_execute_bytecode()
653 sp += 1; in mp_execute_bytecode()
670 sp[1] = mp_const_none; in mp_execute_bytecode()
671 sp[2] = mp_const_none; in mp_execute_bytecode()
672 sp -= 2; in mp_execute_bytecode()
673 mp_call_method_n_kw(3, 0, sp); in mp_execute_bytecode()
680 mp_obj_t data = sp[-1]; in mp_execute_bytecode()
681 mp_obj_t cause = sp[0]; in mp_execute_bytecode()
682 sp[-1] = mp_const_none; in mp_execute_bytecode()
683 sp[0] = mp_const_none; in mp_execute_bytecode()
684 sp[1] = mp_const_none; in mp_execute_bytecode()
685 mp_call_method_n_kw(3, 0, sp - 3); in mp_execute_bytecode()
686 sp[-3] = data; in mp_execute_bytecode()
687 sp[-2] = cause; in mp_execute_bytecode()
688 sp -= 2; // we removed (__exit__, ctx_mgr) in mp_execute_bytecode()
693 sp[1] = sp[0]; in mp_execute_bytecode()
694 sp[0] = MP_OBJ_FROM_PTR(mp_obj_get_type(sp[0])); in mp_execute_bytecode()
695 sp[2] = mp_const_none; in mp_execute_bytecode()
696 sp -= 2; in mp_execute_bytecode()
697 mp_obj_t ret_value = mp_call_method_n_kw(3, 0, sp); in mp_execute_bytecode()
707 sp[0] = sp[3]; in mp_execute_bytecode()
731 assert(&sp[-1] == MP_TAGPTR_PTR(exc_sp->val_sp)); in mp_execute_bytecode()
743 CANCEL_ACTIVE_FINALLY(sp); in mp_execute_bytecode()
751 sp -= MP_OBJ_ITER_BUF_NSLOTS; in mp_execute_bytecode()
775 sp--; in mp_execute_bytecode()
807 mp_obj_iter_buf_t *iter_buf = (mp_obj_iter_buf_t*)sp; in mp_execute_bytecode()
808 sp += MP_OBJ_ITER_BUF_NSLOTS - 1; in mp_execute_bytecode()
812 sp[-MP_OBJ_ITER_BUF_NSLOTS + 1] = MP_OBJ_NULL; in mp_execute_bytecode()
813 sp[-MP_OBJ_ITER_BUF_NSLOTS + 2] = obj; in mp_execute_bytecode()
822 code_state->sp = sp; in mp_execute_bytecode()
824 if (sp[-MP_OBJ_ITER_BUF_NSLOTS + 1] == MP_OBJ_NULL) { in mp_execute_bytecode()
825 obj = sp[-MP_OBJ_ITER_BUF_NSLOTS + 2]; in mp_execute_bytecode()
827 obj = MP_OBJ_FROM_PTR(&sp[-MP_OBJ_ITER_BUF_NSLOTS + 1]); in mp_execute_bytecode()
831 sp -= MP_OBJ_ITER_BUF_NSLOTS; // pop the exhausted iterator in mp_execute_bytecode()
856 sp -= unum - 1; in mp_execute_bytecode()
857 SET_TOP(mp_obj_new_tuple(unum, sp)); in mp_execute_bytecode()
864 sp -= unum - 1; in mp_execute_bytecode()
865 SET_TOP(mp_obj_new_list(unum, sp)); in mp_execute_bytecode()
878 sp -= 2; in mp_execute_bytecode()
879 mp_obj_dict_store(sp[0], sp[2], sp[1]); in mp_execute_bytecode()
886 sp -= unum - 1; in mp_execute_bytecode()
887 SET_TOP(mp_obj_new_set(unum, sp)); in mp_execute_bytecode()
910 mp_obj_t obj = sp[-(unum >> 2)]; in mp_execute_bytecode()
912 mp_obj_list_append(obj, sp[0]); in mp_execute_bytecode()
913 sp--; in mp_execute_bytecode()
915 mp_obj_dict_store(obj, sp[0], sp[-1]); in mp_execute_bytecode()
916 sp -= 2; in mp_execute_bytecode()
919 mp_obj_set_store(obj, sp[0]); in mp_execute_bytecode()
920 sp--; in mp_execute_bytecode()
929 mp_unpack_sequence(sp[0], unum, sp); in mp_execute_bytecode()
930 sp += unum - 1; in mp_execute_bytecode()
937 mp_unpack_ex(sp[0], unum, sp); in mp_execute_bytecode()
938 sp += (unum & 0xff) + ((unum >> 8) & 0xff); in mp_execute_bytecode()
960 sp -= n_closed_over - 1; in mp_execute_bytecode()
961 SET_TOP(mp_make_closure_from_raw_code(ptr, n_closed_over, sp)); in mp_execute_bytecode()
969 sp -= 2 + n_closed_over - 1; in mp_execute_bytecode()
970 SET_TOP(mp_make_closure_from_raw_code(ptr, 0x100 | n_closed_over, sp)); in mp_execute_bytecode()
980 sp -= (unum & 0xff) + ((unum >> 7) & 0x1fe); in mp_execute_bytecode()
982 if (mp_obj_get_type(*sp) == &mp_type_fun_bc) { in mp_execute_bytecode()
984 code_state->sp = sp; in mp_execute_bytecode()
986 …de_state_t *new_state = mp_obj_fun_bc_prepare_codestate(*sp, unum & 0xff, (unum >> 8) & 0xff, sp +… in mp_execute_bytecode()
1005 SET_TOP(mp_call_function_n_kw(*sp, unum & 0xff, (unum >> 8) & 0xff, sp + 1)); in mp_execute_bytecode()
1017 sp -= (unum & 0xff) + ((unum >> 7) & 0x1fe) + 2; in mp_execute_bytecode()
1019 if (mp_obj_get_type(*sp) == &mp_type_fun_bc) { in mp_execute_bytecode()
1021 code_state->sp = sp; in mp_execute_bytecode()
1025 mp_call_prepare_args_n_kw_var(false, unum, sp, &out_args); in mp_execute_bytecode()
1051 SET_TOP(mp_call_method_n_kw_var(false, unum, sp)); in mp_execute_bytecode()
1061 sp -= (unum & 0xff) + ((unum >> 7) & 0x1fe) + 1; in mp_execute_bytecode()
1063 if (mp_obj_get_type(*sp) == &mp_type_fun_bc) { in mp_execute_bytecode()
1065 code_state->sp = sp; in mp_execute_bytecode()
1070 int adjust = (sp[1] == MP_OBJ_NULL) ? 0 : 1; in mp_execute_bytecode()
1072 …mp_code_state_t *new_state = mp_obj_fun_bc_prepare_codestate(*sp, n_args + adjust, n_kw, sp + 2 - … in mp_execute_bytecode()
1090 SET_TOP(mp_call_method_n_kw(unum & 0xff, (unum >> 8) & 0xff, sp)); in mp_execute_bytecode()
1102 sp -= (unum & 0xff) + ((unum >> 7) & 0x1fe) + 3; in mp_execute_bytecode()
1104 if (mp_obj_get_type(*sp) == &mp_type_fun_bc) { in mp_execute_bytecode()
1106 code_state->sp = sp; in mp_execute_bytecode()
1110 mp_call_prepare_args_n_kw_var(true, unum, sp, &out_args); in mp_execute_bytecode()
1136 SET_TOP(mp_call_method_n_kw_var(true, unum, sp)); in mp_execute_bytecode()
1158 finally_sp[1] = sp[0]; in mp_execute_bytecode()
1159 sp = &finally_sp[1]; in mp_execute_bytecode()
1169 CANCEL_ACTIVE_FINALLY(sp); in mp_execute_bytecode()
1175 code_state->sp = sp; in mp_execute_bytecode()
1180 mp_obj_t res = *sp; in mp_execute_bytecode()
1191 *code_state->sp = res; in mp_execute_bytecode()
1223 sp--; // ignore (pop) "from" argument in mp_execute_bytecode()
1232 code_state->sp = sp; in mp_execute_bytecode()
1246 … code_state->sp = sp; // Save sp because it's needed if mp_resume raises StopIteration in mp_execute_bytecode()
1271 sp--; in mp_execute_bytecode()
1436 code_state->sp -= MP_OBJ_ITER_BUF_NSLOTS; // pop the exhausted iterator in mp_execute_bytecode()
1442 *code_state->sp = mp_obj_exception_get_value(MP_OBJ_FROM_PTR(nlr.ret_val)); in mp_execute_bytecode()
1452 TRACE_TICK(code_state->ip, code_state->sp, true /* yes, it's an exception */); in mp_execute_bytecode()
1505 mp_obj_t *sp = MP_TAGPTR_PTR(exc_sp->val_sp); in mp_execute_bytecode() local
1510 code_state->sp = sp; in mp_execute_bytecode()