summaryrefslogtreecommitdiffstats
path: root/Include/cpython/frameobject.h
Commit message (Collapse)AuthorAgeFilesLines
* gh-93937, C API: Move PyFrame_GetBack() to Python.h (#93938)Victor Stinner2022-06-191-13/+0
| | | | | | | | | | | | | | | | Move the follow functions and type from frameobject.h to pyframe.h, so the standard <Python.h> provide frame getter functions: * PyFrame_Check() * PyFrame_GetBack() * PyFrame_GetBuiltins() * PyFrame_GetGenerator() * PyFrame_GetGlobals() * PyFrame_GetLasti() * PyFrame_GetLocals() * PyFrame_Type Remove #include "frameobject.h" from many C files. It's no longer needed.
* gh-87347: Add parenthesis around PyXXX_Check() arguments (#92815)Victor Stinner2022-06-161-1/+1
|
* gh-91502: Add a new API to check if a frame is an entry frame (GH-91503)Pablo Galindo Salgado2022-04-131-0/+10
|
* Add new PyFrame_GetLasti C-API function (GH-32413)Mark Shannon2022-04-081-0/+1
|
* bpo-40421: Add missing getters for frame object attributes to C-API. (GH-32114)Mark Shannon2022-03-311-0/+5
|
* bpo-42197: Don't create `f_locals` dictionary unless we actually need it. ↵Mark Shannon2022-03-251-0/+1
| | | | | | | | | | | (GH-32055) * `PyFrame_FastToLocalsWithError` and `PyFrame_LocalsToFast` are no longer called during profile and tracing. (Contributed by Fabio Zadrozny) * Make accesses to a frame's `f_locals` safe from C code, not relying on calls to `PyFrame_FastToLocals` or `PyFrame_LocalsToFast`. * Document new `PyFrame_GetLocals` C-API function.
* bpo-45786: Remove _PyFrame_Fini() and _PyFrame_DebugMallocStats() (GH-31874)Victor Stinner2022-03-181-2/+0
| | | | Remove private empty _PyFrame_Fini() and _PyFrame_DebugMallocStats() functions.
* bpo-45316: Move private functions to internal C API (GH-31579)Victor Stinner2022-02-251-5/+0
| | | | | | | | | Move the unexported private functions to the internal C API: * pycore_frame.h: _PyFrame_New_NoTrack() * pycore_function.h: _PyFunction_GetVersionForCurrentState() * pycore_genobject.h: _PyAsyncGenValueWrapperNew() * pycore_genobject.h: _PyCoro_GetAwaitableIter() * pycore_genobject.h: _PyGen_yf()
* bpo-46836: Move PyFrameObject to pycore_frame.h (GH-31530)Victor Stinner2022-02-251-13/+0
| | | | Move the PyFrameObject type definition (struct _frame) to the internal C API pycore_frame.h header file.
* bpo-45459: C API uses type names rather than structure names (GH-31528)Victor Stinner2022-02-241-1/+1
| | | | Thanks to the new pytypedefs.h, it becomes to use type names like PyObject rather like structure names like "struct _object".
* bpo-45786: Allocate space for frame in frame object. (GH-29729)Mark Shannon2021-11-291-2/+4
|
* bpo-44590: Lazily allocate frame objects (GH-27077)Mark Shannon2021-07-261-35/+2
| | | | | | | | | | | | | | * 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.
* bpo-44032: Move pointer to code object from frame-object to frame specials ↵Mark Shannon2021-06-181-1/+0
| | | | array. (GH-26771)
* bpo-44032: Move data stack to thread from FrameObject. (GH-26076)Mark Shannon2021-05-211-6/+4
| | | | | | | | | | | | | | | | * Remove 'zombie' frames. We won't need them once we are allocating fixed-size frames. * Add co_nlocalplus field to code object to avoid recomputing size of locals + frees + cells. * Move locals, cells and freevars out of frame object into separate memory buffer. * Use per-threadstate allocated memory chunks for local variables. * Move globals and builtins from frame object to per-thread stack. * Move (slow) locals frame object to per-thread stack. * Move internal frame functions to internal header.
* Remove PyTryblock struct (GH-26059)Mark Shannon2021-05-121-6/+0
|
* bpo-40222: "Zero cost" exception handling (GH-25729)Mark Shannon2021-05-071-12/+3
| | | | | | | | "Zero cost" exception handling. * Uses a lookup table to determine how to handle exceptions. * Removes SETUP_FINALLY and POP_TOP block instructions, eliminating (most of) the runtime overhead of try statements. * Reduces the size of the frame object by about 60%.
* bpo-42990: Refactor _PyFrame_New_NoTrack() (GH-24566)Victor Stinner2021-02-181-2/+0
| | | | | | | | | | | | * Refactor _PyFrame_New_NoTrack() and PyFunction_NewWithQualName() code. * PyFrame_New() checks for _PyEval_BuiltinsFromGlobals() failure. * Fix a ref leak in _PyEval_BuiltinsFromGlobals() error path. * Complete PyFunction_GetModule() documentation: it returns a borrowed reference and it can return NULL. * Move _PyEval_BuiltinsFromGlobals() definition to the internal C API. * PyFunction_NewWithQualName() uses _Py_IDENTIFIER() API for the "__name__" string to make it compatible with subinterpreters.
* bpo-42990: Further refactoring of PyEval_ functions. (GH-24368)Mark Shannon2021-02-011-2/+2
| | | | | | | | | | * Further refactoring of PyEval_EvalCode and friends. Break into make-frame, and eval-frame parts. * Simplify function vector call using new _PyEval_Vector. * Remove unused internal functions: _PyEval_EvalCodeWithName and _PyEval_EvalCode. * Don't use legacy function PyEval_EvalCodeEx.
* bpo-42990: Introduce 'frame constructor' struct to simplify API for ↵Mark Shannon2021-01-291-1/+3
| | | | | | | PyEval_CodeEval and friends (GH-24298) * Introduce 'frame constructor' to simplify API for frame creation * Embed struct using a macro to conform to PEP 7
* bpo-42823: Fix frame lineno when frame.f_trace is set (GH-24099)Mark Shannon2021-01-051-6/+1
| | | | | | | | | * Add test for frame.f_lineno with/without tracing. * Make sure that frame.f_lineno is correct regardless of whether frame.f_trace is set. * Update importlib * Add NEWS
* bpo-40941: Unify implicit and explicit state in the frame and generator ↵Mark Shannon2020-07-171-5/+28
| | | | | | | objects into a single value. (GH-20803) * Merge gen and frame state variables into one. * Replace stack pointer with depth in PyFrameObject. Makes code easier to read and saves a word of memory.
* bpo-39583: Remove superfluous "extern C" bits from Include/cpython/*.h ↵Skip Montanaro2020-06-011-8/+0
| | | | (GH-18413)
* bpo-40421: Add PyFrame_GetBack() function (GH-19765)Victor Stinner2020-04-291-0/+2
| | | | | | New PyFrame_GetBack() function: get the frame next outer frame. Replace frame->f_back with PyFrame_GetBack(frame) in most code but frameobject.c, ceval.c and genobject.c.
* bpo-40428: Remove PyTuple_ClearFreeList() function (GH-19769)Victor Stinner2020-04-291-2/+0
| | | | | | | | | | | | | | | | | | | Remove the following function from the C API: * PyAsyncGen_ClearFreeLists() * PyContext_ClearFreeList() * PyDict_ClearFreeList() * PyFloat_ClearFreeList() * PyFrame_ClearFreeList() * PyList_ClearFreeList() * PySet_ClearFreeList() * PyTuple_ClearFreeList() Make these functions private, move them to the internal C API and change their return type to void. Call explicitly PyGC_Collect() to free all free lists. Note: PySet_ClearFreeList() did nothing.
* bpo-40421: Add pyframe.h header file (GH-19755)Victor Stinner2020-04-281-5/+2
| | | | | | | | | | Add a new separated pyframe.h header file of the PyFrame public C API: it is included by Python.h. Add PyFrame_GetLineNumber() to the limited C API. Replace "struct _frame" with "PyFrameObject" in header files. PyFrameObject is now defined as struct _frame by pyframe.h which is included early enough in Python.h.
* bpo-39573: Clean up modules and headers to use Py_IS_TYPE() function (GH-18521)Dong-hee Na2020-02-171-1/+1
|
* bpo-35134: Migrate frameobject.h contents to cpython/frameobject.h (GH-18052)Nick Coghlan2020-01-201-0/+87