diff options
author | Mark Shannon <mark@hotpy.org> | 2022-03-01 16:00:34 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-01 16:00:34 (GMT) |
commit | 3b0f1c5a710eff289dc44bec972dbaea353cc54f (patch) | |
tree | a3d33b56de327fa0a3abbff54c8013a95da61638 /Include/cpython | |
parent | e91b0a7139d4a4cbd2351ccb5cd021a100cf42d2 (diff) | |
download | cpython-3b0f1c5a710eff289dc44bec972dbaea353cc54f.zip cpython-3b0f1c5a710eff289dc44bec972dbaea353cc54f.tar.gz cpython-3b0f1c5a710eff289dc44bec972dbaea353cc54f.tar.bz2 |
bpo-46841: Use inline cache for `BINARY_SUBSCR`. (GH-31618)
Diffstat (limited to 'Include/cpython')
-rw-r--r-- | Include/cpython/object.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Include/cpython/object.h b/Include/cpython/object.h index 5f978ee..b018dab 100644 --- a/Include/cpython/object.h +++ b/Include/cpython/object.h @@ -229,6 +229,13 @@ struct _typeobject { vectorcallfunc tp_vectorcall; }; +/* This struct is used by the specializer + * It should should be treated as an opaque blob + * by code other than the specializer and interpreter. */ +struct _specialization_cache { + PyObject *getitem; +}; + /* The *real* layout of a type object when allocated on the heap */ typedef struct _heaptypeobject { /* Note: there's a dependency on the order of these members @@ -247,6 +254,7 @@ typedef struct _heaptypeobject { struct _dictkeysobject *ht_cached_keys; PyObject *ht_module; char *_ht_tpname; // Storage for "tp_name"; see PyType_FromModuleAndSpec + struct _specialization_cache _spec_cache; // For use by the specializer. /* here are optional user slots, followed by the members. */ } PyHeapTypeObject; |