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

export jl_resolve_globals_in_ir #42013

Merged
merged 1 commit into from
Aug 26, 2021
Merged

export jl_resolve_globals_in_ir #42013

merged 1 commit into from
Aug 26, 2021

Conversation

aviatesk
Copy link
Member

@aviatesk aviatesk commented Aug 26, 2021

This would be very useful for external AbstractInterpreters
to infer (and possibly even optimize) toplevel thunks.
(like aviatesk/JET.jl#241)

/cc @timholy we may be able to use this to eliminate some special casings within JuliaInterpreter (like resolving toplevel Symbols as GlobalRefs). The code may end up being more complex on the contrary because of the compatibility with older Julia versions though.

This would be very useful for external `AbstractInterpreter`s
to infer (and possibly even optimize) toplevel thunks.
@aviatesk aviatesk requested a review from vtjnash August 26, 2021 10:54
aviatesk added a commit to aviatesk/JET.jl that referenced this pull request Aug 26, 2021
Better to work with <JuliaLang/julia#42013>, but
I also added an hacky fallback that makes use of the existing method
definition pipeline.
aviatesk added a commit to aviatesk/JET.jl that referenced this pull request Aug 26, 2021
Better to work with <JuliaLang/julia#42013>, but
I also added an hacky fallback that makes use of the existing method
definition pipeline.
@timholy
Copy link
Member

timholy commented Aug 26, 2021

Sort of like with Cthulhu we could do a clean break, and indeed strive for a bit of unification between the two interpreters. It might make sense, though, to redesign the interpretation byte-code (e.g., JuliaDebug/JuliaInterpreter.jl#309) first.

aviatesk added a commit to aviatesk/JET.jl that referenced this pull request Aug 26, 2021
Better to work with <JuliaLang/julia#42013>, but
I also added an hacky fallback that makes use of the existing method
definition pipeline.
aviatesk added a commit to aviatesk/JET.jl that referenced this pull request Aug 26, 2021
Better to work with <JuliaLang/julia#42013>, but
I also added an hacky fallback that makes use of the existing method
definition pipeline.
aviatesk added a commit to aviatesk/JET.jl that referenced this pull request Aug 26, 2021
Better to work with <JuliaLang/julia#42013>, but
I also added an hacky fallback that makes use of the existing method
definition pipeline.
aviatesk added a commit to aviatesk/JET.jl that referenced this pull request Aug 26, 2021
Better to work with <JuliaLang/julia#42013>, but
I also added an hacky fallback that makes use of the existing method
definition pipeline.
aviatesk added a commit to aviatesk/JET.jl that referenced this pull request Aug 26, 2021
Better to work with <JuliaLang/julia#42013>, but
I also added an hacky fallback that makes use of the existing method
definition pipeline.
Copy link
Member

@vtjnash vtjnash left a comment

Choose a reason for hiding this comment

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

Note though that this has global side-effects, so you should only call it if you are executing the code.

@aviatesk
Copy link
Member Author

Note though that this has global side-effects, so you should only call it if you are executing the code.

Yeah, but that side-effects are already involved with method definitions, right ?
(I have to admit that JET isn't fully-static in this sense...)

@vtjnash
Copy link
Member

vtjnash commented Aug 26, 2021

Ah, and it looks like you can selectively disable them with setting binding_effects=0 too

@aviatesk
Copy link
Member Author

Well there are also possibilities that :foreigncall and :cfunction expressions can throw within this function, so I think I have to handle those errors anyway.

@aviatesk aviatesk merged commit f7506aa into master Aug 26, 2021
@aviatesk aviatesk deleted the avi/exportresolve branch August 26, 2021 15:41
aviatesk added a commit to aviatesk/JET.jl that referenced this pull request Aug 26, 2021
Better to work with <JuliaLang/julia#42013>, but
I also added an hacky fallback that makes use of the existing method
definition pipeline.
aviatesk added a commit to aviatesk/JET.jl that referenced this pull request Aug 26, 2021
…ngs (#241)

Better to work with <JuliaLang/julia#42013>, but
I also added an hacky fallback that makes use of the existing method
definition pipeline.
LilithHafner pushed a commit to LilithHafner/julia that referenced this pull request Feb 22, 2022
This would be very useful for external `AbstractInterpreter`s
to infer (and possibly even optimize) toplevel thunks.
LilithHafner pushed a commit to LilithHafner/julia that referenced this pull request Mar 8, 2022
This would be very useful for external `AbstractInterpreter`s
to infer (and possibly even optimize) toplevel thunks.
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