mirror of
https://github.com/python/cpython
synced 2026-09-29 12:10:30 +03:00
GH-108035: Remove the _PyCFrame struct as it is no longer needed for performance. (GH-108036)
This commit is contained in:
parent
33e6e3fec0
commit
006e44f950
21 changed files with 66 additions and 103 deletions
|
|
@ -476,9 +476,9 @@ _gen_throw(PyGenObject *gen, int close_on_genexit,
|
|||
will be reported correctly to the user. */
|
||||
/* XXX We should probably be updating the current frame
|
||||
somewhere in ceval.c. */
|
||||
_PyInterpreterFrame *prev = tstate->cframe->current_frame;
|
||||
_PyInterpreterFrame *prev = tstate->current_frame;
|
||||
frame->previous = prev;
|
||||
tstate->cframe->current_frame = frame;
|
||||
tstate->current_frame = frame;
|
||||
/* Close the generator that we are currently iterating with
|
||||
'yield from' or awaiting on with 'await'. */
|
||||
PyFrameState state = gen->gi_frame_state;
|
||||
|
|
@ -486,7 +486,7 @@ _gen_throw(PyGenObject *gen, int close_on_genexit,
|
|||
ret = _gen_throw((PyGenObject *)yf, close_on_genexit,
|
||||
typ, val, tb);
|
||||
gen->gi_frame_state = state;
|
||||
tstate->cframe->current_frame = prev;
|
||||
tstate->current_frame = prev;
|
||||
frame->previous = NULL;
|
||||
} else {
|
||||
/* `yf` is an iterator or a coroutine-like object. */
|
||||
|
|
@ -938,7 +938,7 @@ _Py_MakeCoro(PyFunctionObject *func)
|
|||
if (origin_depth == 0) {
|
||||
((PyCoroObject *)coro)->cr_origin_or_finalizer = NULL;
|
||||
} else {
|
||||
_PyInterpreterFrame *frame = tstate->cframe->current_frame;
|
||||
_PyInterpreterFrame *frame = tstate->current_frame;
|
||||
assert(frame);
|
||||
assert(_PyFrame_IsIncomplete(frame));
|
||||
frame = _PyFrame_GetFirstComplete(frame->previous);
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ make_union(PyObject *self, PyObject *other)
|
|||
static PyObject *
|
||||
caller(void)
|
||||
{
|
||||
_PyInterpreterFrame *f = _PyThreadState_GET()->cframe->current_frame;
|
||||
_PyInterpreterFrame *f = _PyThreadState_GET()->current_frame;
|
||||
if (f == NULL) {
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue