Skip to content

Conversation

@gvanrossum
Copy link
Member

@gvanrossumgvanrossum 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.)

@gvanrossumgvanrossum changed the title gh-b5ad46cfa4: Project through callsgh-106581: Project through callsAug 16, 2023
@Eclips4Eclips4 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_tidx=version % FUNC_VERSION_CACHE_SIZE;
interp->func_state.func_version_cache[idx] =func;

Ditto for the function below.

Copy link
MemberAuthor

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.

@gvanrossumgvanrossum merged commit 61c7249 into python:mainAug 17, 2023
@gvanrossumgvanrossum deleted the project-uops branch August 17, 2023 18:31
Sign up for freeto 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

@gvanrossum@erlend-aasland@bedevere-bot@Eclips4