-
-
Notifications
You must be signed in to change notification settings - Fork 32k
gh-106581: Project through calls #108067
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
Conversation
- This uses the function-by-version cache I just added - There's not yet a way to trace back via `RETURN_VALUE`
This should fix leaks and hopefully most failing tests.
Macros not using oparg should have a format starting with IX, not IB. This corrects the metadata for a bunch of specializations, e.g. BINARY_OP_MULTIPLY_INT (which never looks at oparg).
Seems to fix test_opcache, playing games with func.__code__ = func.__code__.replace().
interp->func_state.func_version_cache[ | ||
version % FUNC_VERSION_CACHE_SIZE] = func; |
There was a problem hiding this comment.
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:
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.
There was a problem hiding this comment.
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.
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.)