cpython/Objects
mpage 09c240f20c
gh-115999: Specialize `LOAD_GLOBAL` in free-threaded builds (#126607)
Enable specialization of LOAD_GLOBAL in free-threaded builds.

Thread-safety of specialization in free-threaded builds is provided by the following:

A critical section is held on both the globals and builtins objects during specialization. This ensures we get an atomic view of both builtins and globals during specialization.
Generation of new keys versions is made atomic in free-threaded builds.
Existing helpers are used to atomically modify the opcode.
Thread-safety of specialized instructions in free-threaded builds is provided by the following:

Relaxed atomics are used when loading and storing dict keys versions. This avoids potential data races as the dict keys versions are read without holding the dictionary's per-object lock in version guards.
Dicts keys objects are passed from keys version guards to the downstream uops. This ensures that we are loading from the correct offset in the keys object. Once a unicode key has been stored in a keys object for a combined dictionary in free-threaded builds, the offset that it is stored in will never be reused for a different key. Once the version guard passes, we know that we are reading from the correct offset.
The dictionary read fast-path is used to read values from the dictionary once we know the correct offset.
2024-11-21 11:22:21 -08:00
..
clinic gh-122943: Add the varpos parameter in _PyArg_UnpackKeywords (GH-126564) 2024-11-08 14:23:50 +02:00
mimalloc gh-123826: Fix unused function warnings in mimalloc on NetBSD (#123827) 2024-09-09 13:22:28 -04:00
stringlib gh-122943: Add the varpos parameter in _PyArg_UnpackKeywords (GH-126564) 2024-11-08 14:23:50 +02:00
README
abstract.c gh-115754: Use Py_GetConstant(Py_CONSTANT_EMPTY_STR) (#125194) 2024-10-09 17:15:23 +02:00
boolobject.c gh-122982: Extend the deprecation period for bool inversion by two years (#123306) 2024-08-25 12:24:44 -07:00
bytearrayobject.c gh-126980: Fix `bytearray.__buffer__` crash on `PyBUF_{READ,WRITE}` (#126981) 2024-11-19 17:44:53 +03:00
bytes_methods.c gh-121165: protect macro expansion of `ADJUST_INDICES` with do-while(0) (#121166) 2024-07-02 16:27:51 +05:30
bytesobject.c gh-126076: Account for relocated objects in tracemalloc (#126077) 2024-11-19 10:35:17 +00:00
call.c gh-106320: Remove _PyFunction_Vectorcall() API (#107071) 2023-07-22 21:44:33 +00:00
capsule.c gh-124538: Fix crash when using `gc.get_referents` on an untracked capsule object (#124559) 2024-09-26 12:29:43 +02:00
cellobject.c gh-111178: Fix function signatures in cellobject.c (#125182) 2024-10-09 16:13:55 +02:00
classobject.c gh-111178: Fix function signatures in classobject.c (#124943) 2024-10-04 12:00:00 +02:00
codeobject.c gh-114940: Add _Py_FOR_EACH_TSTATE_UNLOCKED(), and Friends (gh-127077) 2024-11-21 11:08:38 -07:00
complexobject.c GH-126547: Pre-assign version numbers for a few common classes (GH-126551) 2024-11-08 16:44:44 +00:00
descrobject.c bpo-24766: doc= argument to subclasses of property not handled correctly (GH-2487) 2024-06-10 08:55:49 +00:00
dictnotes.txt bpo-46845: Reduce dict size when all keys are Unicode (GH-31564) 2022-03-02 08:09:28 +09:00
dictobject.c gh-115999: Specialize `LOAD_GLOBAL` in free-threaded builds (#126607) 2024-11-21 11:22:21 -08:00
enumobject.c gh-106320: Create pycore_modsupport.h header file (#106355) 2023-07-03 09:39:11 +00:00
exceptions.c gh-115754: Use Py_GetConstant(Py_CONSTANT_EMPTY_STR) (#125194) 2024-10-09 17:15:23 +02:00
fileobject.c Replace PyObject_Del with PyObject_Free (#122453) 2024-08-01 14:12:33 +02:00
floatobject.c GH-126547: Pre-assign version numbers for a few common classes (GH-126551) 2024-11-08 16:44:44 +00:00
frameobject.c gh-115999: Implement thread-local bytecode and enable specialization for `BINARY_OP` (#123926) 2024-11-04 11:13:32 -08:00
funcobject.c gh-115999: Specialize `LOAD_GLOBAL` in free-threaded builds (#126607) 2024-11-21 11:22:21 -08:00
genericaliasobject.c gh-119180: Add evaluate functions for type params and type aliases (#122212) 2024-07-27 17:24:10 +00:00
genobject.c gh-111178: Fix function signatures in genobject.c (#124970) 2024-10-05 09:56:44 +02:00
iterobject.c gh-106320: Remove private _PyEval function (#108433) 2023-08-24 20:25:22 +02:00
listobject.c GH-126547: Pre-assign version numbers for a few common classes (GH-126551) 2024-11-08 16:44:44 +00:00
listsort.txt GH-116939: Rewrite binarysort() (#116940) 2024-03-21 22:27:25 -05:00
lnotab_notes.txt Document the `co_lines` method on code objects (#113682) 2024-01-03 19:29:24 +00:00
longobject.c gh-126061: Add PyLong_IsPositive/Zero/Negative() functions (#126065) 2024-11-12 14:18:06 +01:00
memoryobject.c gh-126341: add release check to `__iter__` method of `memoryview` (#126759) 2024-11-13 11:51:01 +00:00
methodobject.c gh-111178: Fix function signatures in methodobject.c (#124902) 2024-10-02 17:24:10 +02:00
moduleobject.c GH-127010: Don't lazily track and untrack dicts (GH-127027) 2024-11-20 16:41:20 +00:00
namespaceobject.c gh-108191: Add support of positional argument in SimpleNamespace constructor (GH-108195) 2024-04-25 00:39:54 +03:00
object.c gh-114940: Add _Py_FOR_EACH_TSTATE_UNLOCKED(), and Friends (gh-127077) 2024-11-21 11:08:38 -07:00
object_layout.md GH-115776: Allow any fixed sized object to have inline values (GH-123192) 2024-08-21 15:52:04 +01:00
object_layout_312.gv GH-115776: Embed the values array into the object, for "normal" Python objects. (GH-116115) 2024-04-02 11:59:21 +01:00
object_layout_312.png GH-115776: Embed the values array into the object, for "normal" Python objects. (GH-116115) 2024-04-02 11:59:21 +01:00
object_layout_313.gv GH-115776: Embed the values array into the object, for "normal" Python objects. (GH-116115) 2024-04-02 11:59:21 +01:00
object_layout_313.png GH-115776: Embed the values array into the object, for "normal" Python objects. (GH-116115) 2024-04-02 11:59:21 +01:00
object_layout_full_312.gv GH-96068: Document object layout (GH-96069) 2022-08-23 13:55:43 +01:00
object_layout_full_312.png GH-96068: Document object layout (GH-96069) 2022-08-23 13:55:43 +01:00
object_layout_full_313.gv GH-115776: Embed the values array into the object, for "normal" Python objects. (GH-116115) 2024-04-02 11:59:21 +01:00
object_layout_full_313.png GH-115776: Embed the values array into the object, for "normal" Python objects. (GH-116115) 2024-04-02 11:59:21 +01:00
obmalloc.c gh-114940: Add _Py_FOR_EACH_TSTATE_UNLOCKED(), and Friends (gh-127077) 2024-11-21 11:08:38 -07:00
odictobject.c gh-119004: fix a crash in equality testing between `OrderedDict` (#121329) 2024-09-23 18:44:36 -05:00
picklebufobject.c gh-104922: remove PY_SSIZE_T_CLEAN (#106315) 2023-07-02 15:07:46 +09:00
rangeobject.c gh-111178: fix some USAN failures - mismatched function pointers (GH-123004) 2024-09-27 23:51:50 +02:00
setobject.c GH-126547: Pre-assign version numbers for a few common classes (GH-126551) 2024-11-08 16:44:44 +00:00
sliceobject.c gh-125063: Emit slices as constants in the bytecode compiler (#125064) 2024-10-08 13:18:39 -04:00
structseq.c GH-125174: Make immortal objects more robust, following design from PEP 683 (GH-125251) 2024-10-10 18:19:08 +01:00
tupleobject.c gh-126076: Account for relocated objects in tracemalloc (#126077) 2024-11-19 10:35:17 +00:00
typeobject.c gh-126594: Fix typeobject.c wrap_buffer() cast (#126754) 2024-11-19 09:13:20 +01:00
typeslots.inc gh-124153: Implement `PyType_GetBaseByToken()` and `Py_tp_token` slot (GH-124163) 2024-09-18 09:18:19 +02:00
typeslots.py gh-124153: Implement `PyType_GetBaseByToken()` and `Py_tp_token` slot (GH-124163) 2024-09-18 09:18:19 +02:00
typevarobject.c gh-122943: Remove the object converter for var-positional parameter (GH-126560) 2024-11-08 05:41:54 +00:00
unicodectype.c bpo-46670: Remove unused macros in the Objects directory (GH-31193) 2022-02-07 16:21:41 +01:00
unicodeobject.c gh-126076: Account for relocated objects in tracemalloc (#126077) 2024-11-19 10:35:17 +00:00
unicodetype_db.h closes gh-124016: update Unicode to 16.0.0 (#124017) 2024-09-13 07:47:04 -07:00
unionobject.c gh-119180: Add evaluate functions for type params and type aliases (#122212) 2024-07-27 17:24:10 +00:00
weakrefobject.c gh-111178: Fix function signatures in weakrefobject.c (#124903) 2024-10-02 15:01:23 +00:00

README

Source files for various builtin objects