[pull] master from ruby:master#789
Merged
pull[bot] merged 4 commits intoturkdevops:masterfrom Feb 18, 2026
Merged
Conversation
When building on macOS, we get a warning about duplicate libraries
ld: warning: ignoring duplicate libraries: '-ldl', '-lobjc', '-lpthread'
To fix it, we now append $(MAINLIBS) to LIBRUBYARG_SHARED (when shared
is enabled), matching what's already done for LIBRUBYARG_STATIC. And we
remove the now-redundant $(MAINLIBS) from the $(PROGRAM) link line,
since $(LIBRUBYARG) carries it in both cases.
Previously, when dealing with a `super()` nested in a block that runs as a method (through e.g. `define_method`), YJIT generated a guard that never passes leading to a misidentification of the callsite as megamorphic and an unconditional interpreter fallback. The issue was in the subroutine to find the currently running method entry. In the interpreter, this is rb_vm_frame_method_entry(). YJIT used `gen_get_lep()` to find the EP with `VM_ENV_FLAG_LOCAL`, but in case of BMETHODs, the corresponding CME is never at an EP level with `VM_ENV_FLAG_LOCAL` set. Because each block nesting level can dynamically run as either a BMETHOD or not, starting at a block and finding the first EP that has a method entry ultimately requires a search loop such as the one in rb_vm_frame_method_entry(). This patch introduces such a loop. Because `invokesuper` in a block can now work end-to-end, add check for the previously masked "implicit argument passing of super from method defined by define_method() is not supported..." condition.
As we found out from YJIT, `super` from within a block needs a loop for the running CME guard, and the current LEP based guard always fails. Don't specialize for now so we use the fallback instead of side-exiting.
After a review of all callers, this doesn't appear to be needed for correct behavior. We could potentially have a future case where it is needed, such as a method that inserts a record into the set and returns the inserted record (which could be different from the argument if the argument was an unfrozen string). However, we don't currently have such a case, and it's better for performance to remove the code.
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )