summaryrefslogtreecommitdiffstats
path: root/Objects/frameobject.c
Commit message (Collapse)AuthorAgeFilesLines
* GH-98686: Quicken everything (GH-98687)Brandt Bucher2022-11-021-1/+1
|
* GH-96793: Change `FOR_ITER` to not pop the iterator on exhaustion. (GH-96801)Mark Shannon2022-10-271-2/+2
| | | | Change FOR_ITER to have the same stack effect regardless of whether it branches or not. Performance is unchanged as FOR_ITER (and specialized forms jump over the cleanup code).
* gh-95756: Free and NULL-out code caches when needed (GH-98181)Ken Jin2022-10-111-0/+2
|
* gh-95756: Lazily created cached co_* attrs (GH-97791)Ken Jin2022-10-111-2/+5
|
* GH-97779: Ensure that *all* frame objects are backed by "complete" frames ↵Brandt Bucher2022-10-051-1/+15
| | | | (GH-97845)
* gh-93554: Conditional jump opcodes only jump forward (GH-96318)Irit Katriel2022-09-011-16/+3
|
* GH-96237: Allow non-functions as reference-holder in frames. (GH-96238)Mark Shannon2022-08-251-3/+5
|
* GH-94438: Handle extended arguments and conditional pops in mark_stacks ↵Brandt Bucher2022-07-221-4/+9
| | | | (GH-95110)
* GH-94979: Pop the exception stack when jumping out of exception handlers. ↵Mark Shannon2022-07-191-9/+52
| | | | (#95003)
* GH-94893: Ignore caches when adding LOAD_FAST_CHECKs (GH-94894)Brandt Bucher2022-07-181-1/+3
|
* GH-94739: Mark stacks of exception handling blocks for setting ↵Mark Shannon2022-07-181-11/+121
| | | | frame.f_lineno in the debugger. (GH-94958)
* gh-94438: in frameobject's mark_stacks switch, the PUSH_EXC_INFO and ↵Irit Katriel2022-07-061-8/+10
| | | | POP_EXCEPT cases are no longer reachable (GH-94582)
* GH-94438: Account for NULLs on evaluation stack when jumping lines. (GH-94444)Mark Shannon2022-07-011-13/+43
|
* GH-94262: Don't create frame objects for frames that aren't yet complete. ↵Mark Shannon2022-07-011-2/+8
| | | | (GH-94371)
* GH-91742: Fix pdb crash after jump (GH-94171)Kumar Aditya2022-06-231-1/+1
|
* GH-91432: Specialize FOR_ITER (GH-91713)Dennis Sweeney2022-06-211-1/+1
| | | | | * Adds FOR_ITER_LIST and FOR_ITER_RANGE specializations. * Adds _PyLong_AssignValue() internal function to avoid temporary boxing of ints.
* GH-93897: Store frame size in code object and de-opt if insufficient space ↵Mark Shannon2022-06-201-1/+2
| | | | on thread frame stack. (GH-93908)
* gh-93382: Cache result of `PyCode_GetCode` in codeobject (GH-93383)Ken Jin2022-06-031-0/+8
| | | | Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com> Co-authored-by: Dennis Sweeney <36520290+sweeneyde@users.noreply.github.com>
* gh-93143: Avoid NULL check in LOAD_FAST based on analysis in the compiler ↵Dennis Sweeney2022-05-311-0/+27
| | | | (GH-93144)
* gh-89653: PEP 670: Convert PyCell macros to functions (#92653)Victor Stinner2022-05-111-1/+1
| | | | | | | | | | | Convert the following macros to static inline functions: * PyCell_GET() * PyCell_SET() Limited C API version 3.12 no longer casts arguments. Fix also usage of PyCell_SET(): only delete the old value after setting the new value.
* gh-91719: Add pycore_opcode.h internal header file (#91906)Victor Stinner2022-04-251-2/+3
| | | | | | | | | | | Move the following API from Include/opcode.h (public C API) to a new Include/internal/pycore_opcode.h header file (internal C API): * EXTRA_CASES * _PyOpcode_Caches * _PyOpcode_Deopt * _PyOpcode_Jump * _PyOpcode_OpName * _PyOpcode_RelativeJump
* GH-88116: Use a compact format to represent end line and column offsets. ↵Mark Shannon2022-04-211-1/+5
| | | | | | | | | | | | (GH-91666) * Stores all location info in linetable to conform to PEP 626. * Remove column table from code objects. * Remove end-line table from code objects. * Document new location table format
* bpo-40421: Cleanup PyFrame C API (GH-32417)Victor Stinner2022-04-191-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/+8
|
* bpo-47120: make POP_JUMP_IF_TRUE/FALSE/NONE/NOT_NONE relative (GH-32400)Irit Katriel2022-04-111-2/+12
|
* Add new PyFrame_GetLasti C-API function (GH-32413)Mark Shannon2022-04-081-1/+11
|
* bpo-47177: Replace `f_lasti` with `prev_instr` (GH-32208)Brandt Bucher2022-04-071-17/+18
|
* bpo-47120: make JUMP_NO_INTERRUPT relative (GH-32221)Irit Katriel2022-04-051-9/+5
|
* bpo-47186: Replace JUMP_IF_NOT_EG_MATCH by CHECK_EG_MATCH + jump (GH-32309)Irit Katriel2022-04-051-8/+2
|
* bpo-47186: Replace JUMP_IF_NOT_EXC_MATCH by CHECK_EXC_MATCH + jump (GH-32231)Irit Katriel2022-04-011-3/+1
|
* bpo-40421: Add missing getters for frame object attributes to C-API. (GH-32114)Mark Shannon2022-03-311-0/+22
|
* bpo-47120: Replace the JUMP_ABSOLUTE opcode by the relative JUMP_BACKWARD ↵Irit Katriel2022-03-311-1/+6
| | | | (GH-32115)
* bpo-42197: Don't create `f_locals` dictionary unless we actually need it. ↵Mark Shannon2022-03-251-6/+17
| | | | | | | | | | | (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-47045: Remove `f_state` field (GH-31963)Mark Shannon2022-03-221-42/+83
| | | | | * Remove the f_state field from _PyInterpreterFrame * Make ownership of the frame explicit, replacing the is_generator field with an owner field.
* bpo-46841: Quicken code in-place (GH-31888)Brandt Bucher2022-03-211-9/+30
| | | | | | | | | | | | | | | | | | | * Moves the bytecode to the end of the corresponding PyCodeObject, and quickens it in-place. * Removes the almost-always-unused co_varnames, co_freevars, and co_cellvars member caches * _PyOpcode_Deopt is a new mapping from all opcodes to their un-quickened forms. * _PyOpcode_InlineCacheEntries is renamed to _PyOpcode_Caches * _Py_IncrementCountAndMaybeQuicken is renamed to _PyCode_Warmup * _Py_Quicken is renamed to _PyCode_Quicken * _co_quickened is renamed to _co_code_adaptive (and is now a read-only memoryview). * Do not emit unused nonzero opargs anymore in the compiler.
* bpo-45786: Remove _PyFrame_Fini() and _PyFrame_DebugMallocStats() (GH-31874)Victor Stinner2022-03-181-11/+0
| | | | Remove private empty _PyFrame_Fini() and _PyFrame_DebugMallocStats() functions.
* bpo-46836: Rename InterpreterFrame to _PyInterpreterFrame (GH-31583)Victor Stinner2022-02-251-10/+10
| | | | | Rename also struct _interpreter_frame to struct _PyInterpreterFrame. Reduce risk of name conflicts if a project includes pycore_frame.h.
* bpo-45316: Move private PyCode C API to internal C API (GH-31576)Victor Stinner2022-02-251-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Rename private functions (no exported), add an underscore prefix: * PyLineTable_InitAddressRange() => _PyLineTable_InitAddressRange() * PyLineTable_NextAddressRange() => _PyLineTable_NextAddressRange() * PyLineTable_PreviousAddressRange() => _PyLineTable_PreviousAddressRange() Move private functions to the internal C API: * _PyCode_Addr2EndLine() * _PyCode_Addr2EndOffset() * _PyCode_Addr2Offset() * _PyCode_InitAddressRange() * _PyCode_InitEndAddressRange( * _PyLineTable_InitAddressRange() * _PyLineTable_NextAddressRange() * _PyLineTable_PreviousAddressRange() No longer export the following internal functions: * _PyCode_GetVarnames() * _PyCode_GetCellvars() * _PyCode_GetFreevars() * _Py_GetSpecializationStats() Add "extern" to pycore_code.h functions to identify them more easiliy (they are still not exported).
* bpo-46541: Replace core use of _Py_IDENTIFIER() with statically initialized ↵Eric Snow2022-02-081-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | global objects. (gh-30928) We're no longer using _Py_IDENTIFIER() (or _Py_static_string()) in any core CPython code. It is still used in a number of non-builtin stdlib modules. The replacement is: PyUnicodeObject (not pointer) fields under _PyRuntimeState, statically initialized as part of _PyRuntime. A new _Py_GET_GLOBAL_IDENTIFIER() macro facilitates lookup of the fields (along with _Py_GET_GLOBAL_STRING() for non-identifier strings). https://bugs.python.org/issue46541#msg411799 explains the rationale for this change. The core of the change is in: * (new) Include/internal/pycore_global_strings.h - the declarations for the global strings, along with the macros * Include/internal/pycore_runtime_init.h - added the static initializers for the global strings * Include/internal/pycore_global_objects.h - where the struct in pycore_global_strings.h is hooked into _PyRuntimeState * Tools/scripts/generate_global_objects.py - added generation of the global string declarations and static initializers I've also added a --check flag to generate_global_objects.py (along with make check-global-objects) to check for unused global strings. That check is added to the PR CI config. The remainder of this change updates the core code to use _Py_GET_GLOBAL_IDENTIFIER() instead of _Py_IDENTIFIER() and the related _Py*Id functions (likewise for _Py_GET_GLOBAL_STRING() instead of _Py_static_string()). This includes adding a few functions where there wasn't already an alternative to _Py*Id(), replacing the _Py_Identifier * parameter with PyObject *. The following are not changed (yet): * stop using _Py_IDENTIFIER() in the stdlib modules * (maybe) get rid of _Py_IDENTIFIER(), etc. entirely -- this may not be doable as at least one package on PyPI using this (private) API * (maybe) intern the strings during runtime init https://bugs.python.org/issue46541
* bpo-46670: Remove unused get_frame_state() function (GH-31177)Victor Stinner2022-02-071-9/+0
| | | The PyFrame_MAXFREELIST macro is no longer defined.
* Pass reference to func, as well as args, when pushing frame. (GH-31100)Mark Shannon2022-02-031-0/+2
|
* bpo-46072: Add some frame stats. (GH-31060)Mark Shannon2022-02-021-0/+1
|
* bpo-46409: Make generators in bytecode (GH-30633)Mark Shannon2022-01-201-3/+7
| | | | | | | | | | | | * Add RETURN_GENERATOR and JUMP_NO_INTERRUPT opcodes. * Trim frame and generator by word each. * Minor refactor of frame.c * Update test.test_sys to account for smaller frames. * Treat generator functions as normal functions when evaluating and specializing.
* bpo-46009: Remove GEN_START (GH-30367)Brandt Bucher2022-01-041-3/+5
|
* bpo-46202: Remove opcode POP_EXCEPT_AND_RERAISE (GH-30302)Irit Katriel2022-01-041-1/+0
| | | | | | * bpo-46202: remove opcode POP_EXCEPT_AND_RERAISE * do not assume that an exception group is truthy
* bpo-46039: Split yield from in two (GH-30035)Mark Shannon2021-12-151-1/+7
| | | | | | * Split YIELD_FROM opcode into SEND and JUMP_ABSOLUTE. * Remove YIELD_FROM opcode.
* bpo-45292: [PEP-654] add except* (GH-29581)Irit Katriel2021-12-141-1/+4
|
* bpo-45813: Drop redundant assertion from frame.clear() (GH-29990)Andrew Svetlov2021-12-081-1/+4
| | | | | * bpo-45813: Drop redundant assertion from frame.clear() * Move assertion to frame_dealloc()
* bpo-45786: Allocate space for frame in frame object. (GH-29729)Mark Shannon2021-11-291-115/+26
|
* bpo-44525: Copy free variables in bytecode to allow calls to inner functions ↵Mark Shannon2021-11-231-8/+24
| | | | | | | | | | | to be specialized (GH-29595) * Make internal APIs that take PyFrameConstructor take a PyFunctionObject instead. * Add reference to function to frame, borrow references to builtins and globals. * Add COPY_FREE_VARS instruction to allow specialization of calls to inner functions.