| Commit message (Collapse) | Author | Age |
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
| |
|
|
|
| |
Avoid locking in _LOAD_ATTR_WITH_HINT
|
|
|
|
| |
arg (#131737)
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
|
|
| |
SET_ADD should not lock
|
| |
|
|
|
| |
* Adds some missing #includes
|
|
|
|
| |
Adds new pycore_stats.h header file to help break dependencies involving the pycore_code.h header.
|
|
|
|
|
| |
* fix compile error due to `BINARY_SUBSCR`
* replace stat_inc with `BINARY_OP`
|
|
|
|
| |
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.)
|
| |
|
|
|
| |
* Both branches in a pair now have a common source and are included in co_branches
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
| |
* 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
|
|
|
| |
Co-authored-by: Ken Jin <kenjin@python.org>
|
| |
|
|
|
| |
Keep traceback alive for WITH_EXCEPT_START
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
|
|
| |
Change Py_TAIL_CALL_INTERP ifndef to !
|
|
|
| |
Co-authored-by: Zanie Blue <contact@zanie.dev>
|
|
|
|
|
|
|
|
| |
* Handle escapes in DECREF_INPUTS
* Mark a few more functions as escaping
* Replace DECREF_INPUTS with PyStackRef_CLOSE where possible
|
|
|
|
| |
(#129700)
|
| |
|
| |
|
| |
|
|
|
|
|
| |
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>
|
|
|
| |
Expand out SETLOCAL so that code generator can see the decref. Mark Py_CLEAR as escaping
|
|
|
|
| |
(GH-129618)
|
|
|
|
|
| |
(GH-129608)
* Remove support for GO_TO_INSTRUCTION
|
| |
|
|
|
|
| |
interpreter. (GH-129525)
|
| |
|
| |
|
|
|
|
| |
Enable free-threaded specialization of LOAD_CONST.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
| |
|
|
|
|
| |
(#128971)
|
|
|
|
|
|
|
| |
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-129132)
Change PyTuple_FromStackRefSteal and PyList_FromStackRefSteal to only steal on success to avoid escaping
|
| |
|
|
|
| |
Add new frame owner type for interpreter entry frames
|
|
|
|
| |
object (GH-128350)
|
|
|
|
| |
generators (GH-128918)
|
| |
|