Skip to content

Conversation

@markshannon
Copy link
Member

@markshannonmarkshannon 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

@gvanrossumgvanrossum 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
MemberAuthor

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
MemberAuthor

The failures on emulated ARM are a known issue.

@markshannonmarkshannon merged commit d3bd6b5 into python:mainApr 19, 2024
@markshannonmarkshannon deleted the fewer-escapes-2 branch April 19, 2024 08:27
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@markshannon@gvanrossum