mirror of
https://github.com/python/cpython.git
synced 2026-06-23 01:21:05 +00:00
[3.15] gh-149481: skip FOR_ITER inline specialization for Python __next__ (GH-149491) (#149523)
gh-149481: skip `FOR_ITER` inline specialization for Python `__next__` (GH-149491)
(cherry picked from commit 49918f5b0c)
Co-authored-by: Neko Asakura <neko.asakura@outlook.com>
Co-authored-by: Savannah Ostrowski <savannah@python.org>
Co-authored-by: Stan Ulbrych <stan@python.org>
This commit is contained in:
parent
b311ea8691
commit
5cb915da44
5 changed files with 15 additions and 3 deletions
|
|
@ -2,6 +2,7 @@
|
|||
#include "pycore_long.h"
|
||||
#include "pycore_opcode_utils.h"
|
||||
#include "pycore_optimizer.h"
|
||||
#include "pycore_typeobject.h"
|
||||
#include "pycore_uops.h"
|
||||
#include "pycore_uop_ids.h"
|
||||
#include "internal/pycore_moduleobject.h"
|
||||
|
|
@ -1459,7 +1460,8 @@ dummy_func(void) {
|
|||
type = sym_get_probable_type(iter);
|
||||
definite = false;
|
||||
}
|
||||
if (type != NULL && type != &PyGen_Type && type->tp_iternext != NULL) {
|
||||
if (type != NULL && type != &PyGen_Type && type->tp_iternext != NULL
|
||||
&& !_PyType_HasSlotTpIternext(type)) {
|
||||
PyType_Watch(TYPE_WATCHER_ID, (PyObject *)type);
|
||||
_Py_BloomFilter_Add(dependencies, type);
|
||||
if (!definite) {
|
||||
|
|
|
|||
3
Python/optimizer_cases.c.h
generated
3
Python/optimizer_cases.c.h
generated
|
|
@ -3706,7 +3706,8 @@
|
|||
type = sym_get_probable_type(iter);
|
||||
definite = false;
|
||||
}
|
||||
if (type != NULL && type != &PyGen_Type && type->tp_iternext != NULL) {
|
||||
if (type != NULL && type != &PyGen_Type && type->tp_iternext != NULL
|
||||
&& !_PyType_HasSlotTpIternext(type)) {
|
||||
PyType_Watch(TYPE_WATCHER_ID, (PyObject *)type);
|
||||
_Py_BloomFilter_Add(dependencies, type);
|
||||
if (!definite) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue