-
-
Notifications
You must be signed in to change notification settings - Fork 31k
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-88691: Shrink the CALL
caches
#103230
Merged
Merged
GH-88691: Shrink the CALL
caches
#103230
Changes from 6 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
187f060
Shrink the CALL caches
brandtbucher ddd0968
Catch up with main
brandtbucher 29928ee
Add another assert
brandtbucher 3282d10
Bump the magic number
brandtbucher 7b6a83e
blurb add
brandtbucher 5d9ca5f
Fix doctest
brandtbucher d02b607
Get rid of the rest of the CALL cache
brandtbucher d2ebc2e
Revert "Get rid of the rest of the CALL cache"
brandtbucher File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
Misc/NEWS.d/next/Core and Builtins/2023-03-25-23-24-38.gh-issue-88691.2SWBd1.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Reduce the number of inline :opcode:`CACHE` entries for :opcode:`CALL`. |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Why do we need these checks at all?
I suspect that I added them, but I'm not sure why.
If
func->func_version == func_version
then the only variable isargcount
which isoparg + is_meth
.So we only need to know which of the two possible values of
is_meth
is safe.Can precompute those at specialization, so we only need to check
is_meth
at runtime.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.
It looks like we just had space for it at the time (when cache sizes were fixed).
The obvious way to do this would be to split this into two specializations: one that expects
is_meth
, and one that doesn't.With that said, I'm not sure it's worth breaking up. There would be a decent amount of code duplication, and this opcode is relatively rare (~0.1% of all instructions executed). So maybe we should just leave it.
(Maybe if we really wanted to, we could use the low bit of the
func_version
cache entry.)