diff options
author | Dennis Sweeney <36520290+sweeneyde@users.noreply.github.com> | 2022-06-21 10:19:26 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-21 10:19:26 (GMT) |
commit | 5fcfdd87c9b5066a581d3ccb4b2fede938f343ec (patch) | |
tree | 8d333af15ee960d109d32163e005beefb2a16900 /Lib/opcode.py | |
parent | c735d545343c3ab002c62596b2fb2cfa4488b0af (diff) | |
download | cpython-5fcfdd87c9b5066a581d3ccb4b2fede938f343ec.zip cpython-5fcfdd87c9b5066a581d3ccb4b2fede938f343ec.tar.gz cpython-5fcfdd87c9b5066a581d3ccb4b2fede938f343ec.tar.bz2 |
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 'Lib/opcode.py')
-rw-r--r-- | Lib/opcode.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/opcode.py b/Lib/opcode.py index 7657a51..f515aaa 100644 --- a/Lib/opcode.py +++ b/Lib/opcode.py @@ -278,6 +278,11 @@ _specializations = { "EXTENDED_ARG": [ "EXTENDED_ARG_QUICK", ], + "FOR_ITER": [ + "FOR_ITER_ADAPTIVE", + "FOR_ITER_LIST", + "FOR_ITER_RANGE", + ], "JUMP_BACKWARD": [ "JUMP_BACKWARD_QUICK", ], @@ -367,6 +372,9 @@ _cache_format = { "type_version": 2, "func_version": 1, }, + "FOR_ITER": { + "counter": 1, + }, "LOAD_ATTR": { "counter": 1, "version": 2, |