Skip to content
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

GH-115419: Improve list of escaping functions #118054

Merged
merged 1 commit into from
Apr 19, 2024

Conversation

markshannon
Copy link
Member

@markshannon markshannon commented Apr 18, 2024

Improve list of C functions that are considered to escape, given more accurate metadata.

The following uops are no longer considered to escape:
_STORE_SUBSCR_LIST_INT
_POP_FRAME
_MAKE_CELL
_STORE_ATTR_SLOT
_COMPARE_OP_FLOAT
_INIT_CALL_PY_EXACT_ARGS

The following uop is now considered correctly to escape:
_CALL_BUILTIN_CLASS

Note that, although _PUSH_FRAME doesn't escape, it does need a prior _SET_IP for the return address.
This PR also makes sure that _PUSH_FRAME gets a valid instruction pointer.

Copy link
Member

@gvanrossum gvanrossum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment on lines 360 to +361
"Py_DECREF",
"Py_XDECREF",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would seem technically wrong to treat decref as non-escaping, but I understand it's expedient and also 99.999% correct. Or am I missing something?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's correct. We already have Py_DECREF on this list, so adding Py_XDECREF is consistent.

@markshannon
Copy link
Member Author

The failures on emulated ARM are a known issue.

@markshannon markshannon merged commit d3bd6b5 into python:main Apr 19, 2024
59 of 63 checks passed
@markshannon markshannon deleted the fewer-escapes-2 branch April 19, 2024 08:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants