-
-
Notifications
You must be signed in to change notification settings - Fork 922
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
Build a new pass that ensures that ruby locals / IR tmps are initialized #2465
Comments
I added the AddMissingInitsPass for this. However, we are not ready to get rid of the null check in DynamicScope var lookups since we have the interpreter that runs in startup mode where no passes have run. So, that would require a specialized implementation of DynamicScope for the JIT and the interpreter where the former would be vastly simplified without the null checks. That is a different beast and I am inclined to close this ticket and maybe a different ticket for using an optimized version of DynamicScope without null checks? /cc @headius @enebo .. |
@subbuss That does sound like a good idea. If Full/JIT could allocate DynamicScope instances that don't do need to do null checks, it would help reduce code size and complexity, potentially letting more stuff inline and optimize. This could also be combined with dynamically generating DynamicScope subclasses that have exactly the right number of variables, so we're never allocating an array to hold them. So yes, 👍 to opening a new issue for smarter DynamicScope null checking. |
Err I should add why I want this as well. If we want to test all passes usable and testable via full interp then I think we need to have full interp act as closely to JIT as we can internally. |
Created #4167. |
So, in the snippet below, x is not initialized on all paths.
So, this requires JRuby to return nil if a local var look fails. We can get rid of those if the IR can introduce necessarily initializations on all code paths. This will simply DynamicScope var looks and also eliminate conditionals in variable retrieves (see https://github.com/jruby/jruby/blob/master/core/src/main/java/org/jruby/ir/operands/TemporaryLocalVariable.java#L48-L61)
The text was updated successfully, but these errors were encountered: