Skip to content

Commit 5529213

Browse files
authored
gh-100239: specialize BINARY_OP/SUBSCR for list-slice (#132626)
1 parent 3831752 commit 5529213

15 files changed

+552
-354
lines changed

Include/cpython/pystats.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
# error "this header file must not be included directly"
3030
#endif
3131

32-
#define PYSTATS_MAX_UOP_ID 512
32+
#define PYSTATS_MAX_UOP_ID 1024
3333

3434
#define SPECIALIZATION_FAILURE_KINDS 60
3535

Include/internal/pycore_list.h

+3
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,13 @@ extern "C" {
1313
#endif
1414

1515
PyAPI_FUNC(PyObject*) _PyList_Extend(PyListObject *, PyObject *);
16+
PyAPI_FUNC(PyObject) *_PyList_SliceSubscript(PyObject*, PyObject*);
1617
extern void _PyList_DebugMallocStats(FILE *out);
1718
// _PyList_GetItemRef should be used only when the object is known as a list
1819
// because it doesn't raise TypeError when the object is not a list, whereas PyList_GetItemRef does.
1920
extern PyObject* _PyList_GetItemRef(PyListObject *, Py_ssize_t i);
21+
22+
2023
#ifdef Py_GIL_DISABLED
2124
// Returns -1 in case of races with other threads.
2225
extern int _PyList_GetItemRefNoLock(PyListObject *, Py_ssize_t, _PyStackRef *);

Include/internal/pycore_opcode_metadata.h

+8-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)