You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The IR creates new compiler passes using reflection. This causes problems for people doing things such as AOT compilation. Can we avoid it? Could we switch this reflection to factory methods?
The reason I'm asking rather than just going ahead and doing it is that I thought that maybe there is something more complex going on here. Are you trying to support runtime loading of compiler passes or something like that?
@subbuss and @enebo will have to comment, but I assumed it was so we could configure the passes that run at runtime and potentially include new passes without modifying any code.
I'm guessing you're asking about this because it causes problems for the substrate build? There will certainly be other places we load code reflectively.
Yeah - Substrate or any other hypothetical AOT tool people might want to run in the future.
I'm going through and substituting all the places that use reflection or class loaders. I can work around most of them - such as those in Joda and JCodings. Some stuff I'm just disabling for now, like requiring class files or converting Ruby objects to Java objects.
IR compiler phases could be simply switched to factory methods so that I don't have to do anything with them. We could then add a factory method that does use reflection if that's needed. This would allow the IR interpreter to be used in Substrate, and if someone ever wrote a Graal backend for IR, or a byte code interpreter in Truffle, that would work as well.
Yeah this was done to make passes pluggable without being in source. I think jruby-visualizer might? have one. We can make a factory for the builtin ones and lookup based on name from that factory so we can remove reflection for builtin passes. We should probably be doing that anyways.
The IR creates new compiler passes using reflection. This causes problems for people doing things such as AOT compilation. Can we avoid it? Could we switch this reflection to factory methods?
The reason I'm asking rather than just going ahead and doing it is that I thought that maybe there is something more complex going on here. Are you trying to support runtime loading of compiler passes or something like that?
https://github.com/jruby/jruby/blob/master/core/src/main/java/org/jruby/ir/passes/CompilerPass.java#L136-L154
@subbuss
The text was updated successfully, but these errors were encountered: