-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
gh-115999: Enable BINARY_SUBSCR_GETITEM for free-threaded build #127737
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 6 commits
bb23e4b
b714963
9dd7103
2953fb4
a059e68
d0a9f07
55aa240
245d580
58c2289
23d5d49
42ed55b
c555fcd
7b72e7b
f9509d3
e3227e0
3aa9426
6ef74ac
47b80b4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
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 |
---|---|---|
|
@@ -867,11 +867,10 @@ dummy_func( | |
op(_BINARY_SUBSCR_CHECK_FUNC, (container, unused -- container, unused)) { | ||
PyTypeObject *tp = Py_TYPE(PyStackRef_AsPyObjectBorrow(container)); | ||
DEOPT_IF(!PyType_HasFeature(tp, Py_TPFLAGS_HEAPTYPE)); | ||
PyHeapTypeObject *ht = (PyHeapTypeObject *)tp; | ||
PyObject *getitem = ht->_spec_cache.getitem; | ||
uint32_t cached_version; | ||
PyObject *getitem = _PyType_GetItemFromCacheWithVersion(tp, &cached_version); | ||
DEOPT_IF(getitem == NULL); | ||
assert(PyFunction_Check(getitem)); | ||
uint32_t cached_version = ht->_spec_cache.getitem_version; | ||
DEOPT_IF(((PyFunctionObject *)getitem)->func_version != cached_version); | ||
PyCodeObject *code = (PyCodeObject *)PyFunction_GET_CODE(getitem); | ||
assert(code->co_argcount == 2); | ||
|
@@ -881,8 +880,8 @@ dummy_func( | |
|
||
op(_BINARY_SUBSCR_INIT_CALL, (container, sub -- new_frame: _PyInterpreterFrame* )) { | ||
PyTypeObject *tp = Py_TYPE(PyStackRef_AsPyObjectBorrow(container)); | ||
PyHeapTypeObject *ht = (PyHeapTypeObject *)tp; | ||
PyObject *getitem = ht->_spec_cache.getitem; | ||
PyObject *getitem = _PyType_GetItemFromCache(tp); | ||
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. I think it's probably safe to reload getitem from the cache after the guard passes. (If the getitem in the cache is replaced after the guard passes, the new getitem cannot be mutated in a way that would change the function version: that would require stopping the world). However, I'd prefer that we pass the getitem that is loaded in |
||
DEOPT_IF(getitem == NULL); | ||
new_frame = _PyFrame_PushUnchecked(tstate, PyStackRef_FromPyObjectNew(getitem), 2, frame); | ||
new_frame->localsplus[0] = container; | ||
new_frame->localsplus[1] = sub; | ||
|
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.