GH-108035: Remove the _PyCFrame struct as it is no longer needed for performance. (GH-108036)

This commit is contained in:
Mark Shannon 2023-08-17 11:16:03 +01:00 committed by GitHub
parent 33e6e3fec0
commit 006e44f950
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
21 changed files with 66 additions and 103 deletions

View file

@ -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);