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-106581: Project through calls #108067

Merged
merged 18 commits into from
Aug 17, 2023
Merged

gh-106581: Project through calls #108067

merged 18 commits into from
Aug 17, 2023

Conversation

gvanrossum
Copy link
Member

@gvanrossum gvanrossum commented Aug 16, 2023

This finishes the work begun in gh-107760. When, while projecting a superblock, we encounter a call to a short, simple function, the superblock will now enter the function using _PUSH_FRAME, continue through it, and leave it using _POP_FRAME, and then continue through the original code. Multiple frame pushes and pops are even possible. It is also possible to stop appending to the superblock in the middle of a called function, when running out of space or encountering an unsupported bytecode.

(I had two previous draft PRs covering this work, gh-107793 and gh-107925, but I decided to combine them.)

@gvanrossum gvanrossum changed the title gh-b5ad46cfa4: Project through calls gh-106581: Project through calls Aug 16, 2023
@Eclips4 Eclips4 added the interpreter-core (Objects, Python, Grammar, and Parser dirs) label Aug 17, 2023
Comment on lines +274 to +275
interp->func_state.func_version_cache[
version % FUNC_VERSION_CACHE_SIZE] = func;
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this would be slightly more readable with something like this:

Suggested change
interp->func_state.func_version_cache[
version % FUNC_VERSION_CACHE_SIZE] = func;
uint32_t idx = version % FUNC_VERSION_CACHE_SIZE;
interp->func_state.func_version_cache[idx] = func;

Ditto for the function below.

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh, sorry. It's probably not worth it to clean this up now that I landed it.

@gvanrossum gvanrossum merged commit 61c7249 into python:main Aug 17, 2023
15 checks passed
@gvanrossum gvanrossum deleted the project-uops branch August 17, 2023 18:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) skip news
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants