-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
gh-121459: Deferred LOAD_ATTR (methods) #124101
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
Closed
Closed
Changes from 1 commit
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
be5fa22
Make LOAD_ATTR deferred
Fidget-Spinner f93588a
_PyObject_TryGetInstanceAttributeStackRef
Fidget-Spinner 1050673
cleanup
Fidget-Spinner f0afe98
fix default build
Fidget-Spinner c3fe777
partially address review
Fidget-Spinner c3448d9
Merge remote-tracking branch 'upstream/main' into deferred_method_final
Fidget-Spinner ba19770
Partially address review
Fidget-Spinner d383437
Write to second slot on stack
Fidget-Spinner File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix default build
- Loading branch information
commit f0afe98b06fabaf6504fa437e397ad73e927cfa6
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1584,7 +1584,7 @@ _PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) | |
int | ||
_PyObject_GetMethodStackRef(PyObject *obj, PyObject *name, _PyStackRef *method) | ||
{ | ||
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 doesn't have to be in this PR, but we should replace all usages of |
||
|
||
#ifdef Py_GIL_DISABLED | ||
int meth_found = 0; | ||
|
||
assert(PyStackRef_IsNull(*method)); | ||
|
@@ -1676,6 +1676,12 @@ _PyObject_GetMethodStackRef(PyObject *obj, PyObject *name, _PyStackRef *method) | |
|
||
_PyObject_SetAttributeErrorContext(obj, name); | ||
return 0; | ||
#else | ||
PyObject *res = NULL; | ||
int err = _PyObject_GetMethod(obj, name, &res); | ||
*method = res == NULL ? PyStackRef_NULL : PyStackRef_FromPyObjectSteal(res); | ||
Fidget-Spinner marked this conversation as resolved.
Show resolved
Hide resolved
|
||
return err; | ||
#endif | ||
colesbury marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
|
||
/* Generic GetAttr functions - put these in your tp_[gs]etattro slot. */ | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.