Skip to content

Commit 20c8cbe

Browse files
committed
Clarify that calls _tp_iteritem are only treated as no-escapping in the JIT
1 parent 6b62032 commit 20c8cbe

5 files changed

Lines changed: 287 additions & 149 deletions

File tree

Include/internal/pycore_uop_ids.h

Lines changed: 133 additions & 130 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Include/internal/pycore_uop_metadata.h

Lines changed: 11 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Python/bytecodes.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1770,7 +1770,7 @@ dummy_func(
17701770
assert(PyStackRef_IsNone(none));
17711771
PyObject *iter_o = PyStackRef_AsPyObjectBorrow(iter);
17721772
Py_ssize_t index = PyStackRef_UntagInt(null_or_index);
1773-
_PyObjectIndexPair next_index = Py_TYPE(ITER)->_tp_iteritem(iter_o, index);
1773+
_PyObjectIndexPair next_index = CALL_TP_ITERITEM_NO_ESCAPE(iter_o, index);
17741774
PyObject *next_o = next_index.object;
17751775
index = next_index.index;
17761776
if (next_o == NULL) {

Python/ceval_macros.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -641,3 +641,5 @@ gen_try_set_executing(PyGenObject *gen)
641641
(PyLongObject *)PyStackRef_AsPyObjectBorrow(right)); \
642642
}
643643

644+
#define CALL_TP_ITERITEM_NO_ESCAPE(ITER, INDEX) \
645+
Py_TYPE(ITER)->_tp_iteritem((ITER), (INDEX))

0 commit comments

Comments
 (0)