/third_party/python/Python/ |
D | pystate.c | 45 static void _PyThreadState_Delete(PyThreadState *tstate, int check_current); 178 struct _gilstate_runtime_state *gilstate, PyThreadState* tstate); 209 PyThreadState *tstate = _PyThreadState_GET(); in PyInterpreterState_New() local 212 if (_PySys_Audit(tstate, "cpython.PyInterpreterState_New", NULL) < 0) { in PyInterpreterState_New() 249 if (tstate != NULL) { in PyInterpreterState_New() 250 _PyErr_SetString(tstate, PyExc_RuntimeError, in PyInterpreterState_New() 278 if (tstate != NULL) { in PyInterpreterState_New() 279 _PyErr_NoMemory(tstate); in PyInterpreterState_New() 288 interpreter_clear(PyInterpreterState *interp, PyThreadState *tstate) in interpreter_clear() argument 292 if (_PySys_Audit(tstate, "cpython.PyInterpreterState_Clear", NULL) < 0) { in interpreter_clear() [all …]
|
D | errors.c | 36 _PyErr_FormatV(PyThreadState *tstate, PyObject *exception, 41 _PyErr_Restore(PyThreadState *tstate, PyObject *type, PyObject *value, in _PyErr_Restore() argument 55 oldtype = tstate->curexc_type; in _PyErr_Restore() 56 oldvalue = tstate->curexc_value; in _PyErr_Restore() 57 oldtraceback = tstate->curexc_traceback; in _PyErr_Restore() 59 tstate->curexc_type = type; in _PyErr_Restore() 60 tstate->curexc_value = value; in _PyErr_Restore() 61 tstate->curexc_traceback = traceback; in _PyErr_Restore() 71 PyThreadState *tstate = _PyThreadState_GET(); in PyErr_Restore() local 72 _PyErr_Restore(tstate, type, value, traceback); in PyErr_Restore() [all …]
|
D | ceval.c | 57 PyThreadState *tstate, PyTraceInfo *, PyObject ***pp_stack, 60 PyThreadState *tstate, PyTraceInfo *, PyObject *func, 90 static void format_exc_unbound(PyThreadState *tstate, PyCodeObject *co, int oparg); 152 is_tstate_valid(PyThreadState *tstate) in is_tstate_valid() argument 154 assert(!_PyMem_IsPtrFreed(tstate)); in is_tstate_valid() 155 assert(!_PyMem_IsPtrFreed(tstate->interp)); in is_tstate_valid() 307 _PyEval_InitGIL(PyThreadState *tstate) in _PyEval_InitGIL() argument 310 if (!_Py_IsMainInterpreter(tstate->interp)) { in _PyEval_InitGIL() 319 struct _gil_runtime_state *gil = &tstate->interp->ceval.gil; in _PyEval_InitGIL() 321 struct _gil_runtime_state *gil = &tstate->interp->runtime->ceval.gil; in _PyEval_InitGIL() [all …]
|
D | pylifecycle.c | 60 static PyStatus init_sys_streams(PyThreadState *tstate); 61 static void wait_for_thread_shutdown(PyThreadState *tstate); 156 init_importlib(PyThreadState *tstate, PyObject *sysmod) in init_importlib() argument 158 assert(!_PyErr_Occurred(tstate)); in init_importlib() 160 PyInterpreterState *interp = tstate->interp; in init_importlib() 180 PyObject *imp_mod = _PyImport_BootstrapImp(tstate); in init_importlib() 198 assert(!_PyErr_Occurred(tstate)); in init_importlib() 204 init_importlib_external(PyThreadState *tstate) in init_importlib_external() argument 207 value = PyObject_CallMethod(tstate->interp->importlib, in init_importlib_external() 210 _PyErr_Print(tstate); in init_importlib_external() [all …]
|
D | import.c | 30 static PyObject *import_add_module(PyThreadState *tstate, PyObject *name); 54 _PyImportZip_Init(PyThreadState *tstate) in _PyImportZip_Init() argument 61 _PyErr_SetString(tstate, PyExc_RuntimeError, in _PyImportZip_Init() 66 int verbose = _PyInterpreterState_GetConfig(tstate->interp)->verbose; in _PyImportZip_Init() 73 _PyErr_Clear(tstate); /* No zip import module -- okay */ in _PyImportZip_Init() 84 _PyErr_Clear(tstate); /* No zipimporter object -- okay */ in _PyImportZip_Init() 135 PyThreadState *tstate = PyEval_SaveThread(); in _PyImport_AcquireLock() local 137 PyEval_RestoreThread(tstate); in _PyImport_AcquireLock() 319 import_get_module(PyThreadState *tstate, PyObject *name) in import_get_module() argument 321 PyObject *modules = tstate->interp->modules; in import_get_module() [all …]
|
D | ceval_gil.h | 145 PyThreadState *tstate) in drop_gil() argument 157 if (tstate != NULL) { in drop_gil() 161 _Py_atomic_store_relaxed(&gil->last_holder, (uintptr_t)tstate); in drop_gil() 171 if (_Py_atomic_load_relaxed(&ceval2->gil_drop_request) && tstate != NULL) { in drop_gil() 174 if (((PyThreadState*)_Py_atomic_load_relaxed(&gil->last_holder)) == tstate) in drop_gil() 176 assert(is_tstate_valid(tstate)); in drop_gil() 177 RESET_GIL_DROP_REQUEST(tstate->interp); in drop_gil() 198 tstate_must_exit(PyThreadState *tstate) in tstate_must_exit() argument 205 return (finalizing != NULL && finalizing != tstate); in tstate_must_exit() 215 take_gil(PyThreadState *tstate) in take_gil() argument [all …]
|
D | sysmodule.c | 67 sys_get_object_id(PyThreadState *tstate, _Py_Identifier *key) in sys_get_object_id() argument 69 PyObject *sd = tstate->interp->sysdict; in sys_get_object_id() 74 _PyErr_Fetch(tstate, &exc_type, &exc_value, &exc_tb); in sys_get_object_id() 78 _PyErr_Restore(tstate, exc_type, exc_value, exc_tb); in sys_get_object_id() 85 PyThreadState *tstate = _PyThreadState_GET(); in _PySys_GetObjectId() local 86 return sys_get_object_id(tstate, key); in _PySys_GetObjectId() 102 PyThreadState *tstate = _PyThreadState_GET(); in PySys_GetObject() local 105 _PyErr_Fetch(tstate, &exc_type, &exc_value, &exc_tb); in PySys_GetObject() 106 PyObject *value = _PySys_GetObject(tstate->interp, name); in PySys_GetObject() 109 _PyErr_Restore(tstate, exc_type, exc_value, exc_tb); in PySys_GetObject() [all …]
|
D | traceback.c | 812 dump_traceback(int fd, PyThreadState *tstate, int write_header) in dump_traceback() argument 824 frame = tstate->frame; in dump_traceback() 857 _Py_DumpTraceback(int fd, PyThreadState *tstate) in _Py_DumpTraceback() argument 859 dump_traceback(fd, tstate, 1); in _Py_DumpTraceback() 868 write_thread_id(int fd, PyThreadState *tstate, int is_current) in write_thread_id() argument 875 tstate->thread_id, in write_thread_id() 890 PyThreadState *tstate; in _Py_DumpTracebackThreads() local 923 tstate = PyInterpreterState_ThreadHead(interp); in _Py_DumpTracebackThreads() 924 if (tstate == NULL) in _Py_DumpTracebackThreads() 928 tstate = PyInterpreterState_ThreadHead(interp); in _Py_DumpTracebackThreads() [all …]
|
D | pythonrun.c | 781 _PyErr_PrintEx(PyThreadState *tstate, int set_sys_last_vars) in _PyErr_PrintEx() argument 787 _PyErr_Fetch(tstate, &exception, &v, &tb); in _PyErr_PrintEx() 792 _PyErr_NormalizeException(tstate, &exception, &v, &tb); in _PyErr_PrintEx() 805 _PyErr_Clear(tstate); in _PyErr_PrintEx() 808 _PyErr_Clear(tstate); in _PyErr_PrintEx() 811 _PyErr_Clear(tstate); in _PyErr_PrintEx() 815 if (_PySys_Audit(tstate, "sys.excepthook", "OOOO", hook ? hook : Py_None, in _PyErr_PrintEx() 835 _PyErr_Fetch(tstate, &exception2, &v2, &tb2); in _PyErr_PrintEx() 836 _PyErr_NormalizeException(tstate, &exception2, &v2, &tb2); in _PyErr_PrintEx() 871 _PyErr_Print(PyThreadState *tstate) in _PyErr_Print() argument [all …]
|
/third_party/python/Include/internal/ |
D | pycore_ceval.h | 17 extern void _Py_FinishPendingCalls(PyThreadState *tstate); 28 extern PyStatus _PyEval_ReInitThreads(PyThreadState *tstate); 31 PyThreadState *tstate, 37 extern PyObject* _PyEval_GetBuiltins(PyThreadState *tstate); 39 PyThreadState *tstate, 44 _PyEval_EvalFrame(PyThreadState *tstate, PyFrameObject *f, int throwflag) in _PyEval_EvalFrame() argument 46 return tstate->interp->eval_frame(tstate, f, throwflag); in _PyEval_EvalFrame() 50 _PyEval_Vector(PyThreadState *tstate, 60 extern PyStatus _PyEval_InitGIL(PyThreadState *tstate); 63 extern void _PyEval_ReleaseLock(PyThreadState *tstate); [all …]
|
D | pycore_pyerrors.h | 11 static inline PyObject* _PyErr_Occurred(PyThreadState *tstate) in _PyErr_Occurred() argument 13 assert(tstate != NULL); in _PyErr_Occurred() 14 return tstate->curexc_type; in _PyErr_Occurred() 33 PyThreadState *tstate, 39 PyThreadState *tstate, 43 PyThreadState *tstate, 49 PyThreadState *tstate, 56 PyAPI_FUNC(void) _PyErr_Clear(PyThreadState *tstate); 58 PyAPI_FUNC(void) _PyErr_SetNone(PyThreadState *tstate, PyObject *exception); 60 PyAPI_FUNC(PyObject *) _PyErr_NoMemory(PyThreadState *tstate); [all …]
|
D | pycore_pystate.h | 92 _Py_EnsureFuncTstateNotNULL(const char *func, PyThreadState *tstate) in _Py_EnsureFuncTstateNotNULL() argument 94 if (tstate == NULL) { in _Py_EnsureFuncTstateNotNULL() 100 #define _Py_EnsureTstateNotNULL(tstate) \ argument 101 _Py_EnsureFuncTstateNotNULL(__func__, tstate) 113 PyThreadState *tstate = _PyThreadState_GET(); in _PyInterpreterState_GET() local 115 _Py_EnsureTstateNotNULL(tstate); in _PyInterpreterState_GET() 117 return tstate->interp; in _PyInterpreterState_GET() 124 PyThreadState *tstate); 127 PyThreadState *tstate); 143 PyThreadState *tstate, [all …]
|
D | pycore_call.h | 12 PyThreadState *tstate, 19 PyThreadState *tstate, 26 PyThreadState *tstate, 32 _PyObject_CallNoArgTstate(PyThreadState *tstate, PyObject *func) { in _PyObject_CallNoArgTstate() argument 33 return _PyObject_VectorcallTstate(tstate, func, NULL, 0, NULL); in _PyObject_CallNoArgTstate()
|
D | pycore_pylifecycle.h | 41 extern PyStatus _PyUnicode_InitEncodings(PyThreadState *tstate); 63 PyThreadState *tstate, 67 extern int _PySys_UpdateConfig(PyThreadState *tstate); 77 extern PyStatus _PyImportZip_Init(PyThreadState *tstate); 113 extern PyStatus _PyGILState_SetTstate(PyThreadState *tstate); 130 PyAPI_FUNC(void) _PyErr_Print(PyThreadState *tstate); 134 PyAPI_FUNC(void) _PyThreadState_DeleteCurrent(PyThreadState *tstate);
|
/third_party/python/Objects/ |
D | call.c | 12 _PyStack_UnpackDict(PyThreadState *tstate, 22 null_error(PyThreadState *tstate) in null_error() argument 24 if (!_PyErr_Occurred(tstate)) { in null_error() 25 _PyErr_SetString(tstate, PyExc_SystemError, in null_error() 33 _Py_CheckFunctionResult(PyThreadState *tstate, PyObject *callable, in _Py_CheckFunctionResult() argument 39 if (!_PyErr_Occurred(tstate)) { in _Py_CheckFunctionResult() 41 _PyErr_Format(tstate, PyExc_SystemError, in _Py_CheckFunctionResult() 45 _PyErr_Format(tstate, PyExc_SystemError, in _Py_CheckFunctionResult() 57 if (_PyErr_Occurred(tstate)) { in _Py_CheckFunctionResult() 62 tstate, PyExc_SystemError, in _Py_CheckFunctionResult() [all …]
|
D | methodobject.c | 388 cfunction_check_kwargs(PyThreadState *tstate, PyObject *func, PyObject *kwnames) in cfunction_check_kwargs() argument 390 assert(!_PyErr_Occurred(tstate)); in cfunction_check_kwargs() 395 _PyErr_Format(tstate, PyExc_TypeError, in cfunction_check_kwargs() 407 cfunction_enter_call(PyThreadState *tstate, PyObject *func) in cfunction_enter_call() argument 409 if (_Py_EnterRecursiveCall(tstate, " while calling a Python object")) { in cfunction_enter_call() 420 PyThreadState *tstate = _PyThreadState_GET(); in cfunction_vectorcall_FASTCALL() local 421 if (cfunction_check_kwargs(tstate, func, kwnames)) { in cfunction_vectorcall_FASTCALL() 426 cfunction_enter_call(tstate, func); in cfunction_vectorcall_FASTCALL() 431 _Py_LeaveRecursiveCall(tstate); in cfunction_vectorcall_FASTCALL() 439 PyThreadState *tstate = _PyThreadState_GET(); in cfunction_vectorcall_FASTCALL_KEYWORDS() local [all …]
|
D | object.c | 426 PyThreadState *tstate = _PyThreadState_GET(); in PyObject_Repr() local 431 assert(!_PyErr_Occurred(tstate)); in PyObject_Repr() 436 if (_Py_EnterRecursiveCall(tstate, in PyObject_Repr() 441 _Py_LeaveRecursiveCall(tstate); in PyObject_Repr() 447 _PyErr_Format(tstate, PyExc_TypeError, in PyObject_Repr() 486 PyThreadState *tstate = _PyThreadState_GET(); in PyObject_Str() local 491 assert(!_PyErr_Occurred(tstate)); in PyObject_Str() 496 if (_Py_EnterRecursiveCall(tstate, " while getting the str of an object")) { in PyObject_Str() 500 _Py_LeaveRecursiveCall(tstate); in PyObject_Str() 506 _PyErr_Format(tstate, PyExc_TypeError, in PyObject_Str() [all …]
|
D | abstract.c | 28 PyThreadState *tstate = _PyThreadState_GET(); in null_error() local 29 if (!_PyErr_Occurred(tstate)) { in null_error() 30 _PyErr_SetString(tstate, PyExc_SystemError, in null_error() 99 PyThreadState *tstate = _PyThreadState_GET(); in PyObject_LengthHint() local 100 assert(_PyErr_Occurred(tstate)); in PyObject_LengthHint() 101 if (!_PyErr_ExceptionMatches(tstate, PyExc_TypeError)) { in PyObject_LengthHint() 104 _PyErr_Clear(tstate); in PyObject_LengthHint() 120 PyThreadState *tstate = _PyThreadState_GET(); in PyObject_LengthHint() local 121 if (_PyErr_ExceptionMatches(tstate, PyExc_TypeError)) { in PyObject_LengthHint() 122 _PyErr_Clear(tstate); in PyObject_LengthHint() [all …]
|
/third_party/python/Parser/ |
D | myreadline.c | 30 my_fgets(PyThreadState* tstate, char *buf, int len, FILE *fp) in my_fgets() argument 90 PyEval_RestoreThread(tstate); in my_fgets() 102 if (_PyOS_InterruptOccurred(tstate)) { in my_fgets() 116 _PyOS_WindowsConsoleReadline(PyThreadState *tstate, HANDLE hStdIn) in _PyOS_WindowsConsoleReadline() argument 151 PyEval_RestoreThread(tstate); in _PyOS_WindowsConsoleReadline() 173 PyEval_RestoreThread(tstate); in _PyOS_WindowsConsoleReadline() 182 PyEval_RestoreThread(tstate); in _PyOS_WindowsConsoleReadline() 197 PyEval_RestoreThread(tstate); in _PyOS_WindowsConsoleReadline() 210 PyEval_RestoreThread(tstate); in _PyOS_WindowsConsoleReadline() 228 PyEval_RestoreThread(tstate); in _PyOS_WindowsConsoleReadline() [all …]
|
/third_party/python/Include/cpython/ |
D | abstract.h | 37 PyThreadState *tstate, 48 PyThreadState *tstate, 99 _PyObject_VectorcallTstate(PyThreadState *tstate, PyObject *callable, in _PyObject_VectorcallTstate() argument 112 return _PyObject_MakeTpCall(tstate, callable, args, nargs, kwnames); in _PyObject_VectorcallTstate() 115 return _Py_CheckFunctionResult(tstate, callable, res, NULL); in _PyObject_VectorcallTstate() 122 PyThreadState *tstate = PyThreadState_Get(); in PyObject_Vectorcall() local 123 return _PyObject_VectorcallTstate(tstate, callable, in PyObject_Vectorcall() 149 _PyObject_FastCallTstate(PyThreadState *tstate, PyObject *func, PyObject *const *args, Py_ssize_t n… in _PyObject_FastCallTstate() argument 151 return _PyObject_VectorcallTstate(tstate, func, args, (size_t)nargs, NULL); in _PyObject_FastCallTstate() 158 PyThreadState *tstate = PyThreadState_Get(); in _PyObject_FastCall() local [all …]
|
D | ceval.h | 6 PyAPI_DATA(int) _PyEval_SetProfile(PyThreadState *tstate, Py_tracefunc func, PyObject *arg); 8 PyAPI_FUNC(int) _PyEval_SetTrace(PyThreadState *tstate, Py_tracefunc func, PyObject *arg); 22 PyAPI_FUNC(PyObject *) _PyEval_EvalFrameDefault(PyThreadState *tstate, PyFrameObject *f, int exc);
|
/third_party/python/Modules/ |
D | gcmodule.c | 932 handle_legacy_finalizers(PyThreadState *tstate, in handle_legacy_finalizers() argument 936 assert(!_PyErr_Occurred(tstate)); in handle_legacy_finalizers() 945 _PyErr_Clear(tstate); in handle_legacy_finalizers() 959 finalize_garbage(PyThreadState *tstate, PyGC_Head *collectable) in finalize_garbage() argument 983 assert(!_PyErr_Occurred(tstate)); in finalize_garbage() 995 delete_garbage(PyThreadState *tstate, GCState *gcstate, in delete_garbage() argument 998 assert(!_PyErr_Occurred(tstate)); in delete_garbage() 1010 _PyErr_Clear(tstate); in delete_garbage() 1018 if (_PyErr_Occurred(tstate)) { in delete_garbage() 1183 gc_collect_main(PyThreadState *tstate, int generation, in gc_collect_main() argument [all …]
|
D | faulthandler.c | 212 PyThreadState *tstate = _PyThreadState_GET(); in get_thread_state() local 213 if (tstate == NULL) { in get_thread_state() 219 return tstate; in get_thread_state() 227 PyThreadState *tstate; in faulthandler_dump_traceback() local 242 tstate = PyGILState_GetThisThreadState(); in faulthandler_dump_traceback() 245 (void)_Py_DumpTracebackThreads(fd, NULL, tstate); in faulthandler_dump_traceback() 248 if (tstate != NULL) in faulthandler_dump_traceback() 249 _Py_DumpTraceback(fd, tstate); in faulthandler_dump_traceback() 262 PyThreadState *tstate; in faulthandler_dump_traceback_py() local 275 tstate = get_thread_state(); in faulthandler_dump_traceback_py() [all …]
|
D | signalmodule.c | 516 PyThreadState *tstate = _PyThreadState_GET(); in signal_signal_impl() local 517 if (!_Py_ThreadCanHandleSignals(tstate->interp)) { in signal_signal_impl() 518 _PyErr_SetString(tstate, PyExc_ValueError, in signal_signal_impl() 524 _PyErr_SetString(tstate, PyExc_ValueError, in signal_signal_impl() 535 _PyErr_SetString(tstate, PyExc_TypeError, in signal_signal_impl() 545 if (_PyErr_CheckSignalsTstate(tstate)) { in signal_signal_impl() 754 PyThreadState *tstate = _PyThreadState_GET(); local 755 if (!_Py_ThreadCanHandleSignals(tstate->interp)) { 756 _PyErr_SetString(tstate, PyExc_ValueError, 784 _PyErr_SetString(tstate, PyExc_ValueError, "invalid fd"); [all …]
|
D | _threadmodule.c | 855 PyThreadState *tstate = PyInterpreterState_ThreadHead(interp); in local_clear() local 856 for(; tstate; tstate = PyThreadState_Next(tstate)) { in local_clear() 857 if (tstate->dict == NULL) { in local_clear() 860 PyObject *v = _PyDict_Pop(tstate->dict, self->key, Py_None); in local_clear() 1063 PyThreadState *tstate; member 1082 PyThreadState *tstate; in thread_run() local 1084 tstate = boot->tstate; in thread_run() 1085 tstate->thread_id = PyThread_get_thread_ident(); in thread_run() 1086 _PyThreadState_Init(tstate); in thread_run() 1087 PyEval_AcquireThread(tstate); in thread_run() [all …]
|