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

Run jl_resolve_globals_in_ir on the result of generated functions #39483

Merged
merged 1 commit into from
Feb 5, 2021

Conversation

Keno
Copy link
Member

@Keno Keno commented Feb 2, 2021

We didn't use to run this when the generated function returned
a CodeInfo (though we did run it for AST). However, now that
this also does the conversion of :opaque_closure_method to
actual Method objects, I think the best thing to do would
be to run it here to avoid the generated function having
to construct its own Method object from scratch.

We didn't use to run this when the generated function returned
a CodeInfo (though we did run it for AST). However, now that
this also does the conversion of :opaque_closure_method to
actual Method objects, I think the best thing to do would
be to run it here to avoid the generated function having
to construct its own Method object from scratch.
$(Expr(:meta, :generated_only))
$(Expr(:meta,
:generated,
Expr(:new,
Copy link
Sponsor Member

Choose a reason for hiding this comment

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

Could this be written using @generated to depend less on implementation details?

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't think @generated are allowed to return CodeInfo anymore.

Copy link
Sponsor Member

Choose a reason for hiding this comment

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

When did that happen? So can we remove the rest of the code supporting it?

Copy link
Member Author

Choose a reason for hiding this comment

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

Generated functions still support it, you just can't get there with the @generated syntax. If you try it, the macro will wrap it in an AST for you. No idea if that was intentional, but I assume it happened when the generated function internals were changed.

@Keno
Copy link
Member Author

Keno commented Feb 3, 2021

As per discussion yesterday, we need some way of identifying these methods once we allow them in inference. However, since inference just ignores these currently, I think this PR is good to merge as is. @JeffBezanson @vtjnash anything I missed?

@JeffBezanson JeffBezanson merged commit e180da2 into master Feb 5, 2021
@JeffBezanson JeffBezanson deleted the kf/ocgenerated branch February 5, 2021 22:47
ElOceanografo pushed a commit to ElOceanografo/julia that referenced this pull request May 4, 2021
…liaLang#39483)

We didn't use to run this when the generated function returned a CodeInfo (though we did run it for AST). However, now that this also does the conversion of :opaque_closure_method to actual Method objects, I think the best thing to do would
be to run it here to avoid the generated function having to construct its own Method object from scratch.
antoine-levitt pushed a commit to antoine-levitt/julia that referenced this pull request May 9, 2021
…liaLang#39483)

We didn't use to run this when the generated function returned a CodeInfo (though we did run it for AST). However, now that this also does the conversion of :opaque_closure_method to actual Method objects, I think the best thing to do would
be to run it here to avoid the generated function having to construct its own Method object from scratch.
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.

2 participants