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

Sink CodeInfo transformation into transform_result_for_cache #56897

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Keno
Copy link
Member

@Keno Keno commented Dec 23, 2024

Several downstream consumers want to cache IRCode rather than CodeInfo. Right now they need to override both finish! and transform_result_for_cache. With this change, only overriding the latter should be sufficient. As a nice bonus, we can avoid doing the work of converting to CodeInfo for interpreters that don't cache at all such as the REPL interpreter.

Several downstream consumers want to cache IRCode rather than CodeInfo.
Right now they need to override both `finish!` and `transform_result_for_cache`.
With this change, only overriding the latter should be sufficient.
As a nice bonus, we can avoid doing the work of converting to CodeInfo
for interpreters that don't cache at all such as the REPL interpreter.
@Keno Keno requested a review from aviatesk December 23, 2024 20:21
Copy link
Member

@aviatesk aviatesk left a comment

Choose a reason for hiding this comment

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

This change removes the assignments to caller.src and result.src, but opt.src should already be identical to their CodeInfo. My understanding is that it is destructively updated by ir_to_codeinf!.

@Keno
Copy link
Member Author

Keno commented Dec 24, 2024

Yes, the code path that goes through finish! twice (although I'm not sure why that happens - possibly a bug?) takes the ir === nothing path now.

@vtjnash
Copy link
Member

vtjnash commented Dec 24, 2024

although I'm not sure why that happens - possibly a bug?

Somewhat of an implementation defect, though one needed to ensure the soundness of the caller mode currently. This is the reason for #56880 which deletes that call, so we could likely just merge that PR first. I think it will have some superficial conflicts with this PR, but nothing significant and VSCode merge tool might be able to figure it out. (the tests on that PR are hitting a different bug in Windows, apparently by changing the probability of encountering it on that particular test for the specific issue, so that PR is almost ready to merge, but I need some time to fix the other bug)

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.

3 participants