mirror of
https://github.com/python/cpython.git
synced 2025-10-17 20:28:43 +00:00
gh-115999: Add partial free-thread specialization for BINARY_SUBSCR (gh-127227)
This commit is contained in:
parent
7ea523f47c
commit
e2713409cf
10 changed files with 128 additions and 71 deletions
11
Python/executor_cases.c.h
generated
11
Python/executor_cases.c.h
generated
|
@ -981,6 +981,16 @@
|
|||
JUMP_TO_JUMP_TARGET();
|
||||
}
|
||||
Py_ssize_t index = ((PyLongObject*)sub)->long_value.ob_digit[0];
|
||||
#ifdef Py_GIL_DISABLED
|
||||
_PyFrame_SetStackPointer(frame, stack_pointer);
|
||||
PyObject *res_o = _PyList_GetItemRef((PyListObject*)list, index);
|
||||
stack_pointer = _PyFrame_GetStackPointer(frame);
|
||||
if (res_o == NULL) {
|
||||
UOP_STAT_INC(uopcode, miss);
|
||||
JUMP_TO_JUMP_TARGET();
|
||||
}
|
||||
STAT_INC(BINARY_SUBSCR, hit);
|
||||
#else
|
||||
if (index >= PyList_GET_SIZE(list)) {
|
||||
UOP_STAT_INC(uopcode, miss);
|
||||
JUMP_TO_JUMP_TARGET();
|
||||
|
@ -989,6 +999,7 @@
|
|||
PyObject *res_o = PyList_GET_ITEM(list, index);
|
||||
assert(res_o != NULL);
|
||||
Py_INCREF(res_o);
|
||||
#endif
|
||||
PyStackRef_CLOSE_SPECIALIZED(sub_st, (destructor)PyObject_Free);
|
||||
PyStackRef_CLOSE(list_st);
|
||||
res = PyStackRef_FromPyObjectSteal(res_o);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue