summaryrefslogtreecommitdiffstats
path: root/Python/ceval.c
Commit message (Collapse)AuthorAgeFilesLines
* 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
* GH-96177: Move GIL and eval breaker code out of ceval.c into ceval_gil.c. ↵Mark Shannon2022-08-241-641/+1
| | | | (GH-96204)
* GH-90997: Wrap yield from/await in a virtual try/except StopIteration (GH-96010)Brandt Bucher2022-08-191-0/+23
|
* GH-93911: Specialize `LOAD_ATTR` for custom `__getattribute__` (GH-93988)Ken Jin2022-08-171-2/+41
|
* Update _PyEval_AddPendingCall comment (#95817)zhanpon2022-08-111-2/+2
|
* GH-95245: Store object values and dict pointers in single tagged pointer. ↵Mark Shannon2022-08-011-9/+14
| | | | (GH-95278)
* GH-90081: Run python tracers at full speed (GH-95328)Mark Shannon2022-07-281-4/+7
|
* GH-95113: Don't use EXTENDED_ARG_QUICK in unquickened code (GH-95121)Brandt Bucher2022-07-221-0/+8
|
* GH-94739: Mark stacks of exception handling blocks for setting ↵Mark Shannon2022-07-181-14/+0
| | | | frame.f_lineno in the debugger. (GH-94958)
* GH-93252: Fix error handling for failed Python calls (GH-94693)Brandt Bucher2022-07-091-1/+5
|
* gh-94215: Fix error handling for line-tracing events (GH-94681)Brandt Bucher2022-07-081-5/+14
| | | | | * Re-enable crasher * Fix error handling for line-tracing events * blurb add
* gh-94510: Raise on re-entrant calls to sys.setprofile and sys.settrace ↵Pablo Galindo Salgado2022-07-051-2/+24
| | | | | (GH-94511) Co-authored-by: Łukasz Langa <lukasz@langa.pl>
* gh-91719: Reload opcode on unknown error so that C can optimize the ↵neonene2022-06-301-0/+3
| | | | dispatching in ceval.c (#94364)
* GH-94163: Add BINARY_SLICE and STORE_SLICE instructions. (GH-94168)Mark Shannon2022-06-271-0/+41
|
* GH-93841: Allow stats to be turned on and off, cleared and dumped at ↵Mark Shannon2022-06-211-3/+3
| | | | runtime. (GH-93843)
* GH-91432: Specialize FOR_ITER (GH-91713)Dennis Sweeney2022-06-211-12/+62
| | | | | * Adds FOR_ITER_LIST and FOR_ITER_RANGE specializations. * Adds _PyLong_AssignValue() internal function to avoid temporary boxing of ints.
* GH-93516: Speedup line number checks when tracing. (GH-93763)Mark Shannon2022-06-201-7/+9
| | | | * Use a lookup table to reduce overhead of getting line numbers during tracing.
* GH-93897: Store frame size in code object and de-opt if insufficient space ↵Mark Shannon2022-06-201-24/+14
| | | | on thread frame stack. (GH-93908)
* gh-93937, C API: Move PyFrame_GetBack() to Python.h (#93938)Victor Stinner2022-06-191-1/+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.