| Commit message (Collapse) | Author | Age |
| |
|
| |
|
| |
|
|
|
|
|
| |
This avoid reference count contention in the free threading build
when calling special methods like `__enter__` and `__exit__`.
|
|
|
|
|
|
|
| |
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-132506)
|
|
|
|
| |
(GH-132289)
|
|
|
|
|
|
|
|
| |
a specialized code path (#132000)
Co-authored-by: sobolevn <mail@sobolevn.me>
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Mark Shannon <mark@hotpy.org>
|
|
|
|
| |
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
|
| |
|
|
|
|
|
| |
* Parse down to statement level in the cases generator
* Add handling for #if macros, treating them much like normal ifs.
|
| |
|
|
|
| |
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
|
|
|
|
|
| |
* 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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Fix use after free in list objects
Set the items pointer in the list object to NULL after the items array
is freed during list deallocation. Otherwise, we can end up with a list
object added to the free list that contains a pointer to an already-freed
items array.
* Mark `_PyList_FromStackRefStealOnSuccess` as escaping
I think technically it's not escaping, because the only object that
can be decrefed if allocation fails is an exact list, which cannot
execute arbitrary code when it is destroyed. However, this seems less
intrusive than trying to special cases objects in the assert in `_Py_Dealloc`
that checks for non-null stackpointers and shouldn't matter for performance.
|
|
|
|
|
|
|
|
|
| |
* 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
|
| |
|