bpo-26280: Port BINARY_SUBSCR to PEP 659 adaptive interpreter (GH-27043)

This commit is contained in:
Irit Katriel 2021-07-15 13:13:12 +01:00 committed by GitHub
parent a0551059ba
commit 641345d636
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 203 additions and 23 deletions

View file

@ -310,17 +310,18 @@ too_many_cache_misses(_PyAdaptiveEntry *entry) {
return entry->counter == saturating_zero();
}
#define BACKOFF 64
#define ADAPTIVE_CACHE_BACKOFF 64
static inline void
cache_backoff(_PyAdaptiveEntry *entry) {
entry->counter = BACKOFF;
entry->counter = ADAPTIVE_CACHE_BACKOFF;
}
/* Specialization functions */
int _Py_Specialize_LoadAttr(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);
#define SPECIALIZATION_STATS 0
#define SPECIALIZATION_STATS_DETAILED 0