diff options
author | Dennis Sweeney <36520290+sweeneyde@users.noreply.github.com> | 2022-06-21 06:19:26 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-21 11:19:26 +0100 |
commit | 5fcfdd87c9b5066a581d3ccb4b2fede938f343ec (patch) | |
tree | 8d333af15ee960d109d32163e005beefb2a16900 /Include/internal/pycore_code.h | |
parent | c735d545343c3ab002c62596b2fb2cfa4488b0af (diff) | |
download | cpython-git-5fcfdd87c9b5066a581d3ccb4b2fede938f343ec.tar.gz |
GH-91432: Specialize FOR_ITER (GH-91713)
* Adds FOR_ITER_LIST and FOR_ITER_RANGE specializations.
* Adds _PyLong_AssignValue() internal function to avoid temporary boxing of ints.
Diffstat (limited to 'Include/internal/pycore_code.h')
-rw-r--r-- | Include/internal/pycore_code.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Include/internal/pycore_code.h b/Include/internal/pycore_code.h index 7e21c5abea..71dd3b3b42 100644 --- a/Include/internal/pycore_code.h +++ b/Include/internal/pycore_code.h @@ -85,6 +85,12 @@ typedef struct { #define INLINE_CACHE_ENTRIES_STORE_SUBSCR CACHE_ENTRIES(_PyStoreSubscrCache) +typedef struct { + _Py_CODEUNIT counter; +} _PyForIterCache; + +#define INLINE_CACHE_ENTRIES_FOR_ITER CACHE_ENTRIES(_PyForIterCache) + #define QUICKENING_WARMUP_DELAY 8 /* We want to compare to zero for efficiency, so we offset values accordingly */ @@ -243,6 +249,7 @@ extern void _Py_Specialize_CompareOp(PyObject *lhs, PyObject *rhs, _Py_CODEUNIT *instr, int oparg); extern void _Py_Specialize_UnpackSequence(PyObject *seq, _Py_CODEUNIT *instr, int oparg); +extern void _Py_Specialize_ForIter(PyObject *iter, _Py_CODEUNIT *instr); /* Deallocator function for static codeobjects used in deepfreeze.py */ extern void _PyStaticCode_Dealloc(PyCodeObject *co); |