Lines Matching refs:tstate
86 PyThreadState *tstate = PyThreadState_Get(); in dump_tsc() local
87 if (!tstate->interp->tscdump) in dump_tsc()
271 PyEval_AcquireThread(PyThreadState *tstate) in PyEval_AcquireThread() argument
273 if (tstate == NULL) in PyEval_AcquireThread()
278 if (PyThreadState_Swap(tstate) != NULL) in PyEval_AcquireThread()
284 PyEval_ReleaseThread(PyThreadState *tstate) in PyEval_ReleaseThread() argument
286 if (tstate == NULL) in PyEval_ReleaseThread()
288 if (PyThreadState_Swap(NULL) != tstate) in PyEval_ReleaseThread()
302 PyThreadState *tstate; in PyEval_ReInitThreads() local
317 tstate = PyThreadState_GET(); in PyEval_ReInitThreads()
318 threading = PyMapping_GetItemString(tstate->interp->modules, in PyEval_ReInitThreads()
341 PyThreadState *tstate = PyThreadState_Swap(NULL); in PyEval_SaveThread() local
342 if (tstate == NULL) in PyEval_SaveThread()
348 return tstate; in PyEval_SaveThread()
352 PyEval_RestoreThread(PyThreadState *tstate) in PyEval_RestoreThread() argument
354 if (tstate == NULL) in PyEval_RestoreThread()
363 PyThreadState_Swap(tstate); in PyEval_RestoreThread()
620 PyThreadState *tstate = PyThreadState_GET(); in _Py_CheckRecursiveCall() local
624 --tstate->recursion_depth; in _Py_CheckRecursiveCall()
629 if (tstate->recursion_depth > recursion_limit) { in _Py_CheckRecursiveCall()
630 --tstate->recursion_depth; in _Py_CheckRecursiveCall()
810 PyThreadState *tstate = PyThreadState_GET(); in PyEval_EvalFrameEx() local
984 tstate->frame = f; in PyEval_EvalFrameEx()
986 if (tstate->use_tracing) { in PyEval_EvalFrameEx()
987 if (tstate->c_tracefunc != NULL) { in PyEval_EvalFrameEx()
1001 if (call_trace_protected(tstate->c_tracefunc, in PyEval_EvalFrameEx()
1002 tstate->c_traceobj, in PyEval_EvalFrameEx()
1008 if (tstate->c_profilefunc != NULL) { in PyEval_EvalFrameEx()
1011 if (call_trace_protected(tstate->c_profilefunc, in PyEval_EvalFrameEx()
1012 tstate->c_profileobj, in PyEval_EvalFrameEx()
1101 tstate->tick_counter++; in PyEval_EvalFrameEx()
1121 if (PyThreadState_Swap(NULL) != tstate) in PyEval_EvalFrameEx()
1129 if (PyThreadState_Swap(tstate) != NULL) in PyEval_EvalFrameEx()
1134 if (tstate->async_exc != NULL) { in PyEval_EvalFrameEx()
1135 x = tstate->async_exc; in PyEval_EvalFrameEx()
1136 tstate->async_exc = NULL; in PyEval_EvalFrameEx()
1152 tstate->c_tracefunc != NULL && !tstate->tracing) { in PyEval_EvalFrameEx()
1157 err = maybe_call_line_trace(tstate->c_tracefunc, in PyEval_EvalFrameEx()
1158 tstate->c_traceobj, in PyEval_EvalFrameEx()
3216 if (tstate->c_tracefunc != NULL) in PyEval_EvalFrameEx()
3217 call_exc_trace(tstate->c_tracefunc, in PyEval_EvalFrameEx()
3218 tstate->c_traceobj, f); in PyEval_EvalFrameEx()
3273 set_exc_info(tstate, in PyEval_EvalFrameEx()
3315 if (tstate->use_tracing) { in PyEval_EvalFrameEx()
3316 if (tstate->c_tracefunc) { in PyEval_EvalFrameEx()
3318 if (call_trace(tstate->c_tracefunc, in PyEval_EvalFrameEx()
3319 tstate->c_traceobj, f, in PyEval_EvalFrameEx()
3327 call_trace_protected(tstate->c_tracefunc, in PyEval_EvalFrameEx()
3328 tstate->c_traceobj, f, in PyEval_EvalFrameEx()
3332 if (tstate->c_profilefunc) { in PyEval_EvalFrameEx()
3334 call_trace_protected(tstate->c_profilefunc, in PyEval_EvalFrameEx()
3335 tstate->c_profileobj, f, in PyEval_EvalFrameEx()
3337 else if (call_trace(tstate->c_profilefunc, in PyEval_EvalFrameEx()
3338 tstate->c_profileobj, f, in PyEval_EvalFrameEx()
3347 if (tstate->frame->f_exc_type != NULL) in PyEval_EvalFrameEx()
3348 reset_exc_info(tstate); in PyEval_EvalFrameEx()
3350 assert(tstate->frame->f_exc_value == NULL); in PyEval_EvalFrameEx()
3351 assert(tstate->frame->f_exc_traceback == NULL); in PyEval_EvalFrameEx()
3357 tstate->frame = f->f_back; in PyEval_EvalFrameEx()
3374 PyThreadState *tstate = PyThreadState_GET(); in PyEval_EvalCodeEx() local
3383 assert(tstate != NULL); in PyEval_EvalCodeEx()
3385 f = PyFrame_New(tstate, co, globals, locals); in PyEval_EvalCodeEx()
3613 assert(tstate != NULL); in PyEval_EvalCodeEx()
3614 ++tstate->recursion_depth; in PyEval_EvalCodeEx()
3616 --tstate->recursion_depth; in PyEval_EvalCodeEx()
3719 set_exc_info(PyThreadState *tstate, in set_exc_info() argument
3722 PyFrameObject *frame = tstate->frame; in set_exc_info()
3732 if (tstate->exc_type == NULL) { in set_exc_info()
3735 tstate->exc_type = Py_None; in set_exc_info()
3737 Py_INCREF(tstate->exc_type); in set_exc_info()
3738 Py_XINCREF(tstate->exc_value); in set_exc_info()
3739 Py_XINCREF(tstate->exc_traceback); in set_exc_info()
3740 frame->f_exc_type = tstate->exc_type; in set_exc_info()
3741 frame->f_exc_value = tstate->exc_value; in set_exc_info()
3742 frame->f_exc_traceback = tstate->exc_traceback; in set_exc_info()
3745 tmp_type = tstate->exc_type; in set_exc_info()
3746 tmp_value = tstate->exc_value; in set_exc_info()
3747 tmp_tb = tstate->exc_traceback; in set_exc_info()
3751 tstate->exc_type = type; in set_exc_info()
3752 tstate->exc_value = value; in set_exc_info()
3753 tstate->exc_traceback = tb; in set_exc_info()
3764 reset_exc_info(PyThreadState *tstate) in reset_exc_info() argument
3772 assert(tstate != NULL); in reset_exc_info()
3773 frame = tstate->frame; in reset_exc_info()
3778 tmp_type = tstate->exc_type; in reset_exc_info()
3779 tmp_value = tstate->exc_value; in reset_exc_info()
3780 tmp_tb = tstate->exc_traceback; in reset_exc_info()
3784 tstate->exc_type = frame->f_exc_type; in reset_exc_info()
3785 tstate->exc_value = frame->f_exc_value; in reset_exc_info()
3786 tstate->exc_traceback = frame->f_exc_traceback; in reset_exc_info()
3815 PyThreadState *tstate = PyThreadState_GET(); in do_raise() local
3816 type = tstate->exc_type == NULL ? Py_None : tstate->exc_type; in do_raise()
3817 value = tstate->exc_value; in do_raise()
3818 tb = tstate->exc_traceback; in do_raise()
4037 register PyThreadState *tstate = frame->f_tstate; in call_trace() local
4039 if (tstate->tracing) in call_trace()
4041 tstate->tracing++; in call_trace()
4042 tstate->use_tracing = 0; in call_trace()
4044 tstate->use_tracing = ((tstate->c_tracefunc != NULL) in call_trace()
4045 || (tstate->c_profilefunc != NULL)); in call_trace()
4046 tstate->tracing--; in call_trace()
4054 PyThreadState *tstate = frame->f_tstate; in _PyEval_CallTracing() local
4055 int save_tracing = tstate->tracing; in _PyEval_CallTracing()
4056 int save_use_tracing = tstate->use_tracing; in _PyEval_CallTracing()
4059 tstate->tracing = 0; in _PyEval_CallTracing()
4060 tstate->use_tracing = ((tstate->c_tracefunc != NULL) in _PyEval_CallTracing()
4061 || (tstate->c_profilefunc != NULL)); in _PyEval_CallTracing()
4063 tstate->tracing = save_tracing; in _PyEval_CallTracing()
4064 tstate->use_tracing = save_use_tracing; in _PyEval_CallTracing()
4101 PyThreadState *tstate = PyThreadState_GET(); in PyEval_SetProfile() local
4102 PyObject *temp = tstate->c_profileobj; in PyEval_SetProfile()
4104 tstate->c_profilefunc = NULL; in PyEval_SetProfile()
4105 tstate->c_profileobj = NULL; in PyEval_SetProfile()
4107 tstate->use_tracing = tstate->c_tracefunc != NULL; in PyEval_SetProfile()
4109 tstate->c_profilefunc = func; in PyEval_SetProfile()
4110 tstate->c_profileobj = arg; in PyEval_SetProfile()
4112 tstate->use_tracing = (func != NULL) || (tstate->c_tracefunc != NULL); in PyEval_SetProfile()
4118 PyThreadState *tstate = PyThreadState_GET(); in PyEval_SetTrace() local
4119 PyObject *temp = tstate->c_traceobj; in PyEval_SetTrace()
4120 _Py_TracingPossible += (func != NULL) - (tstate->c_tracefunc != NULL); in PyEval_SetTrace()
4122 tstate->c_tracefunc = NULL; in PyEval_SetTrace()
4123 tstate->c_traceobj = NULL; in PyEval_SetTrace()
4125 tstate->use_tracing = tstate->c_profilefunc != NULL; in PyEval_SetTrace()
4127 tstate->c_tracefunc = func; in PyEval_SetTrace()
4128 tstate->c_traceobj = arg; in PyEval_SetTrace()
4130 tstate->use_tracing = ((func != NULL) in PyEval_SetTrace()
4131 || (tstate->c_profilefunc != NULL)); in PyEval_SetTrace()
4167 PyThreadState *tstate = PyThreadState_GET(); in PyEval_GetFrame() local
4168 return _PyThreadState_GetFrame(tstate); in PyEval_GetFrame()
4299 if (tstate->use_tracing && tstate->c_profilefunc) { \
4300 if (call_trace(tstate->c_profilefunc, \
4301 tstate->c_profileobj, \
4302 tstate->frame, PyTrace_C_CALL, \
4308 if (tstate->c_profilefunc != NULL) { \
4310 call_trace_protected(tstate->c_profilefunc, \
4311 tstate->c_profileobj, \
4312 tstate->frame, PyTrace_C_EXCEPTION, \
4316 if (call_trace(tstate->c_profilefunc, \
4317 tstate->c_profileobj, \
4318 tstate->frame, PyTrace_C_RETURN, \
4349 PyThreadState *tstate = PyThreadState_GET(); in call_function() local
4435 PyThreadState *tstate = PyThreadState_GET(); in fast_function() local
4445 assert(tstate != NULL); in fast_function()
4446 f = PyFrame_New(tstate, co, globals, NULL); in fast_function()
4458 ++tstate->recursion_depth; in fast_function()
4460 --tstate->recursion_depth; in fast_function()
4585 PyThreadState *tstate = PyThreadState_GET(); in do_call() local
4682 PyThreadState *tstate = PyThreadState_GET(); in ext_do_call() local