-
-
Notifications
You must be signed in to change notification settings - Fork 925
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
Rails new fails on master 9e6c2be in Thor #2198
Comments
Finished and it fingered 0630462 .. but turning off the pass in master doesn't fix it. Will investigate tomorrow. It will also help find a regression spec. |
Looked into this a little bit. If I disable frame-removal optimization in AddCallProtocolInstructions.java (replace "return requiresFrame" with "return true" .. line 150 of that file), this works again. The reason I came to this is by finding that the 'self' used to verify access protection is not the same as the receiver passed into the call. This is because invoke methods in RubyClass.java use "IRubyObject caller = context.getFrameSelf();" to test access protections. So, if a frame has been eliminated for these scopes, it uses the wrong object to test access protection! Pinging @headius and @enebo to see what the right fix is for this. But, I am also curious why RubyClass.java:invoke is using frame-self rather than the 'self' that has been passed in. If there is a reason for doing that, 'doesItRequireFrame' method requires an update to not eliminate frames that have these 'invoke' calls. We also need a regression spec for this. |
Ah never mind .. I get it .. access protection has to use the self of the caller's frame. So, there is an information gap here in the doesItRequireFrame method. |
Looking around, looks like attr-assign instructions are the only users of Helpers.invoke(..) .. so, the easy fix was to add a computeScopeFlags() to that and fix it. However, a better fix would be to explicitly pass in the caller-self into Helpers.invoke(..) since that is available rather than try to get it off the frame stack. Longer term, we should be able to make access-protection checks, method lookups, etc. as separate instructions which could then be optimized away in certain scenarios. |
While the regression spec is passing via jruby -S rspec, in actuality, default jruby run fails the test. But, jruby -X-C passes it. See below. So, the attr_reader access check is not working in JIT mode? [subbu@earth lib] jruby /tmp/boo.rb protected a = [] begin p a |
Opening a new issue for this. |
The text was updated successfully, but these errors were encountered: