Conversation
This is a hack to fix argument forwarding when callInfo must be passed along. The original callInfo is captured at the top of the method and used to pre-load a callInfo before later calls that forward arguments. A new keyword flag CALL_FORWARDING is added to specify that the already-prepared callInfo should be left as-is. This allows the downstream calls to see the incoming arguments and callInfo metadata largely as they were first received. It is hacky for a number of reasons: * The new CALL_FORWARDING argument is just a hack to say "don't set callInfo because I already set it. A better pattern would be to build this intelligence into call/super handling. * This likely doesn't work properly with the Prism parser and will require additional patches there. * In both cases, introducing new IR instructions that specifically know how to handle forwarding would mean better optimization and fewer fragile hacks. This patch works well enough to pass the cases from jruby/jruy#9328 but I'm dubious as to whether the fix is worth the hack. Generated in part by GPT 5.6 but heavily refactored to remove excess complexity.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a hack to fix argument forwarding when callInfo must be passed along.
The original callInfo is captured at the top of the method and used to pre-load a callInfo before later calls that forward arguments. A new keyword flag CALL_FORWARDING is added to specify that the already-prepared callInfo should be left as-is. This allows the downstream calls to see the incoming arguments and callInfo metadata largely as they were first received.
It is hacky for a number of reasons:
This patch works well enough to pass the cases from jruby/jruy#9328 but I'm dubious as to whether the fix is worth the hack.
Generated in part by GPT 5.6 but heavily refactored to remove excess complexity.