mirror of
https://github.com/python/cpython.git
synced 2025-07-07 19:35:27 +00:00
gh-100239: specialize BINARY_OP/SUBSCR for list-slice (#132626)
This commit is contained in:
parent
3831752689
commit
5529213d4e
15 changed files with 552 additions and 354 deletions
|
@ -2657,6 +2657,10 @@ _Py_Specialize_BinaryOp(_PyStackRef lhs_st, _PyStackRef rhs_st, _Py_CODEUNIT *in
|
|||
specialize(instr, BINARY_OP_SUBSCR_DICT);
|
||||
return;
|
||||
}
|
||||
if (PyList_CheckExact(lhs) && PySlice_Check(rhs)) {
|
||||
specialize(instr, BINARY_OP_SUBSCR_LIST_SLICE);
|
||||
return;
|
||||
}
|
||||
unsigned int tp_version;
|
||||
PyTypeObject *container_type = Py_TYPE(lhs);
|
||||
PyObject *descriptor = _PyType_LookupRefAndVersion(container_type, &_Py_ID(__getitem__), &tp_version);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue