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.
Implement Proc#with_refinements #9486
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
base: ruby-4.1
Are you sure you want to change the base?
Uh oh!
There was an error while loading. Please reload this page.
Implement Proc#with_refinements #9486
Changes from 1 commit
4bad41cb7984b39e39cde012a64432f5d0cadc117a462bd3514f028842880baabecd2a0e59e7d5672e5bf3b31e9File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
The initial implementation OR-ed `ii.isRefinementsClone()` into the `potentiallyRefined` argument of ~14 call-bearing instruction clone() methods so that a Proc#with_refinements clone would rebuild each call as a refined call site. That pattern was scattered and fragile: any call-bearing instruction whose clone() forgot the OR (e.g. MatchInstr, ArrayDerefInstr) would silently lose refinements, with no compile-time error. It was also redundant. CallBase's constructor already derives refinement from the call's scope: boolean effectivelyRefined = potentiallyRefined || (scope != null && scope.maybeUsingRefinements()); cloneForInlining sets setIsMaybeUsingRefinements() on the clone's scope before its instructions are cloned, and every cloned call instruction is built with that scope, so the scope check alone already marks them refined -- which is exactly how MatchInstr/ArrayDerefInstr (which never had the OR) already worked. So drop the per-clone OR and let the single CallBase choke point handle all instruction types uniformly, including any that were missed or are added later. The Fixnum/Float fast-path clones keep their explicit downgrade to a generic refined call: that changes instruction selection (the primitive path bypasses the call site), not just the call-site flavor, so it cannot be centralized into CallBase. Verified: a probe covering plain/operator/===/[]=/block/varargs/nested/ super refined calls is unchanged before and after; feature suite (17) and MRI test_proc/test_refinement/test_method (284) pass. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>Uh oh!
There was an error while loading. Please reload this page.
There are no files selected for viewing
Uh oh!
There was an error while loading. Please reload this page.