summaryrefslogtreecommitdiffstats
path: root/Python/ceval.c
Commit message (Collapse)AuthorAgeFilesLines
* GH-101578: Normalize the current exception (GH-101607)Mark Shannon2023-02-081-7/+5
| | | | | | | | | | * Make sure that the current exception is always normalized. * Remove redundant type and traceback fields for the current exception. * Add new API functions: PyErr_GetRaisedException, PyErr_SetRaisedException * Add new API functions: PyException_GetArgs, PyException_SetArgs
* gh-101072: support default and kw default in PyEval_EvalCodeEx for 3.11+ ↵Matthieu Dartiailh2023-02-071-3/+0
| | | | | (#101127) Co-authored-by: Łukasz Langa <lukasz@langa.pl>
* Fix some comments in ceval.c and fix lltrace output (#101297)Guido van Rossum2023-01-241-6/+4
| | | | | The comment at the top was rather outdated. :-) Also added a note about the dangers of dump_stack().
* gh-98831: rewrite CHECK_EG_MATCH opcode in the instruction definition DSL ↵Irit Katriel2023-01-241-1/+1
| | | | (#101269)
* GH-98831: Move assorted macros from ceval.h to a new header (#101116)Guido van Rossum2023-01-181-348/+1
|
* GH-100892: consolidate `HEAD_LOCK/HEAD_UNLOCK` macros (#100953)Kumar Aditya2023-01-151-5/+0
|
* GH-100126: Skip incomplete frames in more places (GH-100613)Brandt Bucher2023-01-091-7/+4
|
* gh-100758: Refactor initialisation of frame headers into a single function ↵Irit Katriel2023-01-061-4/+1
| | | | (_PyFrame_Initialize) (GH-100759)
* GH-99005: Add `CALL_INTRINSIC_1` instruction (GH-100771)Mark Shannon2023-01-051-90/+1
| | | | | | | | * Remove PRINT_EXPR instruction * Remove STOPITERATION_ERROR instruction * Remove IMPORT_STAR instruction
* GH-100719: Remove the `co_nplaincellvars` field from code objects. (GH-100721)Mark Shannon2023-01-041-1/+1
|
* GH-100222: Redefine _Py_CODEUNIT as a union to clarify structure of code ↵Mark Shannon2022-12-141-2/+2
| | | | unit. (GH-100223)
* GH-99729: Unlink frames before clearing them (GH-100030)Brandt Bucher2022-12-061-9/+4
|
* gh-88226: Emit TARGET labels in Python/ceval.c when debugging, even if ↵Skip Montanaro2022-11-221-4/+21
| | | | | | | computed gotos aren't enabled (GH-98265) Keep target labels when debugging, but don't warn about lack of use. Co-authored-by: Eryk Sun <eryksun@gmail.com>
* Add a macro for "inlining" new frames (GH-99490)Brandt Bucher2022-11-171-0/+10
|
* GH-96421: Insert shim frame on entry to interpreter (GH-96319)Mark Shannon2022-11-101-39/+41
| | | | | | * Adds EXIT_INTERPRETER instruction to exit PyEval_EvalDefault() * Simplifies RETURN_VALUE, YIELD_VALUE and RETURN_GENERATOR instructions as they no longer need to check for entry frames.
* gh-99300: Use Py_NewRef() in Python/ceval.c (#99318)Victor Stinner2022-11-101-16/+8
| | | | Replace Py_INCREF() and Py_XINCREF() with Py_NewRef() and Py_XNewRef() in Python/ceval.c and related files.
* GH-98686: Get rid of "adaptive" and "quick" instructions (GH-99182)Brandt Bucher2022-11-091-34/+64
|
* GH-98831: Simple input-output stack effects for bytecodes.c (#99120)Guido van Rossum2022-11-081-0/+9
|
* GH-96793: Specialize FOR_ITER for generators. (GH-98772)Mark Shannon2022-11-071-3/+36
|
* GH-98686: Fix compiler warning for HAS_ARG (GH-99106)Brandt Bucher2022-11-041-1/+1
|
* GH-98831: "Generate" the interpreter (#98830)Guido van Rossum2022-11-031-3850/+1
| | | | | | | | | | | The switch cases (really TARGET(opcode) macros) have been moved from ceval.c to generated_cases.c.h. That file is generated from instruction definitions in bytecodes.c (which impersonates a C file so the C code it contains can be edited without custom support in e.g. VS Code). The code generator lives in Tools/cases_generator (it has a README.md explaining how it works). The DSL used to describe the instructions is a work in progress, described in https://github.com/faster-cpython/ideas/blob/main/3.12/interpreter_definition.md. This is surely a work-in-progress. An easy next step could be auto-generating super-instructions. **IMPORTANT: Merge Conflicts** If you get a merge conflict for instruction implementations in ceval.c, your best bet is to port your changes to bytecodes.c. That file looks almost the same as the original cases, except instead of `TARGET(NAME)` it uses `inst(NAME)`, and the trailing `DISPATCH()` call is omitted (the code generator adds it automatically).
* GH-98686: Quicken everything (GH-98687)Brandt Bucher2022-11-021-21/+9
|
* Rename JUMP_TO_INSTRUCTION to GO_TO_INSTRUCTION (#98934)Guido van Rossum2022-11-011-14/+14
| | | | | | This reduces confusion between jumps at the bytecode level (e.g. JUMPTO(), JUMPBY(), and various JUMP_*() opcodes) and jumps in the C code (which are 'goto' statements).
* gh-98879: Remove unreachable error case from COMPARE_OP_STR_JUMP (GH-98882)Dennis Sweeney2022-10-301-3/+0
| | | Thanks to PEP 623 changes, the comparison cannot fail.
* gh-98789: Fix FOR_ITER assert on big-endian (GH-98792)Dennis Sweeney2022-10-281-1/+1
| | | Fix FOR_ITER assertion syntax
* GH-96793: Change `FOR_ITER` to not pop the iterator on exhaustion. (GH-96801)Mark Shannon2022-10-271-3/+13
| | | | 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-91058: Add error suggestions to 'import from' import errors (#98305)Pablo Galindo Salgado2022-10-251-2/+2
|
* gh-98257: Make _PyEval_SetTrace() reentrant (#98258)Victor Stinner2022-10-191-44/+13
| | | | | | | | | | Make sys.setprofile() and sys.settrace() functions reentrant. They can no long fail with: RuntimeError("Cannot install a trace function while another trace function is being installed"). Make _PyEval_SetTrace() and _PyEval_SetProfile() functions reentrant, rather than detecting and rejecting reentrant calls. Only delete the reference to function arguments once the new function is fully set, when a reentrant call is safe. Call also _PySys_Audit() earlier.
* Fix some incorrect indentation around the main switch (#98177)Guido van Rossum2022-10-111-21/+20
| | | | | | The `}` marked with `/* End instructions */` is the end of the switch. There is another pair of `{}` around the switch, which is vestigial from ancient times when it was `for (;;) { switch (opcode) { ... } }`. All `DISPATCH` macro calls should be inside that pair.
* GH-91052: Add C API for watching dictionaries (GH-31787)Carl Meyer2022-10-071-1/+4
|
* GH-91079: Decouple C stack overflow checks from Python recursion checks. ↵Mark Shannon2022-10-051-24/+57
| | | | (GH-96510)
* gh-97670: Remove sys.getdxp() and analyze_dxp.py script (#97671)Victor Stinner2022-10-041-55/+0
| | | | | | | Remove the sys.getdxp() function and the Tools/scripts/analyze_dxp.py script. DXP stands for "dynamic execution pairs". They were related to DYNAMIC_EXECUTION_PROFILE and DXPAIRS macros which have been removed in Python 3.11. Python can now be built with "./configure --enable-pystats" to gather statistics on Python opcodes.
* GH-96975: Skip incomplete frames in PyEval_GetFrame (GH-97003)Brandt Bucher2022-09-221-3/+6
|
* gh-96711: Enhance SystemError message upon Invalid opcode (#96712)serge-sans-paille2022-09-201-3/+5
| | | | | | Raise verbose SystemError instead of printing debug information upon Invalid opcode. Fix #96711
* GH-96864: Check for error between line and opcode events (GH-96880)Brandt Bucher2022-09-191-1/+1
|
* GH-91049: Introduce set vectorcall field API for PyFunctionObject (GH-92257)adphrost2022-09-151-2/+8
| | | | Co-authored-by: Andrew Frost <adfrost@fb.com> Co-authored-by: Itamar Ostricher <itamarost@gmail.com>
* gh-96751: Remove dead code from `CALL_FUNCTION_EX` opcode (GH-96752)Nikita Sobolev2022-09-151-13/+2
|
* ceval: Use _PyTuple_FromArraySteal in BUILD_TUPLE (GH-96516)Kevin Modzelewski2022-09-141-5/+2
|
* GH-96754: Check whether the interpreter frame is complete before creating ↵Mark Shannon2022-09-131-3/+5
| | | | frame object. (GH-96776)
* GH-96678: Fix undefined behavior in ceval.c (#96708)Mark Shannon2022-09-101-1/+7
|
* Replace ad-hoc labels with JUMP_TO_INSTRUCTION (GH-96634)Brandt Bucher2022-09-091-4/+4
|
* GH-96636: Remove all uses of NOTRACE_DISPATCH (GH-96643)Mark Shannon2022-09-081-62/+59
| | | Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
* gh-96653: Remove duplicate CALL_STAT_INC(inlined_py_calls) in ↵Itamar Ostricher2022-09-081-1/+0
| | | | BINARY_SUBSCR_GETITEM (GH-96654)
* GH-91432: Remove the iterator_exhausted_no_error label (GH-96517)Brandt Bucher2022-09-071-16/+20
|
* GH-96572: fix use after free in trace refs build mode (#96618)Kumar Aditya2022-09-061-1/+1
|
* ceval.c's GETITEM should have asserts, not set exceptions (GH-96518)Dennis Sweeney2022-09-041-2/+8
|
* gh-93554: Conditional jump opcodes only jump forward (GH-96318)Irit Katriel2022-09-011-129/+18
|
* Remove the binary_subscr_dict_error label (GH-96443)Brandt Bucher2022-08-301-11/+4
|
* GH-96237: Allow non-functions as reference-holder in frames. (GH-96238)Mark Shannon2022-08-251-5/+9
|
* GH-93503: Add thread-specific APIs to set profiling and tracing functions in ↵Pablo Galindo Salgado2022-08-241-0/+45
| | | | | | | | | | | | | | | | | the C-API (#93504) * gh-93503: Add APIs to set profiling and tracing functions in all threads in the C-API * Use a separate API * Fix NEWS entry * Add locks around the loop * Document ignoring exceptions * Use the new APIs in the sys module * Update docs