Lines Matching refs:tstate
178 PyThreadState *tstate = PyThreadState_GET(); in PyEval_AcquireLock() local
179 if (tstate == NULL) in PyEval_AcquireLock()
181 take_gil(tstate); in PyEval_AcquireLock()
196 PyEval_AcquireThread(PyThreadState *tstate) in PyEval_AcquireThread() argument
198 if (tstate == NULL) in PyEval_AcquireThread()
202 take_gil(tstate); in PyEval_AcquireThread()
203 if (PyThreadState_Swap(tstate) != NULL) in PyEval_AcquireThread()
209 PyEval_ReleaseThread(PyThreadState *tstate) in PyEval_ReleaseThread() argument
211 if (tstate == NULL) in PyEval_ReleaseThread()
213 if (PyThreadState_Swap(NULL) != tstate) in PyEval_ReleaseThread()
215 drop_gil(tstate); in PyEval_ReleaseThread()
255 PyThreadState *tstate = PyThreadState_Swap(NULL); in PyEval_SaveThread() local
256 if (tstate == NULL) in PyEval_SaveThread()
259 drop_gil(tstate); in PyEval_SaveThread()
260 return tstate; in PyEval_SaveThread()
264 PyEval_RestoreThread(PyThreadState *tstate) in PyEval_RestoreThread() argument
266 if (tstate == NULL) in PyEval_RestoreThread()
271 take_gil(tstate); in PyEval_RestoreThread()
273 if (_Py_IsFinalizing() && !_Py_CURRENTLY_FINALIZING(tstate)) { in PyEval_RestoreThread()
274 drop_gil(tstate); in PyEval_RestoreThread()
280 PyThreadState_Swap(tstate); in PyEval_RestoreThread()
470 PyThreadState *tstate = PyThreadState_GET(); in _Py_CheckRecursiveCall() local
474 tstate->stackcheck_counter = 0; in _Py_CheckRecursiveCall()
476 --tstate->recursion_depth; in _Py_CheckRecursiveCall()
483 if (tstate->recursion_critical) in _Py_CheckRecursiveCall()
486 if (tstate->overflowed) { in _Py_CheckRecursiveCall()
487 if (tstate->recursion_depth > recursion_limit + 50) { in _Py_CheckRecursiveCall()
493 if (tstate->recursion_depth > recursion_limit) { in _Py_CheckRecursiveCall()
494 --tstate->recursion_depth; in _Py_CheckRecursiveCall()
495 tstate->overflowed = 1; in _Py_CheckRecursiveCall()
546 PyThreadState *tstate = PyThreadState_GET(); in PyEval_EvalFrameEx() local
547 return tstate->interp->eval_frame(f, throwflag); in PyEval_EvalFrameEx()
563 PyThreadState *tstate = PyThreadState_GET(); in _PyEval_EvalFrameDefault() local
820 exc_info = tstate->exc_info; \ in _PyEval_EvalFrameDefault()
838 tstate->frame = f; in _PyEval_EvalFrameDefault()
840 if (tstate->use_tracing) { in _PyEval_EvalFrameDefault()
841 if (tstate->c_tracefunc != NULL) { in _PyEval_EvalFrameDefault()
855 if (call_trace_protected(tstate->c_tracefunc, in _PyEval_EvalFrameDefault()
856 tstate->c_traceobj, in _PyEval_EvalFrameDefault()
857 tstate, f, PyTrace_CALL, Py_None)) { in _PyEval_EvalFrameDefault()
862 if (tstate->c_profilefunc != NULL) { in _PyEval_EvalFrameDefault()
865 if (call_trace_protected(tstate->c_profilefunc, in _PyEval_EvalFrameDefault()
866 tstate->c_profileobj, in _PyEval_EvalFrameDefault()
867 tstate, f, PyTrace_CALL, Py_None)) { in _PyEval_EvalFrameDefault()
977 if (PyThreadState_Swap(NULL) != tstate) in _PyEval_EvalFrameDefault()
979 drop_gil(tstate); in _PyEval_EvalFrameDefault()
983 take_gil(tstate); in _PyEval_EvalFrameDefault()
987 !_Py_CURRENTLY_FINALIZING(tstate)) in _PyEval_EvalFrameDefault()
989 drop_gil(tstate); in _PyEval_EvalFrameDefault()
993 if (PyThreadState_Swap(tstate) != NULL) in _PyEval_EvalFrameDefault()
997 if (tstate->async_exc != NULL) { in _PyEval_EvalFrameDefault()
998 PyObject *exc = tstate->async_exc; in _PyEval_EvalFrameDefault()
999 tstate->async_exc = NULL; in _PyEval_EvalFrameDefault()
1016 tstate->c_tracefunc != NULL && !tstate->tracing) { in _PyEval_EvalFrameDefault()
1022 err = maybe_call_line_trace(tstate->c_tracefunc, in _PyEval_EvalFrameDefault()
1023 tstate->c_traceobj, in _PyEval_EvalFrameDefault()
1024 tstate, f, in _PyEval_EvalFrameDefault()
1798 if (tstate->c_tracefunc != NULL in _PyEval_EvalFrameDefault()
1800 call_exc_trace(tstate->c_tracefunc, tstate->c_traceobj, tstate, f); in _PyEval_EvalFrameDefault()
2819 else if (tstate->c_tracefunc != NULL) in _PyEval_EvalFrameDefault()
2820 call_exc_trace(tstate->c_tracefunc, tstate->c_traceobj, tstate, f); in _PyEval_EvalFrameDefault()
3354 if (tstate->c_tracefunc != NULL) in _PyEval_EvalFrameDefault()
3355 call_exc_trace(tstate->c_tracefunc, tstate->c_traceobj, in _PyEval_EvalFrameDefault()
3356 tstate, f); in _PyEval_EvalFrameDefault()
3390 _PyErr_StackItem *exc_info = tstate->exc_info; in _PyEval_EvalFrameDefault()
3461 if (tstate->use_tracing) { in _PyEval_EvalFrameDefault()
3462 if (tstate->c_tracefunc) { in _PyEval_EvalFrameDefault()
3464 if (call_trace(tstate->c_tracefunc, tstate->c_traceobj, in _PyEval_EvalFrameDefault()
3465 tstate, f, in _PyEval_EvalFrameDefault()
3472 call_trace_protected(tstate->c_tracefunc, tstate->c_traceobj, in _PyEval_EvalFrameDefault()
3473 tstate, f, in _PyEval_EvalFrameDefault()
3477 if (tstate->c_profilefunc) { in _PyEval_EvalFrameDefault()
3479 call_trace_protected(tstate->c_profilefunc, in _PyEval_EvalFrameDefault()
3480 tstate->c_profileobj, in _PyEval_EvalFrameDefault()
3481 tstate, f, in _PyEval_EvalFrameDefault()
3483 else if (call_trace(tstate->c_profilefunc, tstate->c_profileobj, in _PyEval_EvalFrameDefault()
3484 tstate, f, in _PyEval_EvalFrameDefault()
3498 tstate->frame = f->f_back; in _PyEval_EvalFrameDefault()
3676 PyThreadState *tstate; in _PyEval_EvalCodeWithName() local
3689 tstate = PyThreadState_GET(); in _PyEval_EvalCodeWithName()
3690 assert(tstate != NULL); in _PyEval_EvalCodeWithName()
3691 f = _PyFrame_New_NoTrack(tstate, co, globals, locals); in _PyEval_EvalCodeWithName()
3887 PyObject *coro_wrapper = tstate->coroutine_wrapper; in _PyEval_EvalCodeWithName()
3890 if (is_coro && tstate->in_coroutine_wrapper) { in _PyEval_EvalCodeWithName()
3921 tstate->in_coroutine_wrapper = 1; in _PyEval_EvalCodeWithName()
3923 tstate->in_coroutine_wrapper = 0; in _PyEval_EvalCodeWithName()
3939 assert(tstate != NULL); in _PyEval_EvalCodeWithName()
3945 ++tstate->recursion_depth; in _PyEval_EvalCodeWithName()
3947 --tstate->recursion_depth; in _PyEval_EvalCodeWithName()
3990 PyThreadState *tstate = PyThreadState_GET(); in do_raise() local
3991 _PyErr_StackItem *exc_info = _PyErr_GetTopmostException(tstate); in do_raise()
4193 PyThreadState *tstate, PyFrameObject *f) in call_exc_trace() argument
4209 err = call_trace(func, self, tstate, f, PyTrace_EXCEPTION, arg); in call_exc_trace()
4222 PyThreadState *tstate, PyFrameObject *frame, in call_trace_protected() argument
4228 err = call_trace(func, obj, tstate, frame, what, arg); in call_trace_protected()
4244 PyThreadState *tstate, PyFrameObject *frame, in call_trace() argument
4248 if (tstate->tracing) in call_trace()
4250 tstate->tracing++; in call_trace()
4251 tstate->use_tracing = 0; in call_trace()
4253 tstate->use_tracing = ((tstate->c_tracefunc != NULL) in call_trace()
4254 || (tstate->c_profilefunc != NULL)); in call_trace()
4255 tstate->tracing--; in call_trace()
4262 PyThreadState *tstate = PyThreadState_GET(); in _PyEval_CallTracing() local
4263 int save_tracing = tstate->tracing; in _PyEval_CallTracing()
4264 int save_use_tracing = tstate->use_tracing; in _PyEval_CallTracing()
4267 tstate->tracing = 0; in _PyEval_CallTracing()
4268 tstate->use_tracing = ((tstate->c_tracefunc != NULL) in _PyEval_CallTracing()
4269 || (tstate->c_profilefunc != NULL)); in _PyEval_CallTracing()
4271 tstate->tracing = save_tracing; in _PyEval_CallTracing()
4272 tstate->use_tracing = save_use_tracing; in _PyEval_CallTracing()
4279 PyThreadState *tstate, PyFrameObject *frame, in maybe_call_line_trace() argument
4302 result = call_trace(func, obj, tstate, frame, PyTrace_LINE, Py_None); in maybe_call_line_trace()
4307 result = call_trace(func, obj, tstate, frame, PyTrace_OPCODE, Py_None); in maybe_call_line_trace()
4316 PyThreadState *tstate = PyThreadState_GET(); in PyEval_SetProfile() local
4317 PyObject *temp = tstate->c_profileobj; in PyEval_SetProfile()
4319 tstate->c_profilefunc = NULL; in PyEval_SetProfile()
4320 tstate->c_profileobj = NULL; in PyEval_SetProfile()
4322 tstate->use_tracing = tstate->c_tracefunc != NULL; in PyEval_SetProfile()
4324 tstate->c_profilefunc = func; in PyEval_SetProfile()
4325 tstate->c_profileobj = arg; in PyEval_SetProfile()
4327 tstate->use_tracing = (func != NULL) || (tstate->c_tracefunc != NULL); in PyEval_SetProfile()
4333 PyThreadState *tstate = PyThreadState_GET(); in PyEval_SetTrace() local
4334 PyObject *temp = tstate->c_traceobj; in PyEval_SetTrace()
4335 _Py_TracingPossible += (func != NULL) - (tstate->c_tracefunc != NULL); in PyEval_SetTrace()
4337 tstate->c_tracefunc = NULL; in PyEval_SetTrace()
4338 tstate->c_traceobj = NULL; in PyEval_SetTrace()
4340 tstate->use_tracing = tstate->c_profilefunc != NULL; in PyEval_SetTrace()
4342 tstate->c_tracefunc = func; in PyEval_SetTrace()
4343 tstate->c_traceobj = arg; in PyEval_SetTrace()
4345 tstate->use_tracing = ((func != NULL) in PyEval_SetTrace()
4346 || (tstate->c_profilefunc != NULL)); in PyEval_SetTrace()
4353 PyThreadState *tstate = PyThreadState_GET(); in _PyEval_SetCoroutineOriginTrackingDepth() local
4354 tstate->coroutine_origin_tracking_depth = new_depth; in _PyEval_SetCoroutineOriginTrackingDepth()
4360 PyThreadState *tstate = PyThreadState_GET(); in _PyEval_GetCoroutineOriginTrackingDepth() local
4361 return tstate->coroutine_origin_tracking_depth; in _PyEval_GetCoroutineOriginTrackingDepth()
4367 PyThreadState *tstate = PyThreadState_GET(); in _PyEval_SetCoroutineWrapper() local
4370 Py_XSETREF(tstate->coroutine_wrapper, wrapper); in _PyEval_SetCoroutineWrapper()
4376 PyThreadState *tstate = PyThreadState_GET(); in _PyEval_GetCoroutineWrapper() local
4377 return tstate->coroutine_wrapper; in _PyEval_GetCoroutineWrapper()
4383 PyThreadState *tstate = PyThreadState_GET(); in _PyEval_SetAsyncGenFirstiter() local
4386 Py_XSETREF(tstate->async_gen_firstiter, firstiter); in _PyEval_SetAsyncGenFirstiter()
4392 PyThreadState *tstate = PyThreadState_GET(); in _PyEval_GetAsyncGenFirstiter() local
4393 return tstate->async_gen_firstiter; in _PyEval_GetAsyncGenFirstiter()
4399 PyThreadState *tstate = PyThreadState_GET(); in _PyEval_SetAsyncGenFinalizer() local
4402 Py_XSETREF(tstate->async_gen_finalizer, finalizer); in _PyEval_SetAsyncGenFinalizer()
4408 PyThreadState *tstate = PyThreadState_GET(); in _PyEval_GetAsyncGenFinalizer() local
4409 return tstate->async_gen_finalizer; in _PyEval_GetAsyncGenFinalizer()
4466 PyThreadState *tstate = PyThreadState_GET(); in PyEval_GetFrame() local
4467 return _PyThreadState_GetFrame(tstate); in PyEval_GetFrame()
4521 if (tstate->use_tracing && tstate->c_profilefunc) { \
4522 if (call_trace(tstate->c_profilefunc, tstate->c_profileobj, \
4523 tstate, tstate->frame, \
4529 if (tstate->c_profilefunc != NULL) { \
4531 call_trace_protected(tstate->c_profilefunc, \
4532 tstate->c_profileobj, \
4533 tstate, tstate->frame, \
4537 if (call_trace(tstate->c_profilefunc, \
4538 tstate->c_profileobj, \
4539 tstate, tstate->frame, \
4567 PyThreadState *tstate = PyThreadState_GET(); in Py_LOCAL_INLINE() local
4571 PyThreadState *tstate = PyThreadState_GET(); in Py_LOCAL_INLINE() local
4572 if (nargs > 0 && tstate->use_tracing) { in Py_LOCAL_INLINE()
4640 PyThreadState *tstate = PyThreadState_GET(); in do_call_core() local