mirror of
https://github.com/python/cpython.git
synced 2025-10-21 14:12:27 +00:00
gh-115999: Add free-threaded specialization for FOR_ITER (#128798)
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.)
This commit is contained in:
parent
db27aee2fe
commit
de2f7da77d
13 changed files with 469 additions and 125 deletions
4
Python/optimizer_cases.c.h
generated
4
Python/optimizer_cases.c.h
generated
|
@ -1458,7 +1458,9 @@
|
|||
break;
|
||||
}
|
||||
|
||||
case _ITER_NEXT_LIST: {
|
||||
/* _ITER_NEXT_LIST is not a viable micro-op for tier 2 */
|
||||
|
||||
case _ITER_NEXT_LIST_TIER_TWO: {
|
||||
JitOptSymbol *next;
|
||||
next = sym_new_not_null(ctx);
|
||||
stack_pointer[0] = next;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue