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

[mypyc] Borrow operands of several primitives #12810

Merged
merged 12 commits into from
May 19, 2022
Merged

Conversation

JukkaL
Copy link
Collaborator

@JukkaL JukkaL commented May 18, 2022

Borrow an operand such as x.y (attribute of a native class) in various contexts
when it's safe to do so. This reduces the number of incref/decref operations we
need to perform. This continues work started in #12805.

These cases now support borrowing (for some subexpressions, in some contexts):

  • x.y is None
  • Cast source value
  • len(x.y) (if the operand is a list)
  • isinstance(x.y, C)
  • x.y[a.b]
  • x.y.z = 1

@JukkaL JukkaL merged commit f71dba7 into master May 19, 2022
@JukkaL JukkaL deleted the refcount-misc-opts branch May 19, 2022 10:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants