-
-
Notifications
You must be signed in to change notification settings - Fork 34.5k
gh-115999: Add partial free-thread specialization for BINARY_SUBSCR #127227
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
1a901a3
919be91
6e2f5fe
8c3a4dc
0637d48
f0b8a8f
7f69f2d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -790,16 +790,17 @@ dummy_func( | |||||||||||||||||||||
| // Deopt unless 0 <= sub < PyList_Size(list) | ||||||||||||||||||||||
| DEOPT_IF(!_PyLong_IsNonNegativeCompact((PyLongObject *)sub)); | ||||||||||||||||||||||
| Py_ssize_t index = ((PyLongObject*)sub)->long_value.ob_digit[0]; | ||||||||||||||||||||||
| DEOPT_IF(!LOCK_OBJECT(list)); | ||||||||||||||||||||||
| if (index >= PyList_GET_SIZE(list)) { | ||||||||||||||||||||||
| UNLOCK_OBJECT(list); | ||||||||||||||||||||||
| DEOPT_IF(true); | ||||||||||||||||||||||
| } | ||||||||||||||||||||||
| #ifdef Py_GIL_DISABLED | ||||||||||||||||||||||
| STAT_INC(BINARY_SUBSCR, hit); | ||||||||||||||||||||||
|
mpage marked this conversation as resolved.
Outdated
|
||||||||||||||||||||||
| PyObject *res_o = _PyList_GetItemRef(list, index); | ||||||||||||||||||||||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The default build of list_get_item_ref is almost same as current implementation, Lines 352 to 361 in 328187c
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It would certainly be cleaner, but it might come with some performance cost in the default build.
mpage marked this conversation as resolved.
Outdated
|
||||||||||||||||||||||
| DEOPT_IF(res_o == NULL); | ||||||||||||||||||||||
| #else | ||||||||||||||||||||||
| DEOPT_IF(index >= PyList_GET_SIZE(list)); | ||||||||||||||||||||||
| STAT_INC(BINARY_SUBSCR, hit); | ||||||||||||||||||||||
| PyObject *res_o = PyList_GET_ITEM(list, index); | ||||||||||||||||||||||
| assert(res_o != NULL); | ||||||||||||||||||||||
| Py_INCREF(res_o); | ||||||||||||||||||||||
|
corona10 marked this conversation as resolved.
|
||||||||||||||||||||||
| UNLOCK_OBJECT(list); | ||||||||||||||||||||||
| #endif | ||||||||||||||||||||||
| PyStackRef_CLOSE_SPECIALIZED(sub_st, (destructor)PyObject_Free); | ||||||||||||||||||||||
| DEAD(sub_st); | ||||||||||||||||||||||
| PyStackRef_CLOSE(list_st); | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.