mirror of
https://github.com/python/cpython.git
synced 2025-12-31 04:23:37 +00:00
bpo-44590: Lazily allocate frame objects (GH-27077)
* Convert "specials" array to InterpreterFrame struct, adding f_lasti, f_state and other non-debug FrameObject fields to it. * Refactor, calls pushing the call to the interpreter upward toward _PyEval_Vector. * Compute f_back when on thread stack, only filling in value when frame object outlives stack invocation. * Move ownership of InterpreterFrame in generator from frame object to generator object. * Do not create frame objects for Python calls. * Do not create frame objects for generators.
This commit is contained in:
parent
0363a4014d
commit
ae0a2b7562
27 changed files with 1037 additions and 619 deletions
|
|
@ -232,7 +232,7 @@ offer_suggestions_for_name_error(PyNameErrorObject *exc)
|
|||
return suggestions;
|
||||
}
|
||||
|
||||
dir = PySequence_List(_PyFrame_GetGlobals(frame));
|
||||
dir = PySequence_List(frame->f_frame->f_globals);
|
||||
if (dir == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
|
@ -242,7 +242,7 @@ offer_suggestions_for_name_error(PyNameErrorObject *exc)
|
|||
return suggestions;
|
||||
}
|
||||
|
||||
dir = PySequence_List(_PyFrame_GetBuiltins(frame));
|
||||
dir = PySequence_List(frame->f_frame->f_builtins);
|
||||
if (dir == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue