-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
WIP: Turn Expr(:method) into a builtin
#60099
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
base: master
Are you sure you want to change the base?
Conversation
Continues the recent work to turn special lowered-IR forms into builtins when those forms do not have any syntactic impact. Written by Claude. Will hold until #59870 merges and then make the analogous changes there.
vtjnash
left a comment
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.
SGTM
| e.head = deserialize(s)::Symbol | ||
| e.args = Any[ deserialize(s) for i = 1:len ] | ||
|
|
||
| # Rewrite old :method expressions to define_method calls |
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.
Seems unlikely we should encounter or support this, since pre-lowered top level code is a pretty buggy concept even in a single session
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.
We have a specific test for this case, so I added the compat. We can remove the test if course
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.
Weird, but I guess harmless probably
| mt = (jl_methtable_t*)fname; | ||
| jl_value_t *atypes = args[2]; | ||
| jl_value_t *meth = args[3]; | ||
| jl_method_t *ret = jl_method_def((jl_svec_t*)atypes, mt, (jl_code_info_t*)meth, module); |
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.
Does this need a check that the module is "open" or does it already have that internally?
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'll double check, but you may be correct that we were relying on the eval check before.
Continues the recent work to turn special lowered-IR forms into builtins when those forms do not have any syntactic impact. Written by Claude. Will hold until #59870 merges and then make the analogous changes there.