-
Notifications
You must be signed in to change notification settings - Fork 5.4k
ZJIT: Support invalidating on method redefinition #13875
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
Merged
tekknolagi
merged 1 commit into
ruby:master
from
Shopify:zjit-support-invalidating-method-redefinition
Jul 18, 2025
Merged
ZJIT: Support invalidating on method redefinition #13875
tekknolagi
merged 1 commit into
ruby:master
from
Shopify:zjit-support-invalidating-method-redefinition
Jul 18, 2025
+168
−69
Conversation
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
I'm investigating the segfault on ubuntu atm. |
This comment has been minimized.
This comment has been minimized.
723380b
to
2b9fdc5
Compare
tekknolagi
reviewed
Jul 16, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice
tekknolagi
reviewed
Jul 16, 2025
e2658e6
to
e84548d
Compare
Try another rebase? |
e84548d
to
0afb145
Compare
This commit adds support for the MethodRedefined invariant to be invalidated when a method is redefined. Changes: - Added CME pointer to the MethodRedefined invariant in HIR - Updated all places where MethodRedefined invariants are created to include the CME pointer - Added handling for MethodRedefined invariants in gen_patch_point to call track_cme_assumption, which registers the patch point for invalidation when rb_zjit_cme_invalidate is called This ensures that when a method is redefined, all JIT code that depends on that method will be properly invalidated.
0afb145
to
ad85148
Compare
tekknolagi
approved these changes
Jul 18, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, lgtm
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 commit adds support for the MethodRedefined invariant to be invalidated when a method is redefined.
Changes:
MethodRedefined
invariant in HIRMethodRedefined
invariants are created to include the CME pointerMethodRedefined
invariants ingen_patch_point
to calltrack_cme_assumption
, which registers the patch point for invalidation whenrb_zjit_cme_invalidate
is calledThis ensures that when a method is redefined, all JIT code that depends on that method will be properly invalidated.