mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
GH-91432: Remove the iterator_exhausted_no_error label (GH-96517)
This commit is contained in:
parent
56d9cf7fc8
commit
0d04b8d9e1
1 changed files with 20 additions and 16 deletions
|
@ -3816,10 +3816,9 @@ handle_eval_breaker:
|
||||||
}
|
}
|
||||||
_PyErr_Clear(tstate);
|
_PyErr_Clear(tstate);
|
||||||
}
|
}
|
||||||
iterator_exhausted_no_error:
|
|
||||||
/* iterator ended normally */
|
/* iterator ended normally */
|
||||||
assert(!_PyErr_Occurred(tstate));
|
STACK_SHRINK(1);
|
||||||
Py_DECREF(POP());
|
Py_DECREF(iter);
|
||||||
JUMPBY(INLINE_CACHE_ENTRIES_FOR_ITER + oparg);
|
JUMPBY(INLINE_CACHE_ENTRIES_FOR_ITER + oparg);
|
||||||
DISPATCH();
|
DISPATCH();
|
||||||
}
|
}
|
||||||
|
@ -3845,19 +3844,21 @@ handle_eval_breaker:
|
||||||
DEOPT_IF(Py_TYPE(it) != &PyListIter_Type, FOR_ITER);
|
DEOPT_IF(Py_TYPE(it) != &PyListIter_Type, FOR_ITER);
|
||||||
STAT_INC(FOR_ITER, hit);
|
STAT_INC(FOR_ITER, hit);
|
||||||
PyListObject *seq = it->it_seq;
|
PyListObject *seq = it->it_seq;
|
||||||
if (seq == NULL) {
|
if (seq) {
|
||||||
goto iterator_exhausted_no_error;
|
if (it->it_index < PyList_GET_SIZE(seq)) {
|
||||||
|
PyObject *next = PyList_GET_ITEM(seq, it->it_index++);
|
||||||
|
Py_INCREF(next);
|
||||||
|
PUSH(next);
|
||||||
|
JUMPBY(INLINE_CACHE_ENTRIES_FOR_ITER);
|
||||||
|
NOTRACE_DISPATCH();
|
||||||
|
}
|
||||||
|
it->it_seq = NULL;
|
||||||
|
Py_DECREF(seq);
|
||||||
}
|
}
|
||||||
if (it->it_index < PyList_GET_SIZE(seq)) {
|
STACK_SHRINK(1);
|
||||||
PyObject *next = PyList_GET_ITEM(seq, it->it_index++);
|
Py_DECREF(it);
|
||||||
Py_INCREF(next);
|
JUMPBY(INLINE_CACHE_ENTRIES_FOR_ITER + oparg);
|
||||||
PUSH(next);
|
NOTRACE_DISPATCH();
|
||||||
JUMPBY(INLINE_CACHE_ENTRIES_FOR_ITER);
|
|
||||||
NOTRACE_DISPATCH();
|
|
||||||
}
|
|
||||||
it->it_seq = NULL;
|
|
||||||
Py_DECREF(seq);
|
|
||||||
goto iterator_exhausted_no_error;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
TARGET(FOR_ITER_RANGE) {
|
TARGET(FOR_ITER_RANGE) {
|
||||||
|
@ -3868,7 +3869,10 @@ handle_eval_breaker:
|
||||||
_Py_CODEUNIT next = next_instr[INLINE_CACHE_ENTRIES_FOR_ITER];
|
_Py_CODEUNIT next = next_instr[INLINE_CACHE_ENTRIES_FOR_ITER];
|
||||||
assert(_PyOpcode_Deopt[_Py_OPCODE(next)] == STORE_FAST);
|
assert(_PyOpcode_Deopt[_Py_OPCODE(next)] == STORE_FAST);
|
||||||
if (r->index >= r->len) {
|
if (r->index >= r->len) {
|
||||||
goto iterator_exhausted_no_error;
|
STACK_SHRINK(1);
|
||||||
|
Py_DECREF(r);
|
||||||
|
JUMPBY(INLINE_CACHE_ENTRIES_FOR_ITER + oparg);
|
||||||
|
NOTRACE_DISPATCH();
|
||||||
}
|
}
|
||||||
long value = (long)(r->start +
|
long value = (long)(r->start +
|
||||||
(unsigned long)(r->index++) * r->step);
|
(unsigned long)(r->index++) * r->step);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue