aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Python/bytecodes.c
Commit message (Collapse)AuthorAge
* gh-130704: Strength reduce `LOAD_FAST{_LOAD_FAST}` (#130708)mpage2025-04-01
| | | Optimize `LOAD_FAST` opcodes into faster versions that load borrowed references onto the operand stack when we can prove that the lifetime of the local outlives the lifetime of the temporary that is loaded onto the stack.
* GH-131498: Another refactoring of the code generator (GH-131827)Mark Shannon2025-03-31
| | | | | | | | | | | | * Rename 'defined' attribute to 'in_local' to more accurately reflect how it is used * Make death of variables explicit even for array variables. * Convert in_memory from boolean to stack offset * Don't apply liveness analyis to optimizer generated code * Add 'out' parameter to stack.pop
* GH-131798: Remove type checks for _TO_BOOL_STR (GH-131816)Amit Lavon2025-03-30
|
* gh-130373: Avoid locking in _LOAD_ATTR_WITH_HINT (#130372)Dino Viehland2025-03-28
| | | Avoid locking in _LOAD_ATTR_WITH_HINT
* gh-131738: optimize builtin any/all/tuple calls with a generator expression ↵Irit Katriel2025-03-28
| | | | arg (#131737)
* gh-123358: Use `_PyStackRef` in `LOAD_DEREF` (gh-130064)Sam Gross2025-03-26
| | | | | | | | | | | | Concurrent accesses from multiple threads to the same `cell` object did not scale well in the free-threaded build. Use `_PyStackRef` and optimistically avoid locking to improve scaling. With the locks around cell reads gone, some of the free threading tests were prone to starvation: the readers were able to run in a tight loop and the writer threads weren't scheduled frequently enough to make timely progress. Adjust the tests to avoid this. Co-authored-by: Donghee Na <donghee.na@python.org>
* GH-131729: Code-gen better liveness analysis (GH-131732)Mark Shannon2025-03-26
| | | | | | | | | | | | * Rename 'defined' attribute to 'in_local' to more accurately reflect how it is used * Make death of variables explicit even for array variables. * Convert in_memory from boolean to stack offset * Don't apply liveness analysis to optimizer generated code * Fix RETURN_VALUE in optimizer
* gh-130312: SET_ADD should not lock (#130136)Dino Viehland2025-03-21
| | | SET_ADD should not lock
* GH-130415: Optimize constant comparison in JIT builds (GH-131489)Savannah Ostrowski2025-03-21
|
* GH-131498: Remove conditional stack effects (GH-131499)Mark Shannon2025-03-20
| | | * Adds some missing #includes
* GH-131238: More refactoring of core header files (GH-131351)Mark Shannon2025-03-17
| | | | Adds new pycore_stats.h header file to help break dependencies involving the pycore_code.h header.
* gh-131281: fix compile error due to `BINARY_SUBSCR` (GH-131283)Xuanteng Huang2025-03-15
| | | | | * fix compile error due to `BINARY_SUBSCR` * replace stat_inc with `BINARY_OP`
* gh-115999: Add free-threaded specialization for FOR_ITER (#128798)T. Wouters2025-03-12
| | | | Add free-threaded versions of existing specialization for FOR_ITER (list, tuples, fast range iterators and generators), without significantly affecting their thread-safety. (Iterating over shared lists/tuples/ranges should be fine like before. Reusing iterators between threads is not fine, like before. Sharing generators between threads is a recipe for significant crashes, like before.)
* GH-127705: Use `_PyStackRef`s in the default build. (GH-127875)Mark Shannon2025-03-10
|
* GH-128534: Fix behavior of branch monitoring for `async for` (GH-130847)Mark Shannon2025-03-07
| | | * Both branches in a pair now have a common source and are included in co_branches
* gh-130920: Fix data race in STORE_SUBSCR_LIST_INT (#130923)Sam Gross2025-03-06
| | | | | | The write of the item to the list needs to use an atomic operation in the free threading build. Co-authored-by: Tomasz Pytel <tompytel@gmail.com>
* GH-130296: Avoid stack transients in four instructions. (GH-130310)Mark Shannon2025-02-28
| | | | | | | | | * Combine _GUARD_GLOBALS_VERSION_PUSH_KEYS and _LOAD_GLOBAL_MODULE_FROM_KEYS into _LOAD_GLOBAL_MODULE * Combine _GUARD_BUILTINS_VERSION_PUSH_KEYS and _LOAD_GLOBAL_BUILTINS_FROM_KEYS into _LOAD_GLOBAL_BUILTINS * Combine _CHECK_ATTR_MODULE_PUSH_KEYS and _LOAD_ATTR_MODULE_FROM_KEYS into _LOAD_ATTR_MODULE * Remove stack transient in LOAD_ATTR_WITH_HINT
* gh-130595: Fix leak in WITH_EXCEPT_START error case (GH-130626)Petr Viktorin2025-02-28
| | | Co-authored-by: Ken Jin <kenjin@python.org>
* GH-128534: Instrument branches for `async for` loops. (GH-130569)Mark Shannon2025-02-27
|
* gh-130595: Keep traceback alive for WITH_EXCEPT_START (#130562)Dino Viehland2025-02-26
| | | Keep traceback alive for WITH_EXCEPT_START
* gh-122029: Move monitoring after method expand for CALL_KW (GH-130488)Tian Gao2025-02-25
|
* GH-130396: Use computed stack limits on linux (GH-130398)Mark Shannon2025-02-25
| | | | | | | | | | | * 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-24
| | | | | | | | | 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-19
| | | | | | | | | | | | * 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-18
| | | Change Py_TAIL_CALL_INTERP ifndef to !
* gh-129989: Properly disable tailcall interp in configure (GH-129991)Ken Jin2025-02-16
| | | Co-authored-by: Zanie Blue <contact@zanie.dev>
* GH-128682: Account for escapes in `DECREF_INPUTS` (GH-129953)Mark Shannon2025-02-12
| | | | | | | | * Handle escapes in DECREF_INPUTS * Mark a few more functions as escaping * Replace DECREF_INPUTS with PyStackRef_CLOSE where possible
* gh-100239: replace BINARY_SUBSCR & family by BINARY_OP with oparg NB_SUBSCR ↵Irit Katriel2025-02-07
| | | | (#129700)
* GH-129715: Remove _DYNAMIC_EXIT (GH-129716)Brandt Bucher2025-02-07
|
* GH-129709: Clean up tier two (GH-129710)Brandt Bucher2025-02-07
|
* GH-129763: Remove the LLTRACE macro (GH-129764)Brandt Bucher2025-02-07
|
* gh-128563: A new tail-calling interpreter (GH-128718)Ken Jin2025-02-06
| | | | | 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-04
| | | Expand out SETLOCAL so that code generator can see the decref. Mark Py_CLEAR as escaping
* GH-128682: Spill the stack pointer in labels, as well as instructions ↵Mark Shannon2025-02-04
| | | | (GH-129618)
* GH-128563: Generate `opcode = ...` in instructions that need `opcode` ↵Mark Shannon2025-02-03
| | | | | (GH-129608) * Remove support for GO_TO_INSTRUCTION
* GH-128682: Make `PyStackRef_CLOSE` escaping. (GH-129404)Mark Shannon2025-02-03
|
* GH-128563: Move some labels, to simplify implementing tailcalling ↵Mark Shannon2025-01-31
| | | | interpreter. (GH-129525)
* gh-100239: specialize bitwise logical binary ops on ints (#128927)Irit Katriel2025-01-29
|
* GH-126599: Remove the PyOptimizer API (GH-129194)Brandt Bucher2025-01-28
|
* gh-115999: Enable free-threaded specialization of LOAD_CONST (#129365)T. Wouters2025-01-29
| | | | Enable free-threaded specialization of LOAD_CONST.
* GH-128914: Remove all but one conditional stack effects (GH-129226)Mark Shannon2025-01-27
| | | | | | | | | | | | | * Remove all 'if (0)' and 'if (1)' conditional stack effects * Use array instead of conditional for BUILD_SLICE args * Refactor LOAD_GLOBAL to use a common conditional uop * Remove conditional stack effects from LOAD_ATTR specializations * Replace conditional stack effects in LOAD_ATTR with a 0 or 1 sized array. * Remove conditional stack effects from CALL_FUNCTION_EX
* gh-128563: Move labels in ceval.c to bytecodes.c (GH-129112)Ken Jin2025-01-27
|
* gh-128799: Add frame of except* to traceback when wrapping a naked exception ↵Irit Katriel2025-01-25
| | | | (#128971)
* Revert "GH-128914: Remove conditional stack effects from `bytecodes.c` and ↵Sam Gross2025-01-23
| | | | | | | the code generators (GH-128918)" (GH-129202) The commit introduced a ~2.5-3% regression in the free threading build. This reverts commit ab61d3f4303d14a413bc9ae6557c730ffdf7579e.
* GH-128682: Change a couple of functions to only steal references on success. ↵Mark Shannon2025-01-22
| | | | | (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-21
|
* GH-128563: Add new frame owner type for interpreter entry frames (GH-129078)Mark Shannon2025-01-21
| | | Add new frame owner type for interpreter entry frames
* GH-127953: Make line number lookup O(1) regardless of the size of the code ↵Mark Shannon2025-01-21
| | | | object (GH-128350)
* GH-128914: Remove conditional stack effects from `bytecodes.c` and the code ↵Mark Shannon2025-01-20
| | | | generators (GH-128918)
* GH-126599: Remove the "counter" optimizer/executor (GH-126853)Xuanteng Huang2025-01-16
|