-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
[mono] Don't use direct wrapper when invoking cctors, so all cctors can share one wrapper #102375
Conversation
…invoke, so we can share the wrapper for all cctors
Surprisingly, this passes tests. So it just needs expert review I think, especially to make sure it's not going to regress AOT startup by knocking cctors into the interp or perhaps demoting AOT'd wrappers to interpreted ones. |
This approach looks fragile and confusing to me. I think we should just have a different wrapper for runtime invoke that we know can only be called from interpreter (and that should never be jit/aot compiled). It could completely reuse the code for the already existing runtime invoke wrappers. I think we should be able to pass pretty much just the |
Should I add a new wrapper type or a new wrapper subtype? I think changing the generated code for the wrapper shouldn't be too hard.
OK, so it needs to be calli_interpmethod, not calli_monomethod? I can do that. |
Draft Pull Request was automatically closed for 30 days of inactivity. Please let us know if you'd like to reopen it. |
Draft Pull Request was automatically closed for 30 days of inactivity. Please let us know if you'd like to reopen it. |
Should improve interp startup time a bit, since right now we generate one wrapper for every cctor, and lots of cctors get called during app startup. From my testing this doesn't break AOT, but I can't tell whether this is accidentally causing us to interpret cctors that were AOT'd.
I added some new assertions in various places because of some crashes I hit while making my way to this change; happy to take them out.
cc @BrzVlad @kotlarmilos would appreciate thoughts on the right way to do this. this is just my first attempt that worked, i still don't understand all this code well
my thinking here: