mirror of
https://github.com/python/cpython.git
synced 2026-06-05 17:31:21 +00:00
GH-143732: SEND specialization (GH-148963)
* SEND specialization. Adds 2 new specialized instructions: * SEND_VIRTUAL: for sends to virtual iterators e.g lists and tuples * SEND_ASYNC_GEN: for sends to async generators Tweak FOR_ITER_VIRTUAL so that SEND_VIRTUAL and FOR_ITER_VIRTUAL use equivalent guards
This commit is contained in:
parent
ffb543d32f
commit
70bd1c2dd2
29 changed files with 2662 additions and 1548 deletions
|
|
@ -2761,6 +2761,14 @@ _Py_Specialize_Send(_PyStackRef receiver_st, _Py_CODEUNIT *instr)
|
|||
specialize(instr, SEND_GEN);
|
||||
return;
|
||||
}
|
||||
if (tp->_tp_iteritem != NULL) {
|
||||
specialize(instr, SEND_VIRTUAL);
|
||||
return;
|
||||
}
|
||||
if (tp == &_PyAsyncGenASend_Type) {
|
||||
specialize(instr, SEND_ASYNC_GEN);
|
||||
return;
|
||||
}
|
||||
SPECIALIZATION_FAIL(SEND,
|
||||
_PySpecialization_ClassifyIterator(receiver));
|
||||
failure:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue