mirror of
https://github.com/python/cpython.git
synced 2025-11-01 22:21:35 +00:00
bpo-44826: Specialize STORE_ATTR (GH-27590)
* Generalize cache names for LOAD_ATTR to allow store and delete specializations. * Factor out specialization of attribute dictionary access. * Specialize STORE_ATTR.
This commit is contained in:
parent
b854557b49
commit
ac75f6bdd4
9 changed files with 345 additions and 93 deletions
|
|
@ -23,7 +23,7 @@ typedef struct {
|
|||
typedef struct {
|
||||
uint32_t tp_version;
|
||||
uint32_t dk_version_or_hint;
|
||||
} _PyLoadAttrCache;
|
||||
} _PyAttrCache;
|
||||
|
||||
typedef struct {
|
||||
uint32_t module_keys_version;
|
||||
|
|
@ -43,7 +43,7 @@ typedef struct {
|
|||
typedef union {
|
||||
_PyEntryZero zero;
|
||||
_PyAdaptiveEntry adaptive;
|
||||
_PyLoadAttrCache load_attr;
|
||||
_PyAttrCache attr;
|
||||
_PyLoadGlobalCache load_global;
|
||||
} SpecializedCacheEntry;
|
||||
|
||||
|
|
@ -297,6 +297,7 @@ cache_backoff(_PyAdaptiveEntry *entry) {
|
|||
/* Specialization functions */
|
||||
|
||||
int _Py_Specialize_LoadAttr(PyObject *owner, _Py_CODEUNIT *instr, PyObject *name, SpecializedCacheEntry *cache);
|
||||
int _Py_Specialize_StoreAttr(PyObject *owner, _Py_CODEUNIT *instr, PyObject *name, SpecializedCacheEntry *cache);
|
||||
int _Py_Specialize_LoadGlobal(PyObject *globals, PyObject *builtins, _Py_CODEUNIT *instr, PyObject *name, SpecializedCacheEntry *cache);
|
||||
int _Py_Specialize_BinarySubscr(PyObject *sub, PyObject *container, _Py_CODEUNIT *instr);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue