summaryrefslogtreecommitdiffstats
path: root/Python/ceval.c
Commit message (Collapse)AuthorAgeFilesLines
* GH-133231: Changes to executor management to support proposed `sys._jit` ↵Mark Shannon2025-05-041-19/+31
| | | | | | | | module (GH-133287) * Track the current executor, not the previous one, on the thread-state. * Batch executors for deallocation to avoid having to constantly incref executors; this is an ad-hoc form of deferred reference counting.
* Remove duplicate includes: Python/{bytecodes,ceval,optimizer_analysis}.c ↵Adam Turner2025-05-011-1/+0
| | | | (#132622)
* GH-124715: Move trashcan mechanism into `Py_Dealloc` (GH-132280)Mark Shannon2025-04-301-6/+0
|
* gh-132661: Implement PEP 750 (#132662)Lysandros Nikolaou2025-04-301-0/+2
| | | | | | | | | | | | | Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com> Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com> Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com> Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Co-authored-by: Wingy <git@wingysam.xyz> Co-authored-by: Koudai Aono <koxudaxi@gmail.com> Co-authored-by: Dave Peck <davepeck@gmail.com> Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu> Co-authored-by: Paul Everitt <pauleveritt@me.com> Co-authored-by: sobolevn <mail@sobolevn.me>
* GH-132508: Use tagged integers on the evaluation stack for the last ↵Mark Shannon2025-04-291-0/+4
| | | | instruction offset (GH-132545)
* Revert gh-127266: avoid data races when updating type slots (gh-131174) ↵Neil Schemenauer2025-04-291-14/+0
| | | | | (gh-133129) This is triggering deadlocks in test_opcache. See GH-133130 for stack trace.
* gh-127266: avoid data races when updating type slots (gh-131174)Neil Schemenauer2025-04-281-0/+14
| | | | | | | | In the free-threaded build, avoid data races caused by updating type slots or type flags after the type was initially created. For those (typically rare) cases, use the stop-the-world mechanism. Remove the use of atomics when reading or writing type flags. The use of atomics is not sufficient to avoid races (since flags are sometimes read without a lock and without atomics) and are no longer required.
* gh-132758: Fix tail call and pystats builds (GH-132759)Ken Jin2025-04-231-2/+10
|
* gh-128398: improve error messages when incorrectly using `with` and `async ↵Bénédikt Tran2025-04-191-8/+66
| | | | | | | with` (#132218) Improve the error message with a suggestion when an object supporting the synchronous (resp. asynchronous) context manager protocol is entered using `async with` (resp. `with`) instead of `with` (resp. `async with`).
* gh-129987: Selectively re-enable SLP autovectorization of ↵T. Wouters2025-04-151-4/+8
| | | | | | | | _PyEval_EvalFrameDefault (#132530) Only disable SLP autovectorization of `_PyEval_EvalFrameDefault` on newer GCCs, as the optimization bug seems to exist only on GCC 12 and later, and before GCC 9 disabling the optimization has a dramatic performance impact.
* gh-131624: Fix posix_spawn tests failing on NetBSD with stack limit ↵Furkan Onder2025-04-131-1/+1
| | | | | | assertions (GH-131625) Fix recursive limit assertions on NetBSD for posix_spawn.
* gh-132386: Fix a crash when passing a dict subclass to `exec` (GH-132412)Tomas R.2025-04-111-0/+2
| | | | | * Fix crash when passing a dict subclass to exec * Add news entry
* GH-131296: Suppress "unused label" warning for clang-cl closer to actual ↵Chris Eibl2025-04-101-2/+2
| | | | occurrence (GH-131900)
* gh-132336: Mark a few "slow path" functions used by the interpreter loop as ↵mpage2025-04-101-1/+1
| | | | | | | | | noinline (#132337) Mark a few functions used by the interpreter loop as noinline These are all the slow path and should not be inlined into the interpreter loop. Unfortunately, they end up being inlined with LTO and the current PGO task.
* gh-129987: Disable GCC SLP autovectorization for the interpreter loop on ↵mpage2025-04-091-1/+12
| | | | | x86-64 (#132295) The SLP autovectorizer can cause poor code generation for opcode dispatch, negating any benefit we get from vectorization elsewhere in the interpreter loop.
* GH-131498: Cases generator: manage stacks automatically (GH-132074)Mark Shannon2025-04-041-25/+19
|
* GH-131770: increase assumed WASI stack size to 131072 (wasi-sdk default) ↵Filipe Laíns 🇵🇸2025-04-041-1/+1
| | | | | | | (#131844) https://github.com/WebAssembly/wasi-libc/blob/e9524a0980b9bb6bb92e87a41ed1055bdda5bb86/libc-top-half/musl/src/internal/pthread_impl.h#L220 Signed-off-by: Filipe Laíns <lains@riseup.net>
* gh-131238: Remove includes from pycore_interp.h (#131495)Victor Stinner2025-03-201-5/+7
| | | Remove also now unused includes in C files.
* gh-131401: fix data races in exception handling (#131447)Kumar Aditya2025-03-201-1/+2
|
* gh-131238: Remove more includes from pycore_interp.h (#131480)Victor Stinner2025-03-191-0/+2
|
* gh-131238: Remove many includes from pycore_interp.h (#131472)Victor Stinner2025-03-191-0/+1
|
* GH-130396: Work around for broken `pthread_get_stackaddr_np` on Emscripten ↵Hood Chatham2025-03-131-0/+59
| | | | | | (#131088) Implements a workaround implementation of `pthread_get_stackaddr_np` for Emscripten. This will be replaced by an implementation that will be included in Emscripten 4.0.6.
* gh-130382: add missing `_PyReftracerTrack` to ceval `Py_DECREF` (#130689)Tomasz Pytel2025-03-131-0/+1
|
* gh-130396: Fix thread sanitizer crashes on stack overflow tests (gh-130966)Sam Gross2025-03-111-0/+5
| | | | Thread sanitizer will often crash if a test uses more than half the stack.
* GH-127705: Use `_PyStackRef`s in the default build. (GH-127875)Mark Shannon2025-03-101-20/+38
|
* gh-130163: Fix crashes related to PySys_GetObject() (GH-130503)Serhiy Storchaka2025-02-251-1/+7
| | | | | | | | The use of PySys_GetObject() and _PySys_GetAttr(), which return a borrowed reference, has been replaced by using one of the following functions, which return a strong reference and distinguish a missing attribute from an error: _PySys_GetOptionalAttr(), _PySys_GetOptionalAttrString(), _PySys_GetRequiredAttr(), and _PySys_GetRequiredAttrString().
* GH-130396: Use computed stack limits on linux (GH-130398)Mark Shannon2025-02-251-32/+106
| | | | | | | | | | | * Implement C recursion protection with limit pointers for Linux, MacOS and Windows * Remove calls to PyOS_CheckStack * Add stack protection to parser * Make tests more robust to low stacks * Improve error messages for stack overflow
* GH-91079: Revert "GH-91079: Implement C stack limits using addresses, not ↵Petr Viktorin2025-02-241-90/+32
| | | | | | | | | counters. (GH-130007)" for now (GH130413) Revert "GH-91079: Implement C stack limits using addresses, not counters. (GH-130007)" for now Unfortunatlely, the change broke some buildbots. This reverts commit 2498c22fa0a2b560491bc503fa676585c1a603d0.
* GH-91079: Implement C stack limits using addresses, not counters. (GH-130007)Mark Shannon2025-02-191-32/+90
| | | | | | | | | | | | * Implement C recursion protection with limit pointers * Remove calls to PyOS_CheckStack * Add stack protection to parser * Make tests more robust to low stacks * Improve error messages for stack overflow
* gh-129989: Change Py_TAIL_CALL_INTERP ifndef to ! (#130269)Ken Jin2025-02-181-1/+1
| | | Change Py_TAIL_CALL_INTERP ifndef to !
* gh-129989: Properly disable tailcall interp in configure (GH-129991)Ken Jin2025-02-151-4/+4
| | | Co-authored-by: Zanie Blue <contact@zanie.dev>
* GH-128682: Account for escapes in `DECREF_INPUTS` (GH-129953)Mark Shannon2025-02-121-4/+5
| | | | | | | | * Handle escapes in DECREF_INPUTS * Mark a few more functions as escaping * Replace DECREF_INPUTS with PyStackRef_CLOSE where possible
* gh-129244: Only remove the workaround when MSVC has the bugfix (#130011)Michael Droettboom2025-02-111-0/+1
|
* gh-130004: Disable PGO for ceval.c on MSVC for default build (GH-130009)Ken Jin2025-02-111-7/+2
| | | Disable PGO for ceval.c on MSVC on default build
* gh-130004: Revert commit 9e52e55 (GH-130005)Ken Jin2025-02-111-0/+21
| | | Revert commit 9e52e55
* gh-100239: replace BINARY_SUBSCR & family by BINARY_OP with oparg NB_SUBSCR ↵Irit Katriel2025-02-071-0/+1
| | | | (#129700)
* GH-129709: Clean up tier two (GH-129710)Brandt Bucher2025-02-071-33/+1
|
* GH-129763: Remove the LLTRACE macro (GH-129764)Brandt Bucher2025-02-071-7/+2
|
* gh-128563: A new tail-calling interpreter (GH-128718)Ken Jin2025-02-061-5/+18
| | | | | Co-authored-by: Garrett Gu <garrettgu777@gmail.com> Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com> Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
* GH-128682: Mark two more macros as escaping. (GH-129645)Mark Shannon2025-02-041-0/+1
| | | Expand out SETLOCAL so that code generator can see the decref. Mark Py_CLEAR as escaping
* GH-128563: Move some labels, to simplify implementing tailcalling ↵Mark Shannon2025-01-311-41/+29
| | | | interpreter. (GH-129525)
* GH-128563: Simplify recursion check in `_PyEval_EvalFrameDefault` (GH-129481)Mark Shannon2025-01-311-6/+5
| | | Simplify recursion check in _PyEval_EvalFrameDefault
* gh-128563: Move labels in ceval.c to bytecodes.c (GH-129112)Ken Jin2025-01-271-134/+0
|
* gh-128799: Add frame of except* to traceback when wrapping a naked exception ↵Irit Katriel2025-01-251-2/+12
| | | | (#128971)
* gh-129244: Remove workaround for MSVC compiler crash (#129263)Michael Droettboom2025-01-251-21/+0
| | | | | * Remove compiler workaround * Remote _Py_USING_PGO
* Remove unused DPRINTF in ceval.c (GH-129282)Chris Eibl2025-01-251-7/+0
| | | remove unused DPRINTF in ceval.c
* GH-128682: Change a couple of functions to only steal references on success. ↵Mark Shannon2025-01-221-1/+6
| | | | | (GH-129132) Change PyTuple_FromStackRefSteal and PyList_FromStackRefSteal to only steal on success to avoid escaping
* gh-128563: Move lltrace into the frame struct (GH-129113)Ken Jin2025-01-211-10/+13
|
* GH-128563: Add new frame owner type for interpreter entry frames (GH-129078)Mark Shannon2025-01-211-5/+5
| | | Add new frame owner type for interpreter entry frames
* gh-128955: Fix goto if tlbc creation fails when throwing into a generator ↵mpage2025-01-171-1/+1
| | | | | | (#128957) We don't have the correct copy of the bytecode and can't update next_instr appropriately, so just unwind.